- 积分
- 43
- 鸿鹄币
- 个
- 好评度
- 点
- 精华
- 注册时间
- 2016-9-20
- 最后登录
- 1970-1-1
- 阅读权限
- 10
- 听众
- 收听
网络小学徒
|
楼主 |
发表于 2016-9-25 18:38:44
|
显示全部楼层
R1
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#host R1
R1(config)#int g0/0
R1(config-if)#ip add 192.168.1.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#int g0/1
R1(config-if)#ip add 10.1.1.1 255.192.0.0
R1(config-if)#no sh
R1(config-if)#exi
R1(config)#ip route 0.0.0.0 0.0.0.0 g0/1
R2
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#host R2
R2(config)#int g0/0
R2(config-if)#ip add 10.1.1.2 255.192.0.0
R2(config-if)#no sh
R2(config-if)#int g0/1
R2(config-if)#ip add 192.168.2.1 255.255.255.0
R2(config-if)#no sh
R2(config-if)#exi
R2(config)#ip route 0.0.0.0 0.0.0.0 g0/0
测试
R2开启debug模式
R2#debug ip icmp
ICMP packet debugging is on
主机1ping R2的边界路由器接口
PC>ping 10.1.1.2
Pinging 10.1.1.2 with 32 bytes of data:
Reply from 10.1.1.2: bytes=32 time=0ms TTL=254
Reply from 10.1.1.2: bytes=32 time=1ms TTL=254
Reply from 10.1.1.2: bytes=32 time=0ms TTL=254
Reply from 10.1.1.2: bytes=32 time=1ms TTL=254
Ping statistics for 10.1.1.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 1ms, Average = 0ms
ICMP: echo reply sent, src 10.1.1.2, dst 192.168.1.2
ICMP: echo reply sent, src 10.1.1.2, dst 192.168.1.2
ICMP: echo reply sent, src 10.1.1.2, dst 192.168.1.2
ICMP: echo reply sent, src 10.1.1.2, dst 192.168.1.2
R1
R1(config)#ip nat inside source static 192.168.1.2 10.1.1.10
R1(config)#ip nat inside source static 192.168.1.3 10.1.1.20
R1(config)#
R1(config)#int g0/0
R1(config-if)#ip nat in
R1(config-if)#ip nat inside
R1(config-if)#int g0/1
R1(config-if)#ip na
R1(config-if)#ip nat ou
R1(config-if)#ip nat outside
测试
主机1ping边界接口
PC>ping 10.1.1.2
Pinging 10.1.1.2 with 32 bytes of data:
Request timed out.
Reply from 10.1.1.2: bytes=32 time=0ms TTL=254
Reply from 10.1.1.2: bytes=32 time=1ms TTL=254
Reply from 10.1.1.2: bytes=32 time=0ms TTL=254
Ping statistics for 10.1.1.2:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 1ms, Average = 0ms
ICMP: echo reply sent, src 10.1.1.2, dst 10.1.1.10
ICMP: echo reply sent, src 10.1.1.2, dst 10.1.1.10
ICMP: echo reply sent, src 10.1.1.2, dst 10.1.1.10
ICMP: echo reply sent, src 10.1.1.2, dst 10.1.1.10
主机2ping边界接口
PC>ping 10.1.1.2
Pinging 10.1.1.2 with 32 bytes of data:
Request timed out.
Reply from 10.1.1.2: bytes=32 time=0ms TTL=254
Reply from 10.1.1.2: bytes=32 time=1ms TTL=254
Reply from 10.1.1.2: bytes=32 time=1ms TTL=254
Ping statistics for 10.1.1.2:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 1ms, Average = 0ms
ICMP: echo reply sent, src 10.1.1.2, dst 10.1.1.20
ICMP: echo reply sent, src 10.1.1.2, dst 10.1.1.20
ICMP: echo reply sent, src 10.1.1.2, dst 10.1.1.20
ICMP: echo reply sent, src 10.1.1.2, dst 10.1.1.20 |
来自 2#
2016-9-25 18:38:44
回复(0)
收起回复
|