R1:
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#inter s1/1
R1(config-if)#ip add 12.1.1.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#inter f0/0
R1(config-if)#
*Mar 1 00:04:30.347: %LINK-3-UPDOWN: Interface Serial1/1, changed state to up
*Mar 1 00:04:31.347: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1, changed state to up
R1(config-if)#ip add 13.1.1.1 255.255.255.0 不启用接口
R1(config-if)#inter lo 0
R1(config-if)#
*Mar 1 00:04:42.467: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar 1 00:04:43.467: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config-if)#inter s
*Mar 1 00:04:55.303: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1, changed state to down
R1#show
*Mar 1 00:05:20.339: %SYS-5-CONFIG_I: Configured from console by console
R1#
*Mar 1 00:05:21.323: %LINK-3-UPDOWN: Interface Serial1/2, changed state to up
*Mar 1 00:05:22.323: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/2, changed state to up
R1#
*Mar 1 00:05:45.355: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/2, changed state to down
R1#
*Mar 1 00:06:05.303: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1, changed state to up
R1#show ip inter bri
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 13.1.1.1 YES manual down up
Serial1/0 unassigned YES unset administratively down down
Serial1/1 12.1.1.1 YES manual up up
Serial1/3 unassigned YES unset administratively down down
Loopback0 1.1.1.1 YES manual up up
R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, Serial1/1
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#inter f0/0
R1(config-if)#shut 启用接口
R1(config-if)#end
R1#show ip
*Mar 1 00:10:44.927: %SYS-5-CONFIG_I: Configured from console by console
*Mar 1 00:10:45.315: %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to administratively down
R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, Serial1/1
R1#
*Mar 1 00:10:46.315: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to down
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#inter f0/0
R1(config-if)#no shut
R1(config-if)#
*Mar 1 00:12:12.319: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar 1 00:12:13.319: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1(config-if)#do ping 12.1.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.1.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/48/84 ms
R1(config-if)#do ping 2.2.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
R1(config-if)#end
R1#
*Mar 1 00:19:42.071: %SYS-5-CONFIG_I: Configured from console by console
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#ip route 2.2.2.0 255.255.255.0 12.1.1.2
R1(config)#end
R1#ping
*Mar 1 00:20:15.443: %SYS-5-CONFIG_I: Configured from console by console
R1#ping 2.2.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/68/96 ms
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#ip route 23.1.1.0 255.255.255.0 13.1.1.3
R1(config)#ip route 3.3.3.0 255.255.255.0 13.1.1.3
R1(config)#do ping 23.1.1.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 23.1.1.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/54/100 ms
R1(config)#do ping 3.3.3.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 44/73/116 ms
R1(config)#no ip route 23.1.1.0 255.255.255.0 13.1.1.3
R1(config)#no ip route 3.3.3.0 255.255.255.0 13.1.1.3
R1(config)#ip route 23.1.1.0 255.255.255.0 f0/0
R1(config)#ip route 3.3.3.0 255.255.255.0 f0/0
R1(config)#do ping 23.1.1.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 23.1.1.3, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 28/45/64 ms
R1(config)#do ping 3.3.3.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 48/68/84 ms
R1(config)#end
R1#show ar
*Mar 1 00:28:52.415: %SYS-5-CONFIG_I: Configured from console by console
R1#show arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 3.3.3.3 0 cc02.0bdc.0000 ARPA FastEthernet0/0
Internet 13.1.1.1 - cc00.0bdc.0000 ARPA FastEthernet0/0
Internet 13.1.1.3 14 cc02.0bdc.0000 ARPA FastEthernet0/0
Internet 23.1.1.3 0 cc02.0bdc.0000 ARPA FastEthernet0/0
R1#clear arp
R1#conf t
R1#
*Mar 1 00:30:21.299: %SYS-5-CONFIG_I: Configured from console by console
R1#show arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 3.3.3.3 0 cc02.0bdc.0000 ARPA FastEthernet0/0
Internet 13.1.1.1 - cc00.0bdc.0000 ARPA FastEthernet0/0
Internet 13.1.1.3 0 cc02.0bdc.0000 ARPA FastEthernet0/0
Internet 23.1.1.3 0 cc02.0bdc.0000 ARPA FastEthernet0/0
R1#ping 23.1.1.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 23.1.1.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 48/69/100 ms
R1#ping 3.3.3.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/52/104 ms
R1#
R1#
R1#
R1#clear arp
R1#ping 23.1.1.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 23.1.1.3, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
R1#ping 3.3.3.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
R1#show arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 13.1.1.1 - cc00.0bdc.0000 ARPA FastEthernet0/0
Internet 13.1.1.3 8 cc02.0bdc.0000 ARPA FastEthernet0/0
R1#
R2:
R2(config)#inter s1/0
R2(config-if)#ip add 12.1.1.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#inter s1/1
R2(config-if)#
*Mar 1 00:05:49.747: %LINK-3-UPDOWN: Interface Serial1/0, changed state to up
*Mar 1 00:05:50.747: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to up
R2(config-if)#ip add 23.1.1.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#inter lo 0
R2(config-if)#i
*Mar 1 00:06:12.547: %LINK-3-UPDOWN: Interface Serial1/1, changed state to up
*Mar 1 00:06:13.547: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1, changed state to up
R2(config-if)#ip add 2.
*Mar 1 00:06:14.123: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R2(config-if)#ip add 2.2.2.2 255.255.255.0
R2(config-if)#end
R2#
*Mar 1 00:06:22.539: %SYS-5-CONFIG_I: Configured from console by console
R2#
*Mar 1 00:06:35.383: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1, changed state to down
R2#
*Mar 1 00:07:05.363: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1, changed state to up
R2#show ip inter br
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES unset administratively down down
Serial1/0 12.1.1.2 YES manual up up
Serial1/1 23.1.1.2 YES manual up up
Serial1/2 unassigned YES unset administratively down down
Serial1/3 unassigned YES unset administratively down down
Loopback0 2.2.2.2 YES manual up up
R2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback0
23.0.0.0/24 is subnetted, 1 subnets
C 23.1.1.0 is directly connected, Serial1/1
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, Serial1/0
R2#ping 23.1.1.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 23.1.1.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/46/80 ms
R2#
R2#
R2#conf
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#ip route 1.1.1.0 255.255.255.0 s1/0
R2(config)#ip route 3.3.3.0 255.255.255.0 s1/1
R2(config)#ip route 13.1.1.0 255.255.255.0 12.1.1.1
R2(config)#
R3:
R3(config)#inter s1/0
R3(config-if)#ip add 23.1.1.3 255.255.255.0
R3(config-if)#no shut
R3(config-if)#inter
*Mar 1 00:06:50.135: %LINK-3-UPDOWN: Interface Serial1/0, changed state to up
*Mar 1 00:06:51.135: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to up
R3(config-if)#inter f0/0
R3(config-if)#ip add 13.1.1.3 255.255.255.0
R3(config-if)#no shut
R3(config-if)#inter lo 0
R3(config-if)#
*Mar 1 00:07:11.923: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar 1 00:07:12.923: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R3(config-if)#ip add
*Mar 1 00:07:14.759: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R3(config-if)#ip add 3.3.3.3 255.255.255.0
R3(config-if)#end
R3#
*Mar 1 00:07:25.839: %SYS-5-CONFIG_I: Configured from console by console
R3#show ip inter b
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 13.1.1.3 YES manual up up
Serial1/0 23.1.1.3 YES manual up up
Serial1/1 unassigned YES unset administratively down down
Serial1/2 unassigned YES unset administratively down down
Serial1/3 unassigned YES unset administratively down down
Loopback0 3.3.3.3 YES manual up up
R3#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
23.0.0.0/24 is subnetted, 1 subnets
C 23.1.1.0 is directly connected, Serial1/0
13.0.0.0/24 is subnetted, 1 subnets
C 13.1.1.0 is directly connected, FastEthernet0/0
R3#ping 13.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 13.1.1.1, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 48/72/116 ms
Enter configuration commands, one per line. End with CNTL/Z.
R3(config)#inter f0/0
R3(config-if)#no ip pr
R3(config-if)#no ip proxy-arp 关闭代理ARP ,然后用R1 PING ,将无法PING通3.3.3.3和23.1.1.3 。
R3(config-if)#
R3(config-if)#end
R3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R3(config)#ip r
*Mar 1 00:54:52.967: %SYS-5-CONFIG_I: Configured from console by console
R3(config)#ip route 2.2.2.0 255.255.255.0 s1/0
R3(config)#ip route 1.1.1.0 255.255.255.0 13.1.1.1
R3(config)#ip route 12.1.1.0 255.255.255.0 13.1.1.1
R3(config)#
总结
配置静态路由时:
外出本地接口 AD为0, 用于PPP/HDLC
下一跳地址 AD 为1 用于NBMA 或者MA。