ARP地址解析(不同网段)
1.实验拓扑图
2.配置两台PC的IP
3.配置路由器端口IP
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sy R1
[R1]int G0/0/0
[R1-GigabitEthernet0/0/0]ip ad
[R1-GigabitEthernet0/0/0]ip address 192.168.1.254 24
Jun 29 2017 14:26:01-08:00 R1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R1-GigabitEthernet0/0/0]dis this
[V200R003C00]
#
interface GigabitEthernet0/0/0
ip address 192.168.1.254 255.255.255.0
[R1-GigabitEthernet0/0/0]int G0/0/1
[R1-GigabitEthernet0/0/1]ip add
[R1-GigabitEthernet0/0/1]ip address 192.168.2.254 24
Jun 29 2017 14:29:02-08:00 R1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R1-GigabitEthernet0/0/1]dis this
[V200R003C00]
#
interface GigabitEthernet0/0/1
ip address 192.168.2.254 255.255.255.0
#
return
[R1-GigabitEthernet0/0/1]
4.在路由器上开启ARP代理
<R1>system-view
Enter system view, return user view with Ctrl+Z.
[R1]int G0/0/0
[R1-GigabitEthernet0/0/0]arp-pro
[R1-GigabitEthernet0/0/0]arp-proxy en
[R1-GigabitEthernet0/0/0]arp-proxy enable
[R1-GigabitEthernet0/0/0]
[R1-GigabitEthernet0/0/0]int G0/0/1
[R1-GigabitEthernet0/0/1]arp-pro
[R1-GigabitEthernet0/0/1]arp-proxy enab
[R1-GigabitEthernet0/0/1]arp-proxy enable
[R1-GigabitEthernet0/0/1]
5.在PC3上抓ARP包,并开始用PC3pingPC4
6.在PC4上抓ARP包
7.建立连接发送ping 包
PC3MAC:54-89-98-70-63-0B
PC4MAC:54-89-98-6D-65-AF
G0/0/1MAC:00-e0-fc-f4-06-8a
G0/0/0MAC:00-e0-fc-f4-06-89
在192.168.1.0网段抓包
在192.168.2.0网段抓包
说明数据包在跨网络传输的时候,源IP与目的IP不会改变,源MAC和目的MAC每经过一跳会变化。