雏鹰部落

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 1129|回复: 2

[讨论/求助] 奇怪的客户端网关问题

[复制链接]
发表于 2014-6-19 23:23:01 | 显示全部楼层 |阅读模式
本帖最后由 ji191359129 于 2014-6-19 23:30 编辑

   内网网关奇怪的问题
如图,
:三层交换上做vlan间路由,配置静态路由出外网
二:各路由器上配置静态路由使得全网互通
问题来了。
三:在PC2上将网关设置成pc1 ip地址,也能ping3.3.3.3,      为什么呢???

我这里用PT做的实验。GNS3下也测试过也有这种问题。
PC1 :192.168.0.2   vlan2 gateway192.168.0.1
PC2: 192.168.1.2   vlan3 gateway192.168.1.1
SW1:
Vlan2 ip192.168.0.1
Vlan3 ip192.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试下。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
发表于 2014-6-21 08:43:38 | 显示全部楼层
理论分析:
你PC2的网关设置成PC1的网关,意思就是让PC1帮你转发数据,那PC2和PC1在不同的网段怎么才能把数据转发出去呢?由于思科的设备接口下的代理ARP默认是开的,所有你能顺利把你需要到达3.3.3.3的数据转发到PC1,然后PC1通过他的默认网关就出去了。
实际测试:
1,你可以在PC2上traceroute下3.3.3.3,看下路径;
2,你可以把VLAN 3的SVI 3接口的代理ARP功能关闭,好像是进入接口,然后no ip proxy-arp,然后再测试连通性。
你可以做这两个验证,我相信你就明白其中的道道了。

祝你好运。
 楼主| 发表于 2014-7-23 20:42:10 | 显示全部楼层
非常感谢。  后面试过了。 找到原因了。 是代理arp的问题。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|熊猫同学技术论坛|小黑屋| 网络工程师论坛 ( 沪ICP备09076391 )

GMT+8, 2024-4-24 01:29 , Processed in 0.080905 second(s), 19 queries , Gzip On.

快速回复 返回顶部 返回列表