华为eNSP浮动路由实现不同vlan之间的通信
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了华为eNSP浮动路由实现不同vlan之间的通信相关的知识,希望对你有一定的参考价值。
实验要求:为两个路由器之间配置浮动路由,两台主机互通
AR9
<Huawei>undo terminal monitor #关闭提示信息
Info: Current terminal monitor is off.
<Huawei>sys #进入系统视图
Enter system view, return user view with Ctrl+Z.
[Huawei]int g0/0/0 #进入端口视图
[Huawei-GigabitEthernet0/0/0]ip add 192.168.1.254 24 #配置IP地址
[Huawei-GigabitEthernet0/0/0]q
[Huawei]int g0/0/2
[Huawei-GigabitEthernet0/0/2]ip add 192.168.2.1 24
[Huawei-GigabitEthernet0/0/2]q
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 192.168.3.1 24
[Huawei-GigabitEthernet0/0/1]q
[Huawei]ip route-static 192.168.4.0 24 192.168.2.2 preference 60 #配置路由协议的优先级为60(注:优先级越小越好)
[Huawei]ip route-static 192.168.4.0 24 192.168.3.2 preference 80
AR10
<Huawei>undo terminal monitor
Info: Current terminal monitor is off
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 192.168.4.254 24
[Huawei-GigabitEthernet0/0/1]q
[Huawei]int g0/0/2
[Huawei-GigabitEthernet0/0/2]ip add 192.168.2.2 24
[Huawei-GigabitEthernet0/0/2]q
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.3.2 24
[Huawei-GigabitEthernet0/0/0]q
[Huawei]ip route-static 192.168.1.0 24 192.168.2.1 preference 60
Info: Succeeded in modifying route.
[Huawei]ip route-static 192.168.1.0 24 192.168.3.1 preference 80
Info: Succeeded in modifying route.
验证:在AR9和AR10的命令行输入display routing-table
AR9如图所示:
AR10如图所示:
现在我们看到的路由是主路由,两台主机也能互通
现在我们更改优先级,使用备用路由互通
AR9
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]ip route-static 192.168.4.0 24 192.168.2.2 preference 80
Info: Succeeded in modifying route.
[Huawei]ip route-static 192.168.4.0 24 192.168.3.2 preference 60
Info: Succeeded in modifying route.
AR10
[Huawei]ip route-static 192.168.1.0 24 192.168.2.1 preference 80
Info: Succeeded in modifying route.
[Huawei]ip route-static 192.168.1.0 24 192.168.3.1 preference 60
Info: Succeeded in modifying route.
验证:在AR9和AR10的命令行输入display routing-table,且两台主机互通
AR9如图所示
AR10如图所示
以上是关于华为eNSP浮动路由实现不同vlan之间的通信的主要内容,如果未能解决你的问题,请参考以下文章