Access the Internet through two nat

Source: Internet
Author: User

No nonsense, first

 


650) this. width = 650; "onclick = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) 'border =" 0 "src =" http://img1.51cto.com/attachment/201008/170005952.jpg "alt =" "/>

Let's start with the illustration. Some projects or some families or for other reasons need to pick up several more information points, but it is not convenient to put a few more lines. Let's just pick up another soho route, let me simulate this!

First, it is impossible for r1 to configure a route to r3, because if it is the route of the entire community, it will not let you change, you can use nat to solve this problem, as long as it is a vro.

My idea is: the hosts under r2 are first converted to 192 through r2 nat. 168. 1. 5. This ip address add is directly connected to r1. There is a r1 route in the route table. When the frame arrives at r1, r1 considers it as the r2 frame and passes through the nat of r1, convert to internal global address 200. 1. 1. 2. packet encapsulation and transmission.

I don't know. Who is the internal local address in this topology? 10. 1. 1. 0/24? 192. 168. 1. 0/24?

Originally, we wanted to use gns3 to solve the problem. The Rogue's damn vps and gns took up too much cpu resources, but r2 never received the ip add allocated by r1. The rogue could only configure one, the packet tracer cannot even input "/24" as the mask, and I takes the packet tracer.

Configuration on,

This is r2, and the new soho route is added)

 
 
  1. Building configuration... 
  2.  
  3. Current configuration : 1070 bytes 
  4. version 12.2 
  5. no service timestamps log datetime msec 
  6. no service timestamps debug datetime msec 
  7. service password-encryption 
  8. hostname r2 
  9. enable password 7 0822455D0A16 
  10. ip dhcp excluded-address 10.1.1.1 10.1.1.2 
  11. ip dhcp pool abc 
  12.  network 10.1.1.0 255.255.255.0 
  13.  default-router 10.1.1.1 
  14.  dns-server 202.102.192.68 
  15. interface FastEthernet0/0 
  16.  ip address 192.168.1.5 255.255.255.0 
  17.  ip nat outside 
  18.  duplex auto 
  19.  speed auto 
  20. interface FastEthernet0/1 
  21.  no ip address 
  22.  duplex auto 
  23.  speed auto 
  24.  shutdown 
  25. interface FastEthernet1/0 
  26.  ip address 10.1.1.1 255.255.255.0 
  27.  ip nat inside 
  28.  duplex auto 
  29.  speed auto 
  30. interface FastEthernet1/1 
  31.  no ip address 
  32.  duplex auto 
  33.  speed auto 
  34.  shutdown 
  35. ip nat inside source list 100 interface FastEthernet0/0 overload 
  36. ip classless 
  37. ip route 0.0.0.0 0.0.0.0 FastEthernet0/0  
  38. access-list 100 permit ip 10.1.1.0 0.0.0.255 any 
  39. line con 0 
  40.  exec-timeout 0 0 
  41.  password 7 08701E1D 
  42.  logging synchronous 
  43.  login 
  44. line vty 0 4 
  45.  exec-timeout 0 0 
  46.  password 7 08701E1D 
  47.  logging synchronous 
  48.  login 
  49. end 

 

 

This is the configuration of r1,

 

 
 
  1. r1#show run 
  2. Building configuration... 
  3.  
  4. Current configuration : 1073 bytes 
  5. version 12.2 
  6. no service timestamps log datetime msec 
  7. no service timestamps debug datetime msec 
  8. service password-encryption 
  9. hostname r1 
  10. enable password 7 0822455D0A16 
  11. ip dhcp excluded-address 192.168.1.0 192.168.1.10 
  12. ip dhcp pool abc 
  13.  network 192.168.1.0 255.255.255.0 
  14.  default-router 192.168.1.1 
  15.  dns-server 202.102.192.68 
  16. interface FastEthernet0/0 
  17.  ip address 192.168.1.1 255.255.255.0 
  18.  ip nat inside 
  19.  duplex auto 
  20.  speed auto 
  21. interface FastEthernet0/1 
  22.  no ip address 
  23.  duplex auto 
  24.  speed auto 
  25.  shutdown 
  26. interface Serial0/0 
  27.  ip address 200.1.1.2 255.255.255.0 
  28.  ip nat outside 
  29. interface Serial0/1 
  30.  no ip address 
  31.  shutdown 
  32. ip nat inside source list 100 interface Serial0/0 overload 
  33. ip classless 
  34. ip route 0.0.0.0 0.0.0.0 200.1.1.1  
  35. access-list 100 permit ip 192.168.1.0 0.0.0.255 any 
  36. access-list 1 permit host 192.168.1.1 
  37. line con 0 
  38.  access-class 1 out 
  39.  password 7 08701E1D 
  40.  logging synchronous 
  41.  login 
  42. line vty 0 4 
  43.  access-class 1 out 
  44.  exec-timeout 0 0 
  45.  password 7 08701E1D 
  46.  logging synchronous 
  47.  login 
  48. end 

Let's take a look at the result. From the ping result above pc3:

 

 
 
  1. Packet Tracer PC Command Line 1.0 
  2. PC>ipconfig /all 
  3.  
  4. Physical Address................: 0090.0C2E.0870 
  5. IP Address......................: 10.1.1.4 
  6. Subnet Mask.....................: 255.255.255.0 
  7. Default Gateway.................: 10.1.1.1 
  8. DNS Servers.....................: 202.102.192.68 
  9.  
  10.  
  11. PC>ping 200.1.1.1 
  12.  
  13. Pinging 200.1.1.1 with 32 bytes of data: 
  14.  
  15. Request timed out. 
  16. Reply from 200.1.1.1: bytes=32 time=140ms TTL=253 
  17. Reply from 200.1.1.1: bytes=32 time=140ms TTL=253 
  18. Reply from 200.1.1.1: bytes=32 time=156ms TTL=253 
  19.  
  20. Ping statistics for 200.1.1.1: 
  21.     Packets: Sent = 4, Received = 3, Lost = 1 (25% loss), 
  22. Approximate round trip times in milli-seconds: 
  23.     Minimum = 140ms, Maximum = 156ms, Average = 145ms 
  24.  
  25. PC> 

Tracert result:

 

 
 
  1. PC>tracert 200.1.1.1 
  2.  
  3. Tracing route to 200.1.1.1 over a maximum of 30 hops:  
  4.  
  5.   1   62 ms     62 ms     62 ms     10.1.1.1 
  6.   2   125 ms    125 ms    125 ms    200.1.1.1 
  7.   3   125 ms    141 ms    156 ms    200.1.1.1 
  8.  
  9. Trace complete. 

 

Put the p.s. pkt file in the attachment. The password for telnet and console is 123, and the enable password is cisco.

This article from the "Flowers and nights" blog, please be sure to keep this http://fengyun.blog.51cto.com/532912/384182

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.