本帖最后由 ji191359129 于 2014-6-19 23:30 编辑
内网网关奇怪的问题如图, 一:三层交换上做vlan间路由,配置静态路由出外网 二:各路由器上配置静态路由使得全网互通 问题来了。 三:在PC2上将网关设置成pc1 的ip地址,也能ping通3.3.3.3, 为什么呢???
我这里用PT做的实验。GNS3下也测试过也有这种问题。 PC1 :192.168.0.2 vlan2 gateway:192.168.0.1 PC2: 192.168.1.2 vlan3 gateway:192.168.1.1 SW1: Vlan2 ip:192.168.0.1 Vlan3 ip:192.168.1.1 F0/3 ip : 12.0.0.1
R2: G0/0 IP : 12.0.0.2 G0/1 IP :23.0.0.2
R3: g0/0 ip :23.0.0.3 Lo0 ip : 3.3.3.3
路由: SW1: ip route 0.0.0.0 0.0.0.0 12.0.0.2 R2: ip route 192.168.0.0 255.255.255.012.0.0.1 ip route 192.168.1.0 255.255.255.0 12.0.0.1 ip route 3.3.3.0 255.255.255.0 23.0.0.3 R3”: ip route 0.0.0.0 0.0.0.0 23.0.0.2
配置: SW1:Switch#show run Building configuration...
Current configuration : 1417 bytes ! version 12.2 no service timestamps log datetime msec no service timestamps debug datetime msec no service password-encryption ! hostname Switch ! ! ! ! ! ip routing ! ! ! ! ! ! ! ! ! ! spanning-tree mode pvst ! ! ! ! interface FastEthernet0/1 switchport access vlan 3 switchport mode access ! interface FastEthernet0/2 switchport access vlan 2 switchport mode access ! interface FastEthernet0/3 no switchport ip address 12.0.0.1255.255.255.0 duplex auto speed auto ! interface FastEthernet0/4 ! interface FastEthernet0/5 ! interface FastEthernet0/6 ! interface FastEthernet0/7 ! interface FastEthernet0/8 ! interface FastEthernet0/9 ! interface FastEthernet0/10 ! interface FastEthernet0/11 ! interface FastEthernet0/12 ! interface FastEthernet0/13 ! interface FastEthernet0/14 ! interface FastEthernet0/15 ! interface FastEthernet0/16 ! interface FastEthernet0/17 ! interface FastEthernet0/18 ! interface FastEthernet0/19 ! interface FastEthernet0/20 ! interface FastEthernet0/21 ! interface FastEthernet0/22 ! interface FastEthernet0/23 ! interface FastEthernet0/24 ! interface GigabitEthernet0/1 ! interface GigabitEthernet0/2 ! interface Vlan1 no ip address shutdown ! interface Vlan2 ip address 192.168.0.1255.255.255.0 ! interface Vlan3 ip address 192.168.1.1255.255.255.0 ! ip classless ip route 0.0.0.0 0.0.0.0 12.0.0.2 ! ! ! ! ! ! ! line con 0 ! line aux 0 ! line vty 0 4 login ! ! ! end
Switch# Switch# Switch#
R2:R2#show run Building configuration...
Current configuration : 773 bytes ! version 15.1 no service timestamps log datetime msec no service timestamps debug datetime msec no service password-encryption ! hostname R2 ! ! ! ! ! ! ! ! ! ! ! ! license udi pid CISCO2911/K9 sn FTX15240R7A ! ! ! ! ! spanning-tree mode pvst ! ! ! ! interface GigabitEthernet0/0 ipaddress 12.0.0.2 255.255.255.0 duplex auto speed auto ! interface GigabitEthernet0/1 ipaddress 23.0.0.2 255.255.255.0 duplex auto speed auto ! interface GigabitEthernet0/2 noip address duplex auto speed auto shutdown ! interface Vlan1 noip address shutdown ! ip classless ip route 192.168.0.0 255.255.255.0 12.0.0.1 ip route 192.168.1.0 255.255.255.0 12.0.0.1 ip route 3.3.3.0 255.255.255.0 23.0.0.3 ! ! ! ! ! ! ! line con 0 ! line aux 0 ! line vty 0 4 login ! ! ! end
R2# R3:Router#SHOW RUN Building configuration...
Current configuration : 727 bytes ! version 15.1 no service timestamps log datetime msec no service timestamps debug datetime msec no service password-encryption ! hostname Router ! ! ! ! ! ! ! ! ! ! ! ! license udi pid CISCO2911/K9 sn FTX1524696Z ! ! ! ! ! spanning-tree mode pvst ! ! ! ! interface Loopback0 ipaddress 3.3.3.3 255.255.255.0 ! interface GigabitEthernet0/0 ipaddress 23.0.0.3 255.255.255.0 duplex auto speed auto ! interface GigabitEthernet0/1 noip address duplex auto speed auto shutdown ! interface GigabitEthernet0/2 noip address duplex auto speed auto shutdown ! interface Vlan1 noip address shutdown ! ip classless ip route 0.0.0.0 0.0.0.0 23.0.0.2 ! ! ! ! ! ! ! line con 0 ! line aux 0 ! line vty 0 4 login ! ! ! end
Router#
附件是PT的环境和配置。大家可以安装个PT试下。
|