(之前有一个问题解决了 VLAN 问题。)
我有一部分拓扑,其中 2911 充当内部 NAT 路由器。(我们没有足够的私有 IP 地址来提供给我们所有的实验室服务器和网络设备。所以我们有自己的保留地址,这些地址不能跨公司网络路由)。
2911 正在使用一个私有 IP 地址到 NAT 实验室 IP 地址
!
interface GigabitEthernet0/0
ip address 192.16.25.94 255.255.255.0
ip nat outside
ip virtual-reassembly in
duplex auto
speed auto
!
interface GigabitEthernet0/1
no ip address
duplex auto
speed auto
!
interface GigabitEthernet0/2
no ip address
duplex auto
speed auto
!
interface GigabitEthernet0/2.100
encapsulation dot1Q 100
ip address 10.0.0.1 255.255.255.0
ip nat inside
ip virtual-reassembly in
!
interface GigabitEthernet0/2.200
encapsulation dot1Q 200
ip address 10.1.0.1 255.255.255.0
ip nat inside
ip virtual-reassembly in
!
ip nat inside source list 1 interface GigabitEthernet0/0 overload
ip route 0.0.0.0 0.0.0.0 192.16.25.1
!
access-list 1 permit any
!
!
!
control-plane
!
我有 16 个 Nexus 交换机,但我在这里展示了一个作为示例。(如果我能做到这一点,其余的应该很容易)。
vlan 1,100,102-103,200
vrf context management
interface Vlan1
interface Vlan100
no shutdown
ip address 10.0.0.22/24
interface Vlan200
no shutdown
ip address 10.1.0.22/24
interface Ethernet1/1
switchport access vlan 200
interface Ethernet1/40
switchport access vlan 100
interface Ethernet1/48
switchport mode trunk
interface Ethernet1/49
switchport access vlan 200
interface Ethernet1/50
switchport access vlan 200
虽然 Nexus 可以 ping 每个 VLAN 的默认 GW,但它不能 ping 2911 网络外部。
PING 10.0.0.1 (10.0.0.1): 56 data bytes
64 bytes from 10.0.0.1: icmp_seq=0 ttl=254 time=0.765 ms
64 bytes from 10.0.0.1: icmp_seq=1 ttl=254 time=0.571 ms
64 bytes from 10.0.0.1: icmp_seq=2 ttl=254 time=0.547 ms
64 bytes from 10.0.0.1: icmp_seq=3 ttl=254 time=0.54 ms
64 bytes from 10.0.0.1: icmp_seq=4 ttl=254 time=0.534 ms
--- 10.0.0.1 ping statistics ---
5 packets transmitted, 5 packets received, 0.00% packet loss
round-trip min/avg/max = 0.534/0.591/0.765 ms
2# ping 10.1.0.1
PING 10.1.0.1 (10.1.0.1): 56 data bytes
64 bytes from 10.1.0.1: icmp_seq=0 ttl=254 time=0.785 ms
64 bytes from 10.1.0.1: icmp_seq=1 ttl=254 time=0.565 ms
64 bytes from 10.1.0.1: icmp_seq=2 ttl=254 time=0.557 ms
64 bytes from 10.1.0.1: icmp_seq=3 ttl=254 time=0.532 ms
64 bytes from 10.1.0.1: icmp_seq=4 ttl=254 time=0.538 ms
--- 10.1.0.1 ping statistics ---
5 packets transmitted, 5 packets received, 0.00% packet loss
round-trip min/avg/max = 0.532/0.595/0.785 ms
2# ping 192.16.25.1
PING 192.16.25.1 (192.16.25.1): 56 data bytes
ping: sendto 192.16.25.1 64 chars, No route to host
我缺少什么才能使 NAT 和路由正常工作?另外,这只是Nexus管理层吗?连接到 Nexus 的主机可以与外部通话吗?
顺便说一下,2911 可以 ping 任何东西。
[更新]
C(config)# vrf context management
C(config-vrf)# ip route 0.0.0.0/0 10.1.0.1 (same result with 10.0.0.1)
C(config-vrf)# ping 192.16.25.94
PING 192.16.25.94 (192.16.25.94): 56 data bytes
ping: sendto 192.16.25.94 64 chars, No route to host
Request 0 timed out
ping: sendto 192.16.25.94 64 chars, No route to host