H3C 单臂路由实验
实验拓扑
实验需求
- 按照图示为 PC1 和 PC2 配置 IP 地址和网关
- PC1 属于 Vlan10,PC2属于 Vlan20,配置单臂路由实现 Vlan10 和 Vlan20 三层互通
- PC1 和 PC2 可以互通
实验步骤
PC 配置IP地址(略)
配置单臂路由实现 Vlan10 和 Vlan20 三层互通
用单臂路由实现 Vlan 间三层互通,需要把 SW2 连接 R1 的接口配置为 Trunk,并允许 Vlan10 和 Vlan20 通过,R1 连接 SW2 的接口上要开启子接口,分别作为 Vlan10 和 Vlan20 的网关。
SW1 配置
创建VLAN10和VLAN20
#
vlan 10
#
vlan 20
G1/0/1和G1/0/2分别加入VLAN10和VLAN20
#
interface GigabitEthernet1/0/1
port link-mode bridge
port access vlan 10
#
interface GigabitEthernet1/0/2
port link-mode bridge
port access vlan 20
G1/0/3 Trunk 放行VLAN10和VLAN20
#
interface GigabitEthernet1/0/3
port link-mode bridge
port link-type trunk
undo port trunk permit vlan 1
port trunk permit vlan 10 20
R1 配置
创建G0/0.1子接口,配置网关IP地址,开启 dot1q 识别,绑定VLAN10
#
interface GigabitEthernet0/0.1
ip address 192.168.1.254 255.255.255.0
vlan-type dot1q vid 10
创建G0/0.2子接口,配置网关IP地址,开启 dot1q 识别,绑定VLAN20
#
interface GigabitEthernet0/0.2
ip address 192.168.2.254 255.255.255.0
vlan-type dot1q vid 20
实验验证
在 R1 上查看路由表,会发现已经产生了到达192.168.1.0/24网段和192.168.2.0/24网段的直连路由,出接口分别指向各自子接口,证明路由器已经可以对 Vlan10 和 Vlan20 间的数据进行三层转发
[R1]dis ip routing-table
Destinations : 13 Routes : 13
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
192.168.1.0/24 Direct 0 0 192.168.1.254 GE0/0.1
192.168.1.254/32 Direct 0 0 127.0.0.1 InLoop0
192.168.1.255/32 Direct 0 0 192.168.1.254 GE0/0.1
192.168.2.0/24 Direct 0 0 192.168.2.254 GE0/0.2
192.168.2.254/32 Direct 0 0 127.0.0.1 InLoop0
192.168.2.255/32 Direct 0 0 192.168.2.254 GE0/0.2
224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0
224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
PC1 和 PC2 可以互通
PC1 Ping PC2
<H3C>ping 192.168.2.1 Ping 192.168.2.1 (192.168.2.1): 56 data bytes, press CTRL_C to break 56 bytes from 192.168.2.1: icmp_seq=0 ttl=254 time=1.023 ms 56 bytes from 192.168.2.1: icmp_seq=1 ttl=254 time=2.137 ms 56 bytes from 192.168.2.1: icmp_seq=2 ttl=254 time=1.533 ms 56 bytes from 192.168.2.1: icmp_seq=3 ttl=254 time=0.853 ms 56 bytes from 192.168.2.1: icmp_seq=4 ttl=254 time=1.065 ms
--- 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 = 0.853/1.322/2.137/0.466 ms
<H3C>%Jan 31 17:09:12:913 2024 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 = 0.853/1.322/2.137/0.466 ms.
PC2 Ping PC1
<H3C>ping 192.168.1.1 Ping 192.168.1.1 (192.168.1.1): 56 data bytes, press CTRL_C to break 56 bytes from 192.168.1.1: icmp_seq=0 ttl=254 time=1.041 ms 56 bytes from 192.168.1.1: icmp_seq=1 ttl=254 time=1.290 ms 56 bytes from 192.168.1.1: icmp_seq=2 ttl=254 time=0.430 ms 56 bytes from 192.168.1.1: icmp_seq=3 ttl=254 time=1.042 ms 56 bytes from 192.168.1.1: icmp_seq=4 ttl=254 time=0.955 ms
--- Ping statistics for 192.168.1.1 ---
5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.430/0.952/1.290/0.284 ms
<H3C>%Jan 31 17:09:29:772 2024 H3C PING/6/PING_STATISTICS: Ping statistics for 192.168.1.1: 5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss, round-trip min/avg/max/std-dev = 0.430/0.952/1.290/0.284 ms.
实验附件
标签:H3C,56,bytes,Direct,192.168,packet,ms,路由,单臂 From: https://www.cnblogs.com/caomojian/p/18008433/h3c-single-arm-routing-experiment-z2cjarp