单臂路由实验
单臂路由实验
实验拓扑

实验需求
- 按照图示为 PC3 和 PC4 配置 IP 地址和网关
- PC3 属于 Vlan10,PC4 属于 Vlan20,配置单臂路由实现 Vlan10 和 Vlan20 三层互通
- PC3 和 PC4 可以互通
配置步骤
1.PC 配置 IP 地址部分略
2.PC3 属于 Vlan10,PC4 属于 Vlan20,配置单臂路由实现 Vlan10 和 Vlan20 三层互通
分析: 用单臂路由实现 Vlan 间三层互通,需要把 SW2 连接 AR1 的接口配置为 Trunk,并允许 Vlan10 和 Vlan20 通过。
AR1 连接 SW2 的接口上要开启子接口,分别作为 Vlan10 和 Vlan20 的网关。这里规划 g0/0.1 子接口作为 Vlan10 的网关,IP 地址就是
192.168.1.254/24,g0/0.2 子接口作为 Vlan20 的网关,IP 地址就是192.168.2.254/24。AR1 的子接口上为了能够识别 SW2 的 Trunk 端口发送的 802.1Q 帧,还需要开启 dot1q 识别并绑定相应 Vlan。
步骤 1: 在 SW2 上创建 Vlan10 和 Vlan20,并把 g1/0/1 接口加入 Vlan10,把 g1/0/2 接口加入 Vlan20
vlan 10port g1/0/1vlan 20port g1/0/2步骤 2: 把 SW2 的 g1/0/3 接口配置为 Trunk,并允许 Vlan10 和 Vlan20 通过
interface g1/0/3port link-type trunkport trunk permit vlan 10 20步骤 3: 在 AR1 上创建子接口 g0/0.1,开启 dot1q 识别,绑定到 Vlan10,并配置 IP 地址 192.168.1.254/24
interface g0/0.1vlan-type dot1q vid 10ip address 192.168.1.254 24步骤 4: 在 AR1 上创建子接口 0/0.2,开启 dot1q 识别,绑定到 Vlan20,并配置 IP 地址192.168.2.254/24
interface g0/0.2vlan-type dot1q vid 20ip address 192.168.2.254 24分析: 配置结束后,在 AR1 上查看路由表,会发现已经产生了到达192.168.1.0/24网段和192.168.2.0/24网段的直连路由,出接口分别指向各自子接口,证明路由器已经可以对 Vlan10 和 Vlan20 间的数据进行三层转发了
[AR1]display ip routing-table
Destinations : 13 Routes : 13
Destination/Mask Proto Pre Cost NextHop Interface0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0192.168.1.0/24 Direct 0 0 192.168.1.254 GE0/0.1192.168.1.254/32 Direct 0 0 127.0.0.1 InLoop0192.168.1.255/32 Direct 0 0 192.168.1.254 GE0/0.1192.168.2.0/24 Direct 0 0 192.168.2.254 GE0/0.2192.168.2.254/32 Direct 0 0 127.0.0.1 InLoop0192.168.2.255/32 Direct 0 0 192.168.2.254 GE0/0.2224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop03.测试在 PC3 上 Ping PC4 ,可以 Ping 通 PC4
[H3C]ping 192.168.2.1Ping 192.168.2.1 (192.168.2.1): 56 data bytes, press CTRL_C to break56 bytes from 192.168.2.1: icmp_seq=0 ttl=254 time=10.313 ms56 bytes from 192.168.2.1: icmp_seq=1 ttl=254 time=9.691 ms56 bytes from 192.168.2.1: icmp_seq=2 ttl=254 time=8.030 ms56 bytes from 192.168.2.1: icmp_seq=3 ttl=254 time=8.680 ms56 bytes from 192.168.2.1: icmp_seq=4 ttl=254 time=8.871 ms
--- Ping statistics for 192.168.2.1 ---5 packet(s) transmitted, 5 packet(s) received, 0.0% packet lossround-trip min/avg/max/std-dev = 8.030/9.117/10.313/0.799 ms[H3C]%Aug 28 16:59:51:153 2026 H3C PING/6/PING_STATISTICS: Ping statistics for 192.168.2.1: 5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss, round-trip min/avg/max/std-dev = 8.030/9.117/10.313/0.799 ms.

