admin 管理员组文章数量: 1086019
2024年3月26日发(作者:bind函数python)
路由器配置
- 1 -
路由器的配置命令
Router> (用户模式)
Router>enable (进入特权模式)
Router# (特权模式)
Router#configure terminal (进入全局配置模式)
Router(config)# (全局配置模式)
Router(config)#hostname XXX (设置路由器主机名)
Router(config)#enable password 123 (设置特权非密口令)
Router(config)#enable secret 123 (设置特权加密口令)
Router(config)#interface f0/6 (进入端口配置模式)
Router(config-if)# (端口配置模式)
Router(config)#line consode 0 (进入控制台端口)
Router(config)#line vty 0 4 (进入虚拟终端配置模式)
Router(config- line)# (虚拟终端配置模式)
Router(config)#router rip (进入rip路由协议配置模式)
Router(config-router) ( rip路由协议配置模式)
Router(config-router)network 159.105.0.0 (设置参与RIP协议的网络地址,不支持可变长掩码,只有IP网络号)
Router(config)#router ospf 63 (进入ospf路由协议配置模式)
Router(config-router) # ( ospf路由协议配置模式)
Router#write memory (保存配置到路由器的NVRAM中)
Router#write network tftp (保存配置到TFTP服务器中)
Router#write erase (删除路由配置)
设置模式(setup) 刚出厂第一次建立配置文件
RXBOOT模式 密码丢失,进入可以恢复密码
exit逐级退出 end 或ctrl+z 直接退至特权模式
基本命令:telnet ping trace show
telnet 可以由一台路由器登录到另一台路由器,最多支持5个连接。
ping 可以通过echo协议判断网络的连接情况。
trace 查询网络上数据传输流向的理想工具,测试转发分组的每一步,不可达***,退出Ctrl-Shinf-6
show 查看了解路由器的各种信息。
R1>show flash 查看FLASH
R1>show clock 查看时钟
R1>show version 查看路由器软件、硬件版本
在特权模式查看:
R1#show configuration 查看路由器配置
R1#show ip route 查看路由表
R1#show ip protocols 查看路由协议的详细信息
配置方式:
1.使用控制端口(console)配置
2.使用AUX端口连接一台Modem,通过拨号远程配置路由器.
3.使用telnet远程登录到路由器上配置.
4.使用TFTP服务,拷贝配件文件,修改配置文件的形式配置路由器
5.通过网络管理协议SNMP修改路由器配置文件进行配置.
远程虚拟终端配置:
Router(config)#line vty 0 4 (进入虚拟终端配置模式)
Router(config-line)#pasword 7 zzz123 (配置远程虚拟终端登录密码)
Router(config-line)#
路由器是互联不同的逻辑子网的设备,因此,他的每个接口都必须配置唯一的逻辑地址(IP),telnet登录时,可以使用任意一个处于
激活状态的接品的IP,所以路由器不需要单独配置设备管理地址,远程登录时只需要密码即可.
Router(config)#hostname R1 命名路由器R1
R1(config)#
Router(config)#enable secret xxx123 超级用户加密密码
Router(config)#enable password 7 aaa123 超级用户明文密码
Router#write memory 保存路由器配置到NVRAM中
Router#write network tftp 保存路由器配置到TFTP中
Router#write erase 清除路由器配置
Router(config)#interface g0/8
Router(config-if)#description To-shenzhen 描述,连接到深圳
Router(config)#interface pos 3/0
Router(config)#bandwidth 2500000 设置接口带宽2.5G,以kbps为单位
Router(config)#interface g0/10
Router(config-if)#ip address 192.168.1.22 255.255.255.0 配置接口IP地址
Router(config)#interface g0/10
Router(config-if)# no shutdown 开启接口
- 1 -
路由器配置
标准以太网
Router(config)#interface E0 进入标准以太网E接口
Router(config-if)#description To-shanghai 连接到上海
Router(config-if)#ip address 202.112.7.4 255.255.255.0 端口IP地址
Router(config-if)#bandwidth 1000 带宽1G
Router(config-if)#exit
Router(config)#exit
Router#
快速以太网
Router(config)#inerface f2/1 进入快速以太网f接口
Router(config-if)#description To-beijing 连接到北京
Router(config-if)#ip address 202.112.41.145 255.255.255.240 端口IP地址
Router(config-if)#bandwidth 2000000 带宽2G
Router(config-if)#duplex full 模式为全双工(full双工 hull半双工 auto自动)
Router(config-if)#no ip directed-broadcast 禁止定向子网广播
Router(config-if)#no ip proxy-arp 不作arp代理
Router(config-if)#no shutdown 开启端口.
Router(config-if)#exit 退出
千兆以太网
Router(config)#inerface g0/1 进入千兆以太网g接口
Router(config-if)#description To-beijing 连接到北京
Router(config-if)#ip address 202.112.41.145 255.255.255.240 端口IP地址
Router(config-if)#bandwidth 2500000 带宽2.5G
Router(config-if)#duplex full 模式为全双工(full双工 hull半双工 auto自动)
Router(config-if)#no ip directed-broadcast 禁止定向子网广播
Router(config-if)#no ip proxy-arp 不作arp代理
Router(config-if)#no shutdown 开启端口.
Router(config-if)#exit 退出
- 2 -
配置POS接口
Pos是packet over SONET/SDH的缩写,是一种利用SONT/SDH提供的高速传输通道直接传送IP数据包的技术,
POS技术支持光纤介质,是一种高速先进的广域网连接技术.链路层协议主要有PPP和HDLC,目前可以提供155M,622M,2.5G和
10G的传输速率接口.接口配置参数有接口带宽,接口地址,接口链路层协议,接口帧格式,接口CRC校验和flag(帧头中净负荷类型标
志位),要注意接口参数的一致性.
Router(config)#inerface POS3/0 进入快速以太网f接口
Router(config-if)#description To-beijing 连接到北京
Router(config-if)#bandwidth 10000000 带宽10G
Router(config-if)#ip address 202.112.41.145 255.255.255.240 端口IP地址
Router(config-if)#crc 32 (可选的crc校验位是16和32)
Router(config-if)#pos framing shd (可选的帧格式是shd和sonet)
Router(config-if)#no ip directed-broadcast 禁止定向子网广播
Router(config-if)#pos flag s1 s0 2 (注意:s1 s0 =00 表示sonet 帧数据, s1 s0 =10<十进制2> 表示sonet 帧数据)
Router(config-if)#no ip proxy-arp 不作arp代理
Router(config-if)#no shutdown 开启端口.
Router(config-if)#exit 退出
POS接口实例配置:
(2011年9月网考试题)
某园区网用2.5Gbps的POS技术与Internet相连,POS接口的帧格式是SONET。路由协议的选择方案是:园区网内部采用OSPF
动态路由协议,园区网与Internet的连接使用静态路由。
图1 网络拓扑图
问题:
请阅读以下R3和R4的部分配置信息,并补充【6】到【10】空白处的配置命令或参数,按题目要求完成路由器的配置。
- 2 -
版权声明:本文标题:路由器配置命令(最全) 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/b/1711402699a592298.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论