1. 作业要求:
实现SNAT 功能 利用基于端口的NAPT方法来弥补IP不够用不能上网的缺陷!
2. 拓扑图如下:
3.配置及必要的说明信息:
R1(config)#int f0/0
R1(config-if)#ip add 192.168.3.1 255.255.255.0
R1(config-if)#no shut
用的是Host-only 到Vmware1 一台PC
R1(config)#int s1/0
R1(config-if)#ip add 192.168.4.2 255.255.255.0
R1(config-if)#no shut
R1(config-if)#int s1/1
R1(config-if)#ip add 192.168.5.2 255.255.255.0
R1(config-if)#no shut
R2(config)#int s1/0
R2(config-if)#ip add 192.168.4.1 255.255.255.0
R2(config-if)#no shut
R2(config-if)#int loopback 1
R2(config-if)#ip add 192.168.1.1 255.255.255.0
R3(config)#int s1/1
R3(config-if)#ip add 192.168.5.1 255.255.255.0
R3(config-if)#no shut
R3(config-if)#int f
R3(config-if)#int f0/0
R3(config-if)#ip add 192.168.2.1 255.255.255.0
R3(config-if)#no shut
R1#ping 192.168.5.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.5.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/36/56 ms
R1#ping 192.168.4.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.4.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/52/80 ms
桥接到本地连接!
C:\Documents and Settings\Administrator>ipconfig /all
R1(config)#ip route 192.168.1.0 255.255.255.0 192.168.4.1
R1(config)#ip route 192.168.2.0 255.255.255.0 192.168.5.1
R1(config)#int f0/0
R1(config-if)#ip nat inside
R1(config-if)#int s1/0
R1(config-if)#ip nat outside
R1(config-if)#int s1/1
R1(config-if)#ip nat outside
R1(config-if)#end
R1(config)#access-list 101 permit ip 192.168.3.0 0.0.0.255 192.168.1.0 0.0.0.255
R1(config)#access-list 102 permit ip 192.168.3.0 0.0.0.255 192.168.2.0 0.0.0.255
R1(config)#ip nat inside source list 101 interface s1/0 overload
R1(config)#ip nat inside source list 102 interface s1/1 overload
4.测试:
Window server2003
开启远程桌面:
X p 作为192.168.3.0 网段的一台PC
开始-------运行 输入:mstsc
R1#show ip nat translations
Pro Inside global Inside local Outside local Outside global
tcp 192.168.5.2:1102 192.168.3.10:1102 192.168.2.12:3389 192.168.2.12:3389
tcp 192.168.5.2:1103 192.168.3.10:1103 192.168.2.12:3389 192.168.2.12:3389
R1#show ip nat translations
Pro Inside global Inside local Outside local Outside global
icmp 192.168.4.2:512 192.168.3.10:512 192.168.1.1:512 192.168.1.1:512
icmp 192.168.5.2:512 192.168.3.10:512 192.168.2.1:512 192.168.2.1:512
icmp 192.168.5.2:512 192.168.3.10:512 192.168.2.12:512 192.168.2.12:512
为了便于理解,附加上此图!