A-A+
路由器通过NVI解决内网访问内部服务器的外部映射地址测试
这次采用思科路由器和交换机进行组网,连接一台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使用场景说明
二.基本配置:
- A.R1
- int e0/0
- ip add 192.168.10.1 255.255.255.0
- no sh
- line vty 0 5
- password cisco
- login
- ip route 0.0.0.0 0.0.0.0 192.168.10.254
- B.R2
- interface Ethernet0/0
- ip address 192.168.10.254 255.255.255.0
- no shut
- interface Ethernet0/1
- ip address 202.100.1.2 255.255.255.0
- no shut
- C.R3
- interface Ethernet0/0
- ip address 202.100.1.3 255.255.255.0
- no shut
二.R2的NVI配置:
- int e0/0
- ip nat enable
- int e0/1
- ip nat enable
- access-list 101 permit ip 192.168.10.0 0.0.0.255 any
- ip nat source list 101 interface e0/1 overload
- !--动态NVI-NAT Virtual Interface
- ip nat source static 192.168.10.1 202.100.1.1 extendable
- !--静态NVI
三.测试:
A.R3能telnet通R1映射后的公网地址
- R3#telnet 202.100.1.1
- Trying 202.100.1.1 ... Open
- User Access Verification
- Password:
- R1>show users
- Line User Host(s) Idle Location
- 0 con 0 idle 00:01:12
- *130 vty 0 idle 00:00:00 202.100.1.3
- Interface User Mode Idle Peer Address
- R1>
B.R1也能telnet自己的映射后的公网地址
- R1#telnet 202.100.1.1
- Trying 202.100.1.1 ... Open
- User Access Verification
- Password:
- R1>show users
- Line User Host(s) Idle Location
- 0 con 0 202.100.1.1 00:00:00
- *131 vty 1 idle 00:00:00 202.100.1.1
- Interface User Mode Idle Peer Address
- R1>
----可以看到,R1telnet自己的NAT后的公网地址,用的是经过地址转换后的地址
C.PC1也能telnet通R1映射后的公网地址
- C:\Documents and Settings\Administrator>telnet 202.100.1.1
- User Access Verification
- Password:
- R1>show users
- Line User Host(s) Idle Location
- 0 con 0 idle 00:00:11
- *130 vty 0 idle 00:00:00 202.100.1.2
- Interface User Mode Idle Peer Address
- R1>
---PC1连接R1 NAT后的公网地址,也用的是经过NAT后的地址.