华为vrrp+mstp+ospf+dhcp+dhcp relay配置案例

1、左边是vlan 10主桥,右边是vlan 20的主桥,并且互为备桥

2、 vlan 10 vrrp网关默认用左边,vlan 20的vrrp 网关默认用右边,对应mstp生成树

3、两边都track检测,不通就把vrrp减掉60,这样就会自动切另一边了

4、两边vlan 10和20 都启用dhcp代理,帮助pc获取路由器上的地址

R1配置

dhcp enable

ip pool vlan10

gateway-list 192.168.10.254

network 192.168.10.0 mask 255.255.255.0

dns-list 8.8.8.8

ip pool vlan20

gateway-list 192.168.20.254

network 192.168.20.0 mask 255.255.255.0

dns-list 8.8.8.8

interface GigabitEthernet0/0/0

ip address 10.0.0.1 255.255.255.0

ospf enable 1 area 0.0.0.0

interface GigabitEthernet0/0/1

ip address 10.0.1.1 255.255.255.0

ospf enable 1 area 0.0.0.0

dhcp select global

interface GigabitEthernet0/0/2

dhcp select global

interface NULL0

interface LoopBack0

ip address 1.1.1.1 255.255.255.255

ospf enable 1 area 0.0.0.0

ospf 1 router-id 1.1.1.1

default-route-advertise always

area 0.0.0.0

sw1

vlan batch 10 20 100

stp instance 1 root primary

stp instance 2 root secondary

dhcp enable

ip relay address cycle //多dhcp服务器时负载

stp region-configuration

region-name a

instance 1 vlan 10

instance 2 vlan 20

active region-configuration

drop-profile default

dhcp server group vlan10

dhcp-server 10.0.0.1 0

dhcp-server 10.0.1.1 1

interface Vlanif10

ip address 192.168.10.1 255.255.255.0

vrrp vrid 10 virtual-ip 192.168.10.254

vrrp vrid 10 priority 105

vrrp vrid 10 track interface GigabitEthernet0/0/1 reduced 60

vrrp vrid 10 track interface GigabitEthernet0/0/2 reduced 60

ospf enable 1 area 0.0.0.0

dhcp select relay

dhcp relay server-select vlan10

interface Vlanif20

ip address 192.168.20.1 255.255.255.0

vrrp vrid 20 virtual-ip 192.168.20.254

ospf enable 1 area 0.0.0.0

dhcp select relay

dhcp relay server-select vlan10

interface Vlanif100

ip address 10.0.0.2 255.255.255.0

ospf enable 1 area 0.0.0.0

interface MEth0/0/1

interface GigabitEthernet0/0/1

port link-type access

port default vlan 100

interface GigabitEthernet0/0/2

port link-type trunk

port trunk allow-pass vlan 10 20

interface GigabitEthernet0/0/3

port link-type trunk

port trunk allow-pass vlan 10 20

ospf 1 router-id 2.2.2.2

area 0.0.0.0

sw2

vlan batch 10 20 200

stp instance 1 root secondary

stp instance 2 root primary

dhcp enable

ip relay address cycle

diffserv domain default

stp region-configuration

region-name a

instance 1 vlan 10

instance 2 vlan 20

active region-configuration

drop-profile default

dhcp server group vlan10

dhcp-server 10.0.0.1 0

dhcp-server 10.0.1.1 1

interface Vlanif10

ip address 192.168.10.2 255.255.255.0

vrrp vrid 10 virtual-ip 192.168.10.254

ospf enable 1 area 0.0.0.0

dhcp select relay

dhcp relay server-select vlan10

interface Vlanif20

ip address 192.168.20.2 255.255.255.0

vrrp vrid 20 virtual-ip 192.168.20.254

vrrp vrid 20 priority 105

vrrp vrid 20 track interface GigabitEthernet0/0/1 reduced 60

vrrp vrid 20 track interface GigabitEthernet0/0/2 reduced 60

ospf enable 1 area 0.0.0.0

dhcp select relay

dhcp relay server-select vlan10

interface Vlanif200

ip address 10.0.1.2 255.255.255.0

ospf enable 1 area 0.0.0.0

interface MEth0/0/1

interface GigabitEthernet0/0/1

port link-type access

port default vlan 200

interface GigabitEthernet0/0/2

port link-type trunk

port trunk allow-pass vlan 10 20

interface GigabitEthernet0/0/3

port link-type trunk

port trunk allow-pass vlan 10 20

ospf 1 router-id 3.3.3.3

area 0.0.0.0

SW3

vlan batch 10 20

stp region-configuration

region-name a

instance 1 vlan 10

instance 2 vlan 20

active region-configuration

interface MEth0/0/1

interface GigabitEthernet0/0/1

port link-type trunk

port trunk allow-pass vlan 10 20

interface GigabitEthernet0/0/2

port link-type trunk

port trunk allow-pass vlan 10 20

interface GigabitEthernet0/0/3

port link-type access

port default vlan 10

stp edged-port enable

interface GigabitEthernet0/0/4

port link-type access

port default vlan 20

stp edged-port enable

相关推荐
Li_Ning212 小时前
vue3+uniapp开发鸿蒙初体验
华为·uni-app·harmonyos
特立独行的猫a3 小时前
HarmonyOS NEXT边学边玩:从零实现一个影视App(七、今日票房页面的设计与实现)
华为·harmonyos
liukuang1106 小时前
华为小米vivo向上,苹果荣耀OPPO向下
华为
李洋-蛟龙腾飞公司6 小时前
华为支付-(可选)特定场景配置操作
华为·harmonyos
李洋-蛟龙腾飞公司6 小时前
华为支付接入规范
华为·harmonyos
luoganttcc6 小时前
华为升腾算子开发(一) helloword
java·前端·华为
程序猿阿伟6 小时前
《探秘鸿蒙Next:非结构化数据处理与模型轻量化的完美适配》
华为·harmonyos
TS_forever00712 小时前
【华为路由的arp配置】
网络·华为
蓝枫amy1 天前
HarmonyOS快速入门
华为·harmonyos
程序猿阿伟1 天前
《探秘鸿蒙Next:如何保障AI模型轻量化后多设备协同功能一致》
人工智能·华为·harmonyos