天天看点

CCNA:CISCO PAT

CCNA:CISCO PAT

R1 S0/0 199.1.1.1

R2 S0/0 199.1.1.2

在没有配置NAT之前 pc 1,2,3 ping不通 199.1.1.2

在R1上

Router(config)#ip nat pool rscpass 199.1.1.1 199.1.1.1 netmask 255.255.255.0

Router(config)#access-list 1 per 192.168.1.0 0.0.0.255

Router(config)#access-list 1 per 192.168.2.0 0.0.0.255

Router(config)#ip nat inside source list 1 pool rscpass overload

Router(config)#int s0/0

Router(config-if)#ip nat ou

Router(config-if)#ip nat outside

Router(config-if)#int f0/0

Router(config-if)#ip nat in

Router(config-if)#ip nat inside

在pc1上ping 199.1.1.2

PC>ping 199.1.1.2

Pinging 199.1.1.2 with 32 bytes of data:

Reply from 199.1.1.2: bytes=32 time=203ms TTL=254

Reply from 199.1.1.2: bytes=32 time=141ms TTL=254

Reply from 199.1.1.2: bytes=32 time=90ms TTL=254

Reply from 199.1.1.2: bytes=32 time=109ms TTL=254

Ping statistics for 199.1.1.2:

    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

    Minimum = 90ms, Maximum = 203ms, Average = 135ms

在R1上输入 debug ip nat

NAT: s=192.168.1.10->199.1.1.1, d=199.1.1.2[1]

NAT*: s=199.1.1.2, d=199.1.1.1->192.168.1.10[1]

NAT: s=192.168.1.10->199.1.1.1, d=199.1.1.2[2]

NAT*: s=199.1.1.2, d=199.1.1.1->192.168.1.10[2]

NAT: s=192.168.1.10->199.1.1.1, d=199.1.1.2[3]

NAT*: s=199.1.1.2, d=199.1.1.1->192.168.1.10[3]

NAT: s=192.168.1.10->199.1.1.1, d=199.1.1.2[4]

NAT*: s=199.1.1.2, d=199.1.1.1->192.168.1.10[4]

NAT: expiring 199.1.1.1 (192.168.1.10) 1 9 (9)

NAT: expiring 199.1.1.1 (192.168.1.10) 1 10 (10)

NAT: expiring 199.1.1.1 (192.168.1.10) 1 11 (11)

NAT: expiring 199.1.1.1 (192.168.1.10) 1 12 (12)

在R2  debug ip packet

IP: tableid=0, s=199.1.1.1 (Serial0/0), d=199.1.1.2 (Serial0/0), routed via RIB

IP: s=199.1.1.1 (Serial0/0), d=199.1.1.2 (Serial0/0), len 0, rcvd 3

IP: tableid=0, s=199.1.1.2 (local), d=199.1.1.1 (Serial0/0), routed via RIB

IP: s=199.1.1.2 (local), d=199.1.1.1 (Serial0/0), len 0, sending

r1  s how ip nat statistics

 Total translations: 4 (0 static, 4 dynamic, 4 extended)

Outside Interfaces: Serial0/0

Inside Interfaces: FastEthernet0/0

Hits: 8  Misses: 8

Expired translations: 4

Dynamic mappings:

-- Inside Source

access-list 1 pool xiaofanfan refCount 4

 pool xiaofanfan: netmask 255.255.255.0

       start 199.1.1.1 end 199.1.1.1

       type generic, total addresses 1 , allocated 1 (100%), misses 0

上一篇: CCNA最新战报
下一篇: 终于过了CCNA