华为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

相关推荐
逢生博客9 小时前
Mac 搭建仓颉语言开发环境(Cangjie SDK)
macos·华为·鸿蒙
青柠_项目管理9 小时前
PMP证书持有者,在华为、腾讯一般能拿多少薪资?
华为·pmp
小强在此12 小时前
【基于开源鸿蒙(OpenHarmony)的智慧农业综合应用系统】
华为·开源·团队开发·智慧农业·harmonyos·开源鸿蒙
Reuuse14 小时前
【HCIA-Datacom】华为VRP系统
服务器·网络·华为
PlumCarefree16 小时前
基于鸿蒙API10的RTSP播放器(四:沉浸式播放窗口)
华为·harmonyos
中关村科金19 小时前
中关村科金推出得助音视频鸿蒙SDK,助力金融业务系统鸿蒙化提速
华为·音视频·harmonyos
繁依Fanyi20 小时前
828 华为云征文|华为 Flexus 云服务器部署 RustDesk Server,打造自己的远程桌面服务器
运维·服务器·开发语言·人工智能·pytorch·华为·华为云
小强在此1 天前
基于OpenHarmony(开源鸿蒙)的智慧医疗综合应用系统
华为·开源·团队开发·健康医疗·harmonyos·开源鸿蒙
奔跑的露西ly1 天前
【鸿蒙 HarmonyOS NEXT】popup弹窗
华为·harmonyos
繁依Fanyi1 天前
828华为云征文|华为Flexus云服务器搭建OnlyOffice私有化在线办公套件
服务器·开发语言·前端·python·算法·华为·华为云