不废话,先上图

 


先从图说起,有的工程或者有的家庭或者其他原因需要多接几个信息点,但是又不方便多布几跟线,就另接一个soho路由吧,我就这个来模拟下吧!

在罗嗦几句,首先r1不可能配置一条路由到r3(也不需要),因为如果是整个小区的路由也不会让你来动,可以使用nat方法来解决这个问题,只要是个路由器就有这个功能。

我的思路是:r2下面的主机先经过r2的nat转换成192。168。1。5这个ip add,他与r1直连,路由表上有r1的路由,当frame到达r1,r1把当成r2的frame,经过r1的nat,转换成内部全局地址200。1。1。2进行packet的封装,传输。

不知道,在这拓扑里面,谁算是内部本地地址?10。1。1。0/24的?还是192。168。1。0/24的?

本来想用gns3来解决,无赖那该死vps与gns占用太多cpu资源而不了了之,r2一直不能接收到r1分配的ip add,无赖只能自己配置一个,packet tracer 居然连掩码都不能输成“/24”,i服了packet tracer。

上配置,

这个是r2的,(自己新增加的soho路由)

 
  
  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 

 

 

这个是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 

来看看结果,从pc3上面的ping结果:

 

 
  
  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 = 4Received = 3Lost = 1 (25% loss), 
  22. Approximate round trip times in milli-seconds: 
  23.     Minimum = 140msMaximum = 156msAverage = 145ms 
  24.  
  25. PC> 

tracert 结果:

 

 
  
  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. 

 

p.s.pkt文件放在附件里面,telnet与console密码都是123,enable password是cisco