不同局域网重叠的ip,两端都用静态nat<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Router 0的配置:

Router#configure terminal

Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#interface fastEthernet 0/0

Router(config-if)#ip add

Router(config-if)#ip address <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />1.1.1.1 255.0.0.0

Router(config-if)#no shut

 

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

Router(config-if)#

Router(config-if)#int f0/1

Router(config-if)#ip add 2.2.2.1 255.0.0.0

Router(config-if)#no shut

 

%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

Router(config-if)#exit

Router(config)#

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

Router(config)#router rip

Router(config-router)#ne

Router(config-router)#network 1.0.0.0

Router(config-router)#network 2.0.0.0

Router(config-router)#end

%SYS-5-CONFIG_I: Configured from console by console

Router#show ip rou

Router#show ip route

Codes: C - connected, 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

 

C    1.0.0.0/8 is directly connected, FastEthernet0/0

C    2.0.0.0/8 is directly connected, FastEthernet0/1

Router#ping 2.2.2.2

 

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 16/25/32 ms

 

Router#configure terminal

Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#ip nat inside source s

Router(config)#ip nat inside source static 1.1.1.2 2.2.2.3

Router(config)#ip nat inside source static 1.1.1.3 2.2.2.4

Router(config)#int

Router(config)#interface f

Router(config)#interface fastEthernet 0/0

Router(config-if)#ip nat in

Router(config-if)#ip nat inside

Router(config-if)#exit

Router(config)#interface fastEthernet 0/1

Router(config-if)#ip nat ou

Router(config-if)#ip nat outside

Router(config-if)#no shut

Router(config-if)#no shutdown

Router(config-if)#end

%SYS-5-CONFIG_I: Configured from console by console

Router#show ip nat

Router#show ip nat t

Router#show ip nat translations

Pro  Inside global     Inside local       Outside local      Outside global

---  2.2.2.3           1.1.1.2            ---                ---

---  2.2.2.4           1.1.1.3            ---                ---

 

Router#ping 2.2.2.5

 

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2.2.2.5, timeout is 2 seconds:

.!!!!

Success rate is 80 percent (4/5), round-trip min/avg/max = 78/89/94 ms

 

Router#ping 2.2.2.6

 

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2.2.2.6, timeout is 2 seconds:

.!!!!

Success rate is 80 percent (4/5), round-trip min/avg/max = 78/86/94 ms

 

Router#

 

 

 

 

Router 1 的配置:

Router#configure terminal

Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#int fastEthernet 0/0

Router(config-if)#ip add 2.2.2.2 255.0.0.0

Router(config-if)#no shut

 

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

Router(config-if)#

Router(config-if)#int f0/1

Router(config-if)#exit

Router(config)#int fastEthernet 0/0

Router(config-if)#ip add 1.1.1.1 255.0.0.0

Router(config-if)#no shut

Router(config-if)#no shutdown

Router(config-if)#exit

Router(config)#int

Router(config)#interface f

Router(config)#interface fastEthernet 0/1

Router(config-if)#ip address 2.2.2.2 255.0.0.0

Router(config-if)#no shut

 

%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

Router(config-if)#exit

Router(config)#ro

Router(config)#router r

Router(config)#router rip

Router(config-router)#net

Router(config-router)#network 1.0.0.0

Router(config-router)#network 2.0.0.0

Router(config-router)#end

%SYS-5-CONFIG_I: Configured from console by console

Router#show ip rou

Router#show ip route

Codes: C - connected, 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

 

C    1.0.0.0/8 is directly connected, FastEthernet0/0

C    2.0.0.0/8 is directly connected, FastEthernet0/1

Router#ping 2.2.2.1

 

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2.2.2.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 ms

 

Router#conf

Router#configure

Router#configure terminal

Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#ip nat in

Router(config)#ip nat inside s

Router(config)#ip nat inside source s

Router(config)#ip nat inside source static 1.1.1.2 2.2.2.5

Router(config)#ip nat inside source static 1.1.1.3 2.2.2.6

Router(config)#interface fastEthernet 0/0

Router(config-if)#ip nat inside

Router(config-if)#exit

Router(config)#int fastEthernet 0/1

Router(config-if)#ip nat outside

Router(config-if)#no shut

Router(config-if)#

Router(config-if)#end

%SYS-5-CONFIG_I: Configured from console by console

Router#show ip nat tr

Router#show ip nat translations

Pro  Inside global     Inside local       Outside local      Outside global

---  2.2.2.5           1.1.1.2            ---                ---

---  2.2.2.6           1.1.1.3            ---                ---

 

Router#ping 2.2.2.3

 

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2.2.2.3, timeout is 2 seconds:

.!!!!

Success rate is 80 percent (4/5), round-trip min/avg/max = 78/82/94 ms

 

Router#ping 2.2.2.4

 

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2.2.2.4, timeout is 2 seconds:

.!!!!

Success rate is 80 percent (4/5), round-trip min/avg/max = 78/85/94 ms

 

Router#

 

 

Pc 1 ping 对方:

Packet Tracer PC Command Line 1.0

PC>ping 2.2.2.5

 

Pinging 2.2.2.5 with 32 bytes of data:

 

Reply from 2.2.2.5: bytes=32 time=171ms TTL=126

Reply from 2.2.2.5: bytes=32 time=141ms TTL=126

Reply from 2.2.2.5: bytes=32 time=125ms TTL=126

Reply from 2.2.2.5: bytes=32 time=157ms TTL=126

 

Ping statistics for 2.2.2.5:

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

Approximate round trip times in milli-seconds:

    Minimum = 125ms, Maximum = 171ms, Average = 148ms

 

PC>ping 2.2.2.6

 

Pinging 2.2.2.6 with 32 bytes of data:

 

Reply from 2.2.2.6: bytes=32 time=141ms TTL=126

Reply from 2.2.2.6: bytes=32 time=141ms TTL=126

Reply from 2.2.2.6: bytes=32 time=141ms TTL=126

Reply from 2.2.2.6: bytes=32 time=156ms TTL=126

 

Ping statistics for 2.2.2.6:

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

Approximate round trip times in milli-seconds:

    Minimum = 141ms, Maximum = 156ms, Average = 144ms

 

PC>

 

 

 

Pc 3 ping 对方:

Packet Tracer PC Command Line 1.0

PC>ping 2.2.2.3

 

Pinging 2.2.2.3 with 32 bytes of data:

 

Reply from 2.2.2.3: bytes=32 time=156ms TTL=126

Reply from 2.2.2.3: bytes=32 time=141ms TTL=126

Reply from 2.2.2.3: bytes=32 time=143ms TTL=126

Reply from 2.2.2.3: bytes=32 time=156ms TTL=126

 

Ping statistics for 2.2.2.3:

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

Approximate round trip times in milli-seconds:

    Minimum = 141ms, Maximum = 156ms, Average = 149ms

 

PC>ping 2.2.2.4

 

Pinging 2.2.2.4 with 32 bytes of data:

 

Reply from 2.2.2.4: bytes=32 time=156ms TTL=126

Reply from 2.2.2.4: bytes=32 time=141ms TTL=126

Reply from 2.2.2.4: bytes=32 time=141ms TTL=126

Reply from 2.2.2.4: bytes=32 time=140ms TTL=126

 

Ping statistics for 2.2.2.4:

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

Approximate round trip times in milli-seconds:

    Minimum = 140ms, Maximum = 156ms, Average = 144ms

 

PC>