需求:
一端对应 vmware 的 vmnet8 NAT 网络 192.168.102.0/24
一端对应 vmware 的 vmnet1 host-only 网络 172.16.0.0/16
两个网段通过路由器进行互联,宿主机通过静态路由的方式,完成通信
添加 Cloud1
配置 Cloud1
添加一个 绑定信息为 VMnat 1 的网卡,另一个为 UDP 即可
两端 要进行端口映射,这就可以打通 路由器 到 vmnet1 的连接
路由器配置:
<Huawei>system-view
[Huawei]interface GigabitEthernet 0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 172.16.20.20 16
May 15 2022 16:26:34-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[1]:The line protocol
IP on the interface GigabitEthernet0/0/0 has entered the UP state.
<Huawei>ping 172.16.0.1
PING 172.16.0.1: 56 data bytes, press CTRL_C to break
Reply from 172.16.0.1: bytes=56 Sequence=1 ttl=128 time=20 ms
Reply from 172.16.0.1: bytes=56 Sequence=2 ttl=128 time=10 ms
抓包演示
配置 Cloud2
配置vmnat8 接口
路由器配置
<Huawei>system-view
[Huawei]interface GigabitEthernet 0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 192.168.0.99 24
May 15 2022 16:42:10-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol
IP on the interface GigabitEthernet0/0/1 has entered the UP state.
[Huawei-GigabitEthernet0/0/1]ping 192.168.0.11
PING 192.168.0.11: 56 data bytes, press CTRL_C to break
Reply from 192.168.0.11: bytes=56 Sequence=1 ttl=64 time=20 ms
Reply from 192.168.0.11: bytes=56 Sequence=2 ttl=64 time=10 ms
Reply from 192.168.0.11: bytes=56 Sequence=3 ttl=64 time=10 ms
Reply from 192.168.0.11: bytes=56 Sequence=4 ttl=64 time=10 ms
抓包验证