注明:R1的S0连接R2的S0端口,R1的S1连接R3的S1 R1(S0):192.168.2.1 255.255.255.0 R1(S1):192.168.3.1 255.255.255.0
R2(S0): 192.168.2.2 255.255.255.0R3(S1):192.168.3.3 255.255.255.0 R2(f0/0):192.168.1.1 255.255.255.0 R3(f0/0):192.168.4.1 255.255.255.0 PC2:192.168.1.2 255.255.255.0 192.168.1.1 PC3:192.168.4.2 255.255.255.0 192.168.4.1
具体配置如下 Press Enter to Start Router> Router> Router>en Router#conf t Enter configurationcommands, one per line. End with CNTL/Z. Router(config)#hostnameR1 R1(config)#int s0 R1(config-if)#ip addr192.168.2.1 255.255.255.0 R1(config-if)#no shut %LINK-3-UPDOWN:Interface Serial0, changed state to up %LINK-3-UPDOWN:Interface Serial0, changed state to down %LINEPROTO-5-UPDOWN  ine protocol on Interface Serial0, changed state to down R1(config-if)#clockrate 64000 R1(config-if)#exit R1(config)#int s1 R1(config-if)#ip addr192.168.3.1 255.255.255.0 R1(config-if)#no shut %LINK-3-UPDOWN:Interface Serial1, changed state to up %LINK-3-UPDOWN:Interface Serial1, changed state to down %LINEPROTO-5-UPDOWN:Line protocol on Interface Serial1, changed state to down R1(config-if)#clockrate 125000 R1(config-if)#exit R1(config)# %LINK-3-UPDOWN:Interface Serial0, changed state to up %LINEPROTO-5-UPDOWN:Line protocol on Interface Serial0, changed state to up %LINK-3-UPDOWN:Interface Serial1, changed state to up %LINEPROTO-5-UPDOWN:Line protocol on Interface Serial1, changed state to up R1(config)# R1(config)#routerospf 100 R1(config-router)#network192.168.2.0 0.0.0.255 area 0 R1(config-router)#network192.168.3.0 0.0.0.255 area 0 R1(config-router)#end R1#wr R1#show ip route Codes: C - connected,S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O -OSPF, IA - OSPF inter area E1 -OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 -IS-IS level-2, * - candidate default U - per-user static route Gateway of lastresort is not set C 192.168.2.0/24 is directly connected,Serial0 C 192.168.3.0/24 is directly connected,Serial1 R1# Press Enter to Start Router> Router>en Router#conf t Enter configurationcommands, one per line. End with CNTL/Z. Router(config)#hostnameR2 R2(config)#int s0 R2(config-if)#ip addr192.168.2.2 255.255.255.0 R2(config-if)#no shut %LINK-3-UPDOWN:Interface Serial0, changed state to up R2(config-if)#exit R2(config)#int f0/0 R2(config-if)#ip addr192.168.1.1 255.255.255.0 R2(config-if)#no shut %LINK-3-UPDOWN:Interface FastEthernet0/0, changed state to up R2(config-if)#exit R2(config)# R2(config)#routerospf 100 R2(config-router)#192.168.1.00.0.0.255 area 0 % Invalid inputdetected at '^' marker. R2(config-router)#network192.168.1.0 0.0.0.255 area 0 R2(config-router)#network192.168.2.0 0.0.0.255 area 0 R2(config-router)#end R2#wr R2#show ip route Codes: C - connected,S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O -OSPF, IA - OSPF inter area E1 - OSPF external type 1, E2 - OSPFexternal type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 -IS-IS level-2, * - candidate default U - per-user static route Gateway of lastresort is not set C 192.168.2.0/24 is directly connected,Serial0 C 192.168.1.0/24 is directly connected, FastEthernet0/0 R2# Press Enter to Start Router> Router>en Router#conf Configuring fromterminal, memory, or network [terminal]? Enter configurationcommands, one per line. End with CNTL/Z. Router(config)#hostnameR3 R3(config)#int s1 R3(config-if)#ip addr192.168.3.3 255.255.255.0 R3(config-if)#no shut %LINK-3-UPDOWN:Interface Serial1, changed state to up R3(config-if)#exit R3(config)#int f0/0 R3(config-if)#ip addr192.168.4.1 255.255.255.0 R3(config-if)#no shut %LINK-3-UPDOWN:Interface FastEthernet0/0, changed state to up R3(config-if)#exit R3(config)# R3(config)#routerospf 100 R3(config-router)#network192.168.3.0 0.0.0.255 area 0 R3(config-router)#network192.168.4.0 0.0.0.255 area 0 R3(config-router)#end R3#wr R3# |