实验案例拓扑图
给交换机配置,配置trunk链路
[Huawei]interface GigabitEthernet 0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port
trunk allow-pass vlan all
创建vlan将接口加入到vlan
[Huawei]vlan
batch 10 20
[Huawei]interface Ethernet 0/0/1
[Huawei-Ethernet0/0/1]port
link-type access
[Huawei-Ethernet0/0/1]port default
vlan 10
[Huawei]interface Ethernet 0/0/2
[Huawei-Ethernet0/0/2]port
link-type access
[Huawei-Ethernet0/0/2]port default
vlan 20
配置单臂路由
[Huawei]interface GigabitEthernet 0/0/0.2
[Huawei-GigabitEthernet0/0/0.2]arp
broadcast enable
[Huawei-GigabitEthernet0/0/0.2]dot1q
termination vid 10
[Huawei-GigabitEthernet0/0/0.2]ip
address 192.168.10.10 24
[Huawei]interface GigabitEthernet 0/0/0.3
[Huawei-GigabitEthernet0/0/0.3]arp
broadcast enable
[Huawei-GigabitEthernet0/0/0.3]dot1q
termination vid 20
[Huawei-GigabitEthernet0/0/0.3]ip
address 192.168.20.20 24
客户端验证
配置静态默认浮动路由实现全网互通
实验拓扑图
AR3上配置两条静态AR2上配置一条默认
Huawei]ip route-static 192.168.10.0 24 GigabitEthernet 0/0/0 192.168.40.1
Huawei]ip route-static 192.168.20.0 24 GigabitEthernet 0/0/0 192.168.40.1
配置浮动路由
[Huawei]ip route-static 192.168.20.0 255.255.255.0 GigabitEthernet 0/0/2 192.168.60.1 preference 70
[Huawei]ip route-static 192.168.10.0 255.255.255.0 GigabitEthernet 0/0/1 192.168.40.1 preference 70
AR2回一条默认
Huawei]ip route-static 0.0.0.0 0.0.0.0 GigabitEthernet 0/0/2 192.168.60.2
关闭接口验证浮动路由
[Huawei]interface GigabitEthernet 0/0/1
关闭接口 [Huawei-GigabitEthernet0/0/1]shutdown
查看路由表
display ip routing-table
查看端口状态
display ip interface brief