2022年2022年静态路由配置 .pdf
静态路由配置 iproute01路由器的串口是背对背的直接连接,因此,有一个串口要配置时钟速率,使用 clock rate 命令进行配置,配置时钟速率的一串口为 DCE 端。路由器基本配置R1:Router enableRouter# configure terminalEnter configuration commands, one per line. End with CNTL/Z.Router# ip routingRouter(config)# interface FastEthernet 0/0Router(config-if)# ip address 192.168.1.1 255.255.255.0Router(config-if)# no shutdownRouter(config-if)#%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0,changed state to upRouter(config-if)# exitRouter(config)# interface Serial 2/0Router(config-if)# ip address 192.168.2.1 255.255.255.0名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 1 页,共 4 页 - - - - - - - - - Router(config-if)# clock rate 64000Router(config-if)# no shutdown%LINK-5-CHANGED: Interface Serial2/0, changed state to downRouter(config-if)# endRouter#%SYS-5-CONFIG_I: Configured from console by consoleRouter#R2 enableR2# configure terminalEnter configuration commands, one per line. End with CNTL/Z.R2(config)#ip routingR2(config)# interface FastEthernet 0/0R2(config-if)# ip address 192.168.3.1 255.255.255.0R2(config-if)# no shutdownR2(config-if)#%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0,changed state to upR2(config-if)# exitR2(config)# interface Serial 2/0R2(config-if)# ip address 192.168.2.2 255.255.255.0R2(config-if)# no shutdownR2(config-if)#%LINK-5-CHANGED: Interface Serial2/0, changed state to upR2(config-if)#exitR2(config)# interface Serial3/0R2(config-if)# ip address 192.168.4.1 255.255.255.0R2(config-if)# clock rate 64000R2(config-if)# no shutdown%LINK-5-CHANGED: Interface Serial3/0, changed state to downR2(config-if)#endR2#%SYS-5-CONFIG_I: Configured from console by console名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 2 页,共 4 页 - - - - - - - - - R3 enableR3# configure terminalEnter configuration commands, one per line. End with CNTL/Z.R3(config) ip routingR3(config)# interface FastEthernet 0/0R3(config-if)# ip address 192.168.5.1 255.255.255.0R3(config-if)# no shutdownR3(config-if)#%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0,changed state to upR3(config-if)#exitR3(config)# interface Serial 2/0R3(config-if)# ip address 192.168.4.2 255.255.255.0R3(config-if)#no shutdownR3(config-if)#%LINK-5-CHANGED: Interface Serial2/0, changed state to upR3(config-if)#endR3#%SYS-5-CONFIG_I: Configured from console by console%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changedstate to upR3#静态路由配置给R2配置静态路由R2(config)# ip route 192.168.1.0 255.255.255.0 192.168.2.1在路由器 R2上配置到端 PC1 所在网段的静态地址R2(config)# ip route 192.168.5.0 255.255.255.0 192.168.4.2给R1配置静态路由Router(config)#ip route 192.168.3.0 255.255.255.0 192.168.2.2Router(config)#ip route 192.168.4.0 255.255.255.0 192.168.2.2Router(config)#ip route 192.168.5.0 255.255.255.0 192.168.2.2给R3配置静态路由R3(config)#ip route 192.168.1.0 255.255.255.0 192.168.4.1名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 3 页,共 4 页 - - - - - - - - - R3(config)#ip route 192.168.2.0 255.255.255.0 192.168.4.1R3(config)#ip route 192.168.3.0 255.255.255.0 192.168.4.1名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 4 页,共 4 页 - - - - - - - - -