路由器的路由配置命令汇总(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 ...
随机推荐
- c去除空格 小写转大写
int isalnum(int c); //字母或数字 int isalpha(int c); //英文字母 int isascii(int c); //ASCII 码字符(0 到127) int i ...
- Python实现MATLAB中的 bwlabel函数
最近做验证码识别,原本用MATLAB已经实现的整个识别模型,不过代码要部署在Linux服务器上还是需要用另外的语言实现,于是决定用Python + OpenCV来实现. bwlabel函数的作用是检测 ...
- JAVA处理数字与中文数字互转(最大处理数字不超过万兆即:9999999999999999.9999)
package practice; import java.util.Arrays; /** * 数字与中文数字互转(最大处理数字不超过万兆即:9999999999999999.9999) * @au ...
- idou老师教你学Istio 28:istio-proxy check 的缓存
功能概述 istio-proxy主要的功能是连接istio的控制面组件和envoy之间的交互,其中check的功能是将envoy收集的attributes信息上报给mixer,在istio中有几十种a ...
- mongodb文件
https://github.com/mongodb/mongo/tree/master 或 https://www.mongodb.com/download-center?jmp=nav#comm ...
- mongodb模式模型设计及编码-Mongoose
走到这一步,我们的网站还不能称为动态的网站,因为所要的数据都是伪造的,所以现在要对数据库的模型进行设计 Mongoose 我们用到的工具模块是Mongoose,他能对Mongodb进行建模的这样一 ...
- xfs 文件系统
centos7.0开始默认文件系统是xfs,centos6是ext4,centos5是ext3 ext3和ext4的最大区别在于,ext3在fsck时需要耗费大量时间(文件越多,时间越长),而ext4 ...
- 显示名为“xxx.XmlSerializers”的程序集未能加载到 ID 为 1 的 AppDomain 的“LoadFrom”绑定上下文中。
VS调试程序运行中提示“显示名为“xxx.XmlSerializers”的程序集未能加载到 ID 为 1 的 AppDomain 的“LoadFrom”绑定上下文中.错误的原因为: System.IO ...
- 部署kibana节点
部署Kibana节点 1.查看系统环境: [root@Kibana ~]# hostname Kibana [root@Kibana ~]# cat /etc/redhat-release CentO ...
- python_面向对象——继承
1.继承 class Animal: def __init__(self,name,age,sex): self.name = name self.age = age self.sex = sex d ...