路由器的路由配置命令汇总(win和linux系统)
分类: 系统运维
route [-f] [-p] [Command][Destination] [mask Netmask] [Gateway] [metric Metric]] [if Interface]]
-f 清除所有网关入口的路由表。如果该参数与某个命令组合使用,路由表将在运行命令前清除。
-p 与 add 命令一起使用时使路由具有永久性。 该参数与 add 命令一起使用时,将使路由在系统引导程序之间持久存在。默认情况下,系统重新启动时不保留路由。与 print 命令一起使用时,显示已注册的持久路由列表。
忽略其他所有总是影响相应持久路由的命令。
Command 指定您想运行的命令 (Add/Change/Delete/Print)。
1.主机路由从一台主机映射一条到本地网络上的的其他主机上
command format:
route add -host destination_ip local_ip -interface interface
eg:
我们想为本地主机接口hme0(204.12.17.1)和另一台在相邻才C类网络上的主机(204.12.16.100)之间增加一条路由
#route add -host 204.12.16.100 204.12.17.1 -interface hme0
增加一个到另一个网络的的直接路由
command format:
route add -net destination_network_ip local_ip -netmask mask
eg:
如果我们要想为C类网掩码在本地主机(204.12.17.1)和我们上面指出的网络之间增加一条路由(204.12.16.0网络)我们可以使用如下的命令:
#route add -net 204.12.16.0 204.12.17.1 -netmask 255.255.255.0
command format:
route add default hostname -interface interface
eg:增加一条到本地路由器(204.54.56.1)的缺省路由,通常用在添加网关并马上生效
#route add default 204.54.56.1 -interface hme1
/? 在命令提示符处显示帮助。
destination 或 gateway 使用的符号名称。如果命令是 print 或 delete,目标和网关
还可以使用通配符,也可以省略网关参数。
示例
若要显示 IP 路由表的全部内容,请键入:
route print
route print 10.*
route add 0.0.0.0 mask 0.0.0.0 192.168.12.1
route add 10.41.0.0 mask 255.255.0.0 10.27.0.1
route -p add 10.41.0.0 mask 255.255.0.0 10.27.0.1
route add 10.41.0.0 mask 255.255.0.0 10.27.0.1 metric 7
route add 10.41.0.0 mask 255.255.0.0 10.27.0.1 if 0x3
route delete 10.41.0.0 mask 255.255.0.0
route delete 10.*
route change 10.41.0.0 mask 255.255.0.0 10.27.0.25
1.ifconfig 查看网络接口的信息。普通用户使用ifconfig的全路径:/sbin/ifconfig
ifconfig eth0 hw ether 1234567890ab
ifconfig eht0 up
router>enable
router#
router#config terminal
router(config)#
router(config)#hostname A
A(config)#
A(config)#interface fastethernet 0/0
A(config-if)#
router#show interface serial 0/0
serial 0/0 is up ,line protocol is up
可操作状态………serial 0/0 is up ,line protocol is up
连接问题…………serial 0/0 is up ,line protocol is down
接口问题…………serial 0/0 is down ,line protocol is down
禁用状态…………serial 0/0 is administratively down ,line protocol is down
|
192.168.1.1
|
|
192.168.2.2
|
|
192.168.2.1
|
|
192.168.3.1
|
|
192.168.1.10
|
|
192.168.3.10
|
静态路由的实现
router(config)#hostname A
A(config)#interface f0/0
A(config-if)#ip address ip地址 子网掩码
A(config-if)#no shutdown
B(config)#interface f0/1
B(config-if)#ip address ip地址 子网掩码
B(config-if)#no shutdown
A(config)#ip route 目标网络地址 子网掩码 下一跳地址
B(config)#ip route 目标网络地址 子网掩码 下一跳地址
route(config)#ip route 0.0.0.0 0.0.0.0 下一跳地址
router#show ip route
其中C代表直连的网络,S代表静态的路由,S*代表默认的路由
router (config-line)#login
router (config-line)#password cisco
router (config)#enable password cisco
router (config)#enable secret 1234
router (config)#service password-encryption
router(config)#line console 0
router(config-line)#exec-timeout 0 0 //第一个0代表分钟,第二个0代表秒 此处0 0为永不超时
router(config)#line console 0
router(config-line)#logging synchronous
router(config)#no ip domain-lookup
重启路由器按Ctrl+Break键进入ROM Monitor 模式
rommon 1>confreg 0x2142
rommon 2>reset
重启后选择no
router>enable
router#copy startup-config running-config
router#config terminal
router(config)#enable password cisco
router(config)#config-register 0x2102
router#copy running-config startup-config
router#reloa
路由器的路由配置命令汇总(win和linux系统)的更多相关文章
- CCNA网络工程师学习进程(7)路由器的路由配置
前面一节已经介绍了路由器的端口配置,接着我们介绍路由器的路由配置:静态路由.默认路由和浮动路由的配置:动态路由协议的配置,包括RIP.IGRP.EIGRP和OSPF. (1)路由器的基 ...
- redhat 安装配置samba实现win共享linux主机目录
[转]http://blog.chinaunix.net/uid-26642180-id-3135941.html redhat 安装配置samba实现win共享linux主机目录 2012-03-1 ...
- centos7/rhel7下配置PXE+Kickstart自动安装linux系统
应用场景:临时安装一个系统或者批量安装linux系统,无需人工介入选择下一步,减少在安装系统上的时间浪费,提高工作效率. DHCP + TFTP + Syslinux + FTP + Kickstar ...
- 获取Win和Linux系统启动时间,类似uptime功能,用于判断是否修改过系统时间
目录 前言 测试代码 Win测试 Linux测试 总结 前言 有时候需要判断系统是否有修改过时间,最简单的方法就是获取当前时间A,然后sleep X秒,然后获取 时间B,如果 时间B - 时间A ≠ ...
- 使用SCP命令在多个linux系统间进行copy拷贝,上传,下载...
一,什么是scp scp是linux系统下基于ssh登陆进行安全的远程文件拷贝命令.scp命令可以在linux服务器之间复制文件和目录.scp使用ssh安全协议传输数据,具有和ssh一样的验证机制,从 ...
- 使用scp命令在多个Linux系统间进行文件复制
一,什么是scp scp是linux系统下基于ssh登陆进行安全的远程文件拷贝命令.scp命令可以在linux服务器之间复制文件和目录.scp使用ssh安全协议传输数据,具有和ssh一样的验证机制,从 ...
- 华为路由器RIP路由协议配置命令
RIP路由协议配置 rip 创建开启协议进程 network + ip 对指定网段接口使能RIP功能IP地址是与路由器直连的网段 debugging rip 1 查看RIP定期更新情况 termina ...
- cisco交换机路由器静态路由配置
一.切换模式 router>en //用户模式enable router#conf t //特权模式 ...
- 华为路由器NAT基本配置命令
NAT地址转换 静态 [R1]int g0/0/0 [R1-GigabitEthernet0/0/0]nat static global 202.169.10.5 inside 172.16.1.1 ...
随机推荐
- 解决wpscan无法更新
如果wpscan无法更新的话 一般的原因都是源或者更新地址无法访问 下面解决 updatedb #先更新一下系统的索引 locate wpscan #定位到wpscan的目录 大概就是updater. ...
- stm32 usart 串口
比特率是每秒钟传输二进制代码的位数,单位是:位/秒(bps).如每秒钟传送240个字符, 而每个字符格式包含10位(1个起始位.1个停止位.8个数据位),这时的比特率为: 10位 × 240个/秒 = ...
- 页面使用element-tree
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- dl pthread m库的含义
dl:dlopen dlerror dlclose dlsym等函数的库 m:math.h中声明的库函数,比如log10等 pthread:线程建立函数 参考: Linux 编译C程序遇到依赖libm ...
- (15)while循环
循环结构 : while 循环结构的特点:减少代码的冗余,提高代码的效率注意:只要是循环一定要有判断条件退出循环,不然就成了死循环,程序会一直在内存执行,直到内存耗尽,暴毙..... 语法形式: wh ...
- webpack中typeScript的打包配置
2018年typescript发展的非常好,js是一门非常灵活的语言,所以一个功能,怎么写都能够写出来,但是这也会导致一个问题,不同人写js的方式不同,那么会导致同一个功能出现的代码风格会迥然不同.这 ...
- golang 2 ways to delete an element from a slice
2 ways to delete an element from a slice yourbasic.org/golang Fast version (changes order) a := []st ...
- 甘特图、Data Editors控件新玩法—DevExpress WPF v19.2
通过DevExpress WPF Controls,你能创建有着强大互动功能的XAML基础应用程序,这些应用程序专注于当代客户的需求和构建未来新一代支持触摸的解决方案. 无论是Office办公软件的衍 ...
- 基于SSM框架的通用权限框架设计
1. 整体解决方案概述 1.1 权限整体解决方案概述 权限设计主要有一下几大部分组成: PassPort: 针对现在系统的分析,系统之间有部分信息是共享的,这部分信息将由 ...
- 使用math中的hypot实现向量
from math import hypot class Vector: def __init__(self,x=0,y=0): self.x = x self.y = y def __repr__( ...