NAT动态地址转换

 
 
 
 
 
Pc0:
ip 地址: 192.168.1.2
子网掩码: 255.255.255.0
默认网关: 192.168.1.1
Pc1:
ip 地址: 192.168.1.3
子网掩码: 255.255.255.0
默认网关: 192.168.1.1
Pc2:
ip 地址: 192.168.1.4
子网掩码: 255.255.255.0
默认网关: 192.168.1.1
Router0
Router>enable
Router#configure terminal
Router(config)#hostname router0
router0(config)#ip nat pool ceshi 202.98.38.2 202.98.38.4 netmask 255.255.255.0
router0(config)#access-list 1 permit 192.168.1.0 0.0.0 .255
router0(config)#ip nat inside source list 1 pool ceshi
router0(config)#interface fastEthernet 0/0
router0(config-if)#ip address 192.168.1.1 255.255.255.0
router0(config-if)#ip nat inside
router0(config-if)#no shutdown
router0(config-if)#exit
router0(config)#interface f0/1
router0(config-if)#ip address 202.98.38.1 255.255.255.0
router0(config-if)#ip nat outside
router0(config-if)#no shutdown
router0(config-if)#exit
router0(config)#router rip
router0(config-router)#version 2
router0(config-router)#no auto-summary
router0(config-router)#network 192.168.1.0
router0(config-router)#network 202.98.38.0
router0(config-router)#end
router0#debug ip routing
 
 
Router>enable
Router#configure terminal
Router(config)#hostname router1
router1(config)#interface fastEthernet 0/0
router1(config-if)#ip address 202.98.38.5 255.255.255.0
router1(config-if)#no shutdown
router1(config-if)#exit
router1(config)#interface loopback 0
router1(config-if)#ip address 2.2.2 .2 255.255.255.0
router1(config-if)#exit
router1(config)#router rip
router1(config-router)#version 2
router1(config-router)#no auto-summary
router1(config-router)#network 202.98.38.0
router1(config-router)#network 2.2.2 .2
 
 
Pc0 上用 ping 2.2.2 .2 ping 通之后在 Router0 上可查看到(用 router0#debug ip nat
命令):
NAT: s=192.168.1.2->202.98.38.2, d= 2.2.2 .2[1]
NAT*: s= 2.2.2 .2, d=202.98.38.2->192.168.1.2[1]
NAT: s=192.168.1.2->202.98.38.2, d= 2.2.2 .2[1]
NAT*: s= 2.2.2 .2, d=202.98.38.2->192.168.1.2[1]
Pc1 上用 ping 2.2.2 .2 ping 通之后在 Router0 上可查看到(用 router0#debug ip nat
命令):
NAT: s=192.168.1.2->202.98.38.2, d= 2.2.2 .2[1]
NAT*: s= 2.2.2 .2, d=202.98.38.2->192.168.1.2[1]
NAT: s=192.168.1.2->202.98.38.2, d= 2.2.2 .2[1]
NAT*: s= 2.2.2 .2, d=202.98.38.2->192.168.1.2[1]
Pc2 上用 ping 2.2.2 .2 ping 通之后在 Router0 上可查看到(用 router0#debug ip nat
命令):
NNAT: s=192.168.1.4->202.98.38.4, d= 2.2.2 .2[3]
NAT: s=192.168.1.4->202.98.38.4, d= 2.2.2 .2[3]
NAT*: s= 2.2.2 .2, d=202.98.38.4->192.168.1.4[3]
NAT: s=192.168.1.4->202.98.38.4, d= 2.2.2 .2[3]
NAT*: s= 2.2.2 .2, d=202.98.38.4->192.168.1.4[3]
NAT: s=192.168.1.4->202.98.38.4, d= 2.2.2 .2[3]
NAT*: s= 2.2.2 .2, d=202.98.38.4->192.168.1.4[3]
 

你可能感兴趣的:(职场,休闲,NAT动态地址转换)