【实验】静态绑定ARP使得不同网段的设备互通

不同网段通信 必须要有路由
【配置1】
ip route-static 20.1.1.0 255.255.255.0 GigabitEthernet0/0/0
[ar1]dis ip routing-table 20.1.1.0
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Table : Public
Summary Count : 1
Destination/Mask Proto Pre Cost Flags NextHop Interface
20.1.1.0/24 Static 60 0 D 10.1.1.1 GigabitEthernet0/0/0 //自带的 出接口地址为自己的下一跳
[ar1]ping 20.1.1.1
PING 20.1.1.1: 56 data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out

广播能发出去 但是没有回应 ?
为什么没有回应!
什么叫广播 定向广播 及 从出接口发出去 10.1.1.0/24 只在 10.1.1.0/24 广播域内广播 但是请求的是20.1.1.1不同广播域 没有响应
手动指定二层封装 设置静态的ARP绑定
[ar1]ping 20.1.1.2
PING 20.1.1.2: 56 data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out

//则直接请求的是ping地址的ARP信息
【配置2】
ip route-static 20.1.1.0 255.255.255.0 GigabitEthernet0/0/0 20.1.1.1
[ar1]dis ip routing-table 20.1.1.1
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Table : Public
Summary Count : 1
Destination/Mask Proto Pre Cost Flags NextHop Interface
20.1.1.0/24 Static 60 0 D 20.1.1.1 GigabitEthernet0/0/0
[ar1]ping 20.1.1.1
PING 20.1.1.1: 56 data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out

[ar1]ping 20.1.1.2
PING 20.1.1.2: 56 data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out

都是直接请求下一跳地址
静态绑定ARP
[ar1]arp static 20.1.1.1 00e0-fc22-3fcc
[ar1]ping 20.1.1.1
PING 20.1.1.1: 56 data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out

//则直接跳过 ARP的封装了 同理反向也封装
【同理 AR2也同样的配置】
[ar2]dis cu | in ip rou
ip route-static 10.1.1.0 255.255.255.0 GigabitEthernet0/0/0
[ar2]arp static 10.1.1.1 00e0-fcc4-1e1b
//AR2 也是同样的配置
[ar1]ping 20.1.1.1
PING 20.1.1.1: 56 data bytes, press CTRL_C to break
Reply from 20.1.1.1: bytes=56 Sequence=1 ttl=255 time=60 ms
Reply from 20.1.1.1: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 20.1.1.1: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 20.1.1.1: bytes=56 Sequence=4 ttl=255 time=30 ms
Reply from 20.1.1.1: bytes=56 Sequence=5 ttl=255 time=20 ms

//则直接可以通信了
不管路由用配置1 还是配置2 模拟器中都可以ping通
[ar1]dis arp //查看ARP信息
IP ADDRESS MAC ADDRESS EXPIRE(M) TYPE INTERFACE VPN-INSTANCE
VLAN/CEVLAN PVC
------------------------------------------------------------------------------
10.1.1.1 00e0-fcc4-1e1b I - GE0/0/0
20.1.1.1 00e0-fc22-3fcc S--
------------------------------------------------------------------------------
Total:2 Dynamic:0 Static:1 Interface:1
---------------------------------------------------------------------------------------------------------------------------
【真机中的实验】
真机不同的版本 可能通不了

报文可能不会转发 下一跳和出接口不在同一个子网中 下一跳20.1.1.1 自身接口为10.1.1.1
没有下一跳 可能会导致转发失败
思科设备上基本上都可以通信
【总结】
1、如果是PPP封装是可以通信的(HDLC和FR也不能通信)
2、如果是以太网封装 满足两个条件
要有路由信息
手动绑定静态ARP表
3、模拟中可以通 但是华为某些版本的真机中不可以通信