A-A+

路由器通过NVI解决内网访问内部服务器的外部映射地址测试

2015年11月21日 站长资讯 暂无评论

这次采用思科路由器和交换机进行组网,连接一台PC服务器,通过NVI来解决内外访问内部服务的外部映射地址的功能。在这个测试实验过程中,参考cisco官网的一些说明文档。

一.测试拓扑:

参照:https://supportforums.cisco.com/message/3648386#3648386

据说是12.3(14)T 的IOS才开始有的功能:

http://www.cisco.com/en/US/docs/ios/12_3t/12_3t14/feature/guide/gtnatvi.html

这个链接写得很烂,思科的官方文档越来越不敢恭维了。

--个人认为存在的问题:

A.两个PC的IP地址相同,没有给出说明(可以相同)

B.NAT-PE路由器不同接口配置相同网段的地址

-----作为两个不同的虚拟机路由器接口地址可以相同或在同一网段,但是没有给出说明,并如何使用,按链接配置完成后,路由器自己ping不同自己的接口地址

C.没有定义VRF,及完整的VRF使用场景说明

二.基本配置:

  1. A.R1  
  2. int e0/0   
  3.  ip add 192.168.10.1 255.255.255.0  
  4.  no sh   
  5. line vty 0 5  
  6.  password cisco   
  7.  login  
  8. ip route 0.0.0.0 0.0.0.0 192.168.10.254   
  9.   
  10. B.R2   
  11. interface Ethernet0/0  
  12.  ip address 192.168.10.254 255.255.255.0   
  13.  no shut  
  14. interface Ethernet0/1   
  15.  ip address 202.100.1.2 255.255.255.0  
  16.  no shut   
  17.   
  18. C.R3   
  19. interface Ethernet0/0  
  20.  ip address 202.100.1.3 255.255.255.0   
  21.  no shut  

二.R2的NVI配置:

  1. int e0/0   
  2.  ip nat enable  
  3. int e0/1   
  4.  ip nat enable  
  5. access-list 101 permit ip 192.168.10.0 0.0.0.255 any   
  6. ip nat source list 101 interface e0/1 overload   
  7. !--动态NVI-NAT Virtual Interface   
  8. ip nat source static 192.168.10.1 202.100.1.1 extendable   
  9. !--静态NVI   

三.测试:

A.R3能telnet通R1映射后的公网地址

  1. R3#telnet 202.100.1.1  
  2. Trying 202.100.1.1 ... Open   
  3.   
  4. User Access Verification   
  5.   
  6. Password:    
  7. R1>show users  
  8.     Line       User       Host(s)              Idle       Location   
  9.    0 con 0                idle                 00:01:12      
  10. *130 vty 0                idle                 00:00:00 202.100.1.3  
  11.   Interface    User               Mode         Idle     Peer Address   
  12. R1>  

B.R1也能telnet自己的映射后的公网地址

  1. R1#telnet 202.100.1.1  
  2. Trying 202.100.1.1 ... Open   
  3. User Access Verification  
  4. Password:    
  5. R1>show users  
  6.     Line       User       Host(s)              Idle       Location   
  7.    0 con 0                202.100.1.1          00:00:00  
  8. *131 vty 1                idle                 00:00:00 202.100.1.1   
  9.   Interface    User               Mode         Idle     Peer Address  
  10. R1>   

----可以看到,R1telnet自己的NAT后的公网地址,用的是经过地址转换后的地址

C.PC1也能telnet通R1映射后的公网地址

  1. C:\Documents and Settings\Administrator>telnet 202.100.1.1  
  2. User Access Verification   
  3. Password:  
  4. R1>show users   
  5.     Line       User       Host(s)              Idle       Location  
  6.    0 con 0                idle                 00:00:11   
  7. *130 vty 0                idle                 00:00:00 202.100.1.2  
  8.   
  9.   Interface    User               Mode         Idle     Peer Address  
  10.   
  11. R1>  

---PC1连接R1 NAT后的公网地址,也用的是经过NAT后的地址.

标签:

给我留言