1、ROUTE 1 配置RouterRouterenRouter#config tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#hostname R1 修改路由器名称R1(config)#int f1/0 进入端口配置模式R1(config-if)#no shut 开启端口%LINK-5-CHANGED: Interface FastEthernet1/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Fa
2、stEthernet1/0, changed state to upR1(config-if)#ip address 192.168.1.1 255.255.255.0 为端口配置 IPR1(config-if)#exitR1(config)#int se2/0 进入端口配置模式R1(config-if)#no shut 开启端口%LINK-5-CHANGED: Interface Serial2/0, changed state to upR1(config-if)#ip address 192.168.3.1 255.255.255.0 为端口配置 IPR1(config-if)#cloc
3、k rate 64000 设置端口时钟R1(config-if)#%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changed state to upR1(config)#Z%SYS-5-CONFIG_I: Configured from console by consoleR1#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - O
4、SPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded
5、 static routeGateway of last resort is not setC 192.168.1.0/24 is directly connected, FastEthernet1/0C 192.168.3.0/24 is directly connected, Serial2/0R1#config tEnter configuration commands, one per line. End with CNTL/Z.R1(config)#ip route ?A.B.C.D Destination prefixR1(config)#ip route 192.168.2.0
6、255.255.255.0 ?A.B.C.D Forwarding routers addressEthernet IEEE 802.3FastEthernet FastEthernet IEEE 802.3GigabitEthernet GigabitEthernet IEEE 802.3zLoopback Loopback interfaceNull Null interfaceSerial SerialR1(config)#ip route 192.168.2.0 255.255.255.0 192.168.3.2 配置静态路由R1(config)#Z 非直连目的网络 直连本路由器的另一
7、个路由器端口%SYS-5-CONFIG_I: Configured from console by consoleR1#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2
8、- OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setC 192.168.1.0/24 is directly connected, FastEthernet1/0S 192.168.2.0/24
9、 1/0 via 192.168.3.2C 192.168.3.0/24 is directly connected, Serial2/0R1#ROUTE 2 配置RouterRouterenRouter#config tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#int f1/0 进入端口配置模式Router(config-if)#no shut 开启端口%LINK-5-CHANGED: Interface FastEthernet1/0, changed state to up%LIN
10、EPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to upRouter(config-if)#ip address 192.168.2.1 255.255.255.0 为端口配置 IPRouter(config-if)#int serial 2/0 进入端口配置模式Router(config-if)#ip address 192.168.3.2 255.255.255.0 为端口配置 IPRouter(config-if)#no shut 开启端口%LINK-5-CHANGED: Interf
11、ace Serial2/0, changed state to upRouter(config-if)#Z%SYS-5-CONFIG_I: Configured from console by consoleRouter#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF
12、 NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setC 192.168.2.0/24 is
13、directly connected, FastEthernet1/0Router#%LINK-5-CHANGED: Interface Serial2/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changed state to upRouterenRouter#show ip route 查看路由表配置Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX -
14、 EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP
15、 - periodic downloaded static routeGateway of last resort is not setC 192.168.2.0/24 is directly connected, FastEthernet1/0C 192.168.3.0/24 is directly connected, Serial2/0Router#enRouter#config tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#ip route 192.168.1.0 255.255.
16、255.0 192.168.3.1 配置静态路由非直连目的网络 直连本路由器的另一个路由器端口Router(config)#Z%SYS-5-CONFIG_I: Configured from console by consoleRouter#show ip route 查看路由表配置Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external
17、type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setS 192.168.1.0/24 1/0 via 192.168.3.1C 192.168.2.0/24 is directly connected, FastEthernet1/0C 192.168.3.0/24 is directly connected, Serial2/0Router#