通信人家园

 找回密码
 注册

只需一步,快速开始

短信验证,便捷登录

搜索

军衔等级:

  一级军士长

注册:2005-3-29
跳转到指定楼层
1#
发表于 2014-10-2 00:25:05 |只看该作者 |倒序浏览
一.测试拓扑:



二.测试总结:
1.windows主机如果配置网关IP与网卡IP不在相同网段,会发出警告提示
2.windows主机如果发送的目标地址不是本网段的地址时,会先向网关发出ARP请求,而不管网关是否与自己在相同网段
-----经过测试,linux(测试用的是Debian)如果网关与网卡IP不在相同网段,网关不会生效
3.路由器接口收到arp请求后,如果源地址不是与接口处于相同网段的地址,正常情况是不会做出ARP回应的
4.对于思科路由器,有两种方式可以让接口回复源ip与接口IP不在相同网段的ARP请求:
A.配置路由,将去往源IP网段的路由下一跳指向接口
B.配置接口第二IP,使得路由器认为是该接口的直连网段
5.PC在收到不在相同网段网关地址的arp回复后,知道了网关的mac地址,就可以顺利进行二层封包,把数据包发给网关
6.网关路由器根据之前两种配置任一一种,因为有PC网卡所在网段的路由,所以能正常的回包

三.基本配置:
1.路由器R1:
interface Ethernet0/0
     ip address 10.1.1.1 255.255.255.0
     no shut

2.路由器R2:
interface Ethernet0/0
     ip address 10.1.1.2 255.255.255.0
     ip nat outside
     no shut
!
interface Ethernet0/1
     ip address 20.1.1.1 255.255.255.0
     ip nat inside
     no shut

!
ip nat inside source list PAT interface Ethernet0/0 overload
!
ip access-list extended PAT
     permit ip any any
!

3.windows2003主机PC1:



---配置完成后,操作系统会出现提示,不管它

四.测试步骤:

1.在R2和PC1之间开启抓包:
2.从PC1主机ping网关,可以发现ping不通:



3.从抓包情况来看,是因为R2路由器没有对ARP作出回应:




4.R2配置到主机IP所在网络的路由下一跳为接口:
ip route 192.168.1.0 255.255.255.0 Ethernet0/1
5.再从PC1主机ping网关地址,这时能ping通:



6.从抓包结果也可以看的出,R2对发送过来的arp请求作出了回应:



7.因为路由R2做了动态PAT,此时PC1也能ping通R1的接口地址:





em0: <Intel(R) PRO/1000 Network Connection - VJX stub Version - 3.2.18> port 0x2000-0x203f mem 0xd8860000-0xd887ffff,0xd8800000-0xd880ffff irq 19 at device 1.0 on pci2
pci2: <multimedia, audio> at device 2.0 (no driver attached)
ehci0: <EHCI (generic) USB 2.0 controller> mem 0xd8840000-0xd8840fff irq 17 at device 3.0 on pci2
usb0: EHCI version 1.0
usb0: <EHCI (generic) USB 2.0 controller> on ehci0
usb0: USB revision 2.0
uhub0: (0x15ad) EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
uhub0: 6 ports with 6 removable, self powered
em1: <Intel(R) PRO/1000 Network Connection - VJX stub Version - 3.2.18> port 0x2080-0x20bf mem 0xd8880000-0xd889ffff,0xd8810000-0xd881ffff irq 19 at device 5.0 on pci2
pci2: <mass storage, SCSI> at device 6.0 (no driver attached)
em2: <Intel(R) PRO/1000 Network Connection - VJX stub Version - 3.2.18> port 0x20c0-0x20ff mem 0xd88a0000-0xd88bffff,0xd8820000-0xd882ffff irq 17 at device 7.0 on pci2
em3: <Intel(R) PRO/1000 Network Connection - VJX stub Version - 3.2.18> port 0x2400-0x243f mem 0xd88c0000-0xd88dffff,0xd8830000-0xd883ffff irq 18 at device 8.0 on pci2
pcib3: <PCI-PCI bridge> at device 21.0 on pci0

举报本楼

您需要登录后才可以回帖 登录 | 注册 |

手机版|C114 ( 沪ICP备12002291号-1 )|联系我们 |网站地图  

GMT+8, 2024-11-19 00:52 , Processed in 0.191568 second(s), 15 queries , Gzip On.

Copyright © 1999-2023 C114 All Rights Reserved

Discuz Licensed

回顶部