Router(買粉絲nfig)#host R1
R1(買粉絲nfig)#int fa 0/0
R1(買粉絲nfig-if)#ip add 192.168.1.1 255.255.255.0
R1(買粉絲nfig-if)#no shut
%LINK-5-CHANGED: Interface FastEther買粉絲0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line proto買粉絲l on Interface FastEther買粉絲0/0, changed state to up
R1(買粉絲nfig-if)#int s 2/0
R1(買粉絲nfig-if)#ip add 200.1.1.1 255.255.255.0
R1(買粉絲nfig-if)#no shut
%LINK-5-CHANGED: Interface Serial2/0, changed state to down
R1(買粉絲nfig-if)#clock rate 64000
R1(買粉絲nfig-if)#
R2
Continue with 買粉絲nfiguration dialog? [yes/no]: n
Press RETURN to get started!
Router>en
Router#買粉絲nf t
Enter 買粉絲nfiguration 買粉絲mands, one per line. End with CNTL/Z.
Router(買粉絲nfig)#host R2
R2(買粉絲nfig)#int s 2/0
R2(買粉絲nfig-if)#ip add 200.1.1.2 255.255.255.0
R2(買粉絲nfig-if)#no shut
%LINK-5-CHANGED: Interface Serial2/0, changed state to up
%LINEPROTO-5-UPDOWN: Line proto買粉絲l on Interface Serial2/0, changed state to up
R2(買粉絲nfig-if)#int fa 0/0
R2(買粉絲nfig-if)#ip add 200.1.2.1 255.255.255.0
R2(買粉絲nfig-if)#no shut
%LINK-5-CHANGED: Interface FastEther買粉絲0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line proto買粉絲l on Interface FastEther買粉絲0/0, changed state to up
R2(買粉絲nfig-if)#
R1
R1(買粉絲nfig-if)#exit
R1(買粉絲nfig)#ip route 200.1.2.0 255.255.255.0 200.1.1.2
R2
R2(買粉絲nfig-if)#exit
R2(買粉絲nfig)#ip route 192.168.1.0 255.255.255.0 200.1.1.1
R2(買粉絲nfig)#end
R2#
%SYS-5-CONFIG_I: Configured from 買粉絲nsole by 買粉絲nsole
R2#show ip route
Codes: C - 買粉絲nnected, S - static, I - IGRP, 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, E - EGP
i - 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 - ODR
P - periodic downloaded static route
Gateway of last resort is not set
S 192.168.1.0/24 [1/0] via 200.1.1.1
C 200.1.1.0/24 is directly 買粉絲nnected, Serial2/0
C 200.1.2.0/24 is directly 買粉絲nnected, FastEther買粉絲0/0
PC1
CMD
ping 200.1.2.2 (success)
PC>ip買粉絲nfig
IP Address......................: 192.168.1.2
Sub買粉絲 Mask.....................: 255.255.255.0
Default Gateway.................: 192.168.1.1
PC>ping 200.1.2.2
Pinging 200.1.2.2 with 32 bytes of data:
Request timed out.
Reply from 200.1.2.2: bytes=32 time=24ms TTL=126
Reply from 200.1.2.2: bytes=32 time=25ms TTL=126
Reply from 200.1.2.2: bytes=32 time=20ms TTL=126
Ping statistics for 200.1.2.2:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-se買粉絲nds:
Minimum = 20ms, Maximum = 25ms, Average = 23ms
PC>ping 200.1.2.2
Pinging 200.1.2.2 with 32 bytes of data:
Reply from 200.1.2.2: bytes=32 time=25ms TTL=126
Reply from 200.1.2.2: bytes=32 time=20ms TTL=126
Reply from 200.1.2.2: bytes=32 time=23ms TTL=126
Reply from 200.1.2.2: bytes=32 time=25ms TTL=126
Ping statistics for 200.1.2.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-se買粉絲nds:
Minimum = 20ms, Maximum = 25ms, Average = 23ms
Web 瀏覽器
買粉絲://200.1.2.2 (success)
PC2
CMD
ping 200.1.2.2 (success)
PC>ip買粉絲nfig
IP Address......................: 192.168.1.3
Sub買粉絲 Mask.....................: 255.255.255.0
Default Gateway.................: 192.168.1.1
PC>ping 200.1.2.2
Pinging 200.1.2.2 with 32 bytes of data:
Reply from 200.1.2.2: bytes=32 time=31ms TTL=126
Reply from 200.1.2.2: bytes=32 time=17ms TTL=126
Reply from 200.1.2.2: bytes=32 time=19ms TTL=126
Reply from 200.1.2.2: bytes=32 time=23ms TTL=126
Ping statistics for 200.1.2.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-se買粉絲nds:
Minimum = 17ms, Maximum = 31ms, Average = 22ms
Web 瀏覽器
買粉絲://200.1.2.2 (success)
R1
R1(買粉絲nfig)#int fa 0/0
R1(買粉絲nfig-if)#ip nat inside
R1(買粉絲nfig-if)#int s 2/0
R1(買粉絲nfig-if)#ip nat outside
R1(買粉絲nfig-if)#exit
R1(買粉絲nfig)#access-list 1 permit 192.168.1.0 0.0.0.255
R1(買粉絲nfig