三.基本配置: 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