华为mstp、vrrp、ospf、isis、bgp等综合一起排错

最终实现左边私网和右边私网全部ping通

SW1

vlan batch 12 34

stp region-configuration //mstp配置

region-name test

instance 12 vlan 12

instance 34 vlan 34

active region-configuration

interface GigabitEthernet0/0/3

port link-type trunk

port trunk allow-pass vlan 12 34

interface GigabitEthernet0/0/4

port link-type trunk

port trunk allow-pass vlan 12 34

interface GigabitEthernet0/0/10

port link-type access

port default vlan 12

interface GigabitEthernet0/0/11

port link-type access

port default vlan 12

SW2

vlan batch 12 34

stp region-configuration

region-name test

instance 12 vlan 12

instance 34 vlan 34

active region-configuration

interface GigabitEthernet0/0/3

port link-type trunk

port trunk allow-pass vlan 12 34

interface GigabitEthernet0/0/4

port link-type trunk

port trunk allow-pass vlan 12 34

interface GigabitEthernet0/0/10

port link-type access

port default vlan 34

interface GigabitEthernet0/0/11

port link-type access

port default vlan 34

SW3

vlan batch 12 to 13 34

stp instance 12 root primary //设置为主根

stp instance 34 root secondary //设置为备根

stp region-configuration

region-name test

instance 12 vlan 12

instance 34 vlan 34

active region-configuration

interface Vlanif12

ip address 192.168.12.3 255.255.255.0

vrrp vrid 1 virtual-ip 192.168.12.254 //vrrp配置

vrrp vrid 1 priority 150

interface Vlanif13

ip address 10.0.13.3 255.255.255.0

interface Vlanif34

ip address 192.168.34.3 255.255.255.0

vrrp vrid 2 virtual-ip 192.168.34.254

interface MEth0/0/1

interface GigabitEthernet0/0/1

port link-type access

port default vlan 13

interface GigabitEthernet0/0/2

interface GigabitEthernet0/0/3

port link-type trunk

port trunk allow-pass vlan 12 34

interface GigabitEthernet0/0/4

port link-type trunk

port trunk allow-pass vlan 12 34

ip route-static 0.0.0.0 0.0.0.0 10.0.13.1

SW4

vlan batch 12 14 34

stp instance 12 root secondary

stp instance 34 root primary

stp region-configuration

region-name test

instance 12 vlan 12

instance 34 vlan 34

active region-configuration

interface Vlanif12

ip address 192.168.12.4 255.255.255.0

vrrp vrid 1 virtual-ip 192.168.12.254

interface Vlanif14

ip address 10.0.14.4 255.255.255.0

interface Vlanif34

ip address 192.168.34.4 255.255.255.0

vrrp vrid 2 virtual-ip 192.168.34.254

vrrp vrid 2 priority 150

interface MEth0/0/1

interface GigabitEthernet0/0/1

interface GigabitEthernet0/0/2

port link-type access

port default vlan 14

interface GigabitEthernet0/0/3

port link-type trunk

port trunk allow-pass vlan 12 34

interface GigabitEthernet0/0/4

port link-type trunk

port trunk allow-pass vlan 12 34

ip route-static 0.0.0.0 0.0.0.0 10.0.14.1

R1

interface GigabitEthernet0/0/0

ip address 10.0.12.1 255.255.255.0

interface GigabitEthernet0/0/1

ip address 10.0.13.1 255.255.255.0

interface GigabitEthernet0/0/2

ip address 10.0.14.1 255.255.255.0

interface LoopBack0

ip address 10.0.1.1 255.255.255.255

bgp 100

router-id 10.0.1.1

peer 10.0.2.2 as-number 100

peer 10.0.2.2 connect-interface LoopBack0

ipv4-family unicast

undo synchronization

import-route static //导入静态,刚好静态通过ip route-static查看只有12、34段

peer 10.0.2.2 enable

peer 10.0.2.2 next-hop-local

ospf 1 router-id 10.0.1.1

area 0.0.0.0

network 10.0.1.1 0.0.0.0

network 10.0.12.1 0.0.0.0

ip route-static 192.168.12.0 255.255.255.0 10.0.13.3

ip route-static 192.168.12.0 255.255.255.0 10.0.14.4 preference 70

ip route-static 192.168.34.0 255.255.255.0 10.0.13.3 preference 70

ip route-static 192.168.34.0 255.255.255.0 10.0.14.4

//让12和34段的回去的包走原来出去的路径回包,源进源出

R2

isis 1

cost-style wide

network-entity 49.0001.0000.0000.0002.00

import-route ospf 1 level-1 //右边和r3建立的是级别1,这里导入ospf必须选择级别1

interface GigabitEthernet0/0/0

ip address 10.0.12.2 255.255.255.0

interface GigabitEthernet0/0/1

ip address 10.0.23.2 255.255.255.0

isis enable 1

isis circuit-level level-1 //只和右边r3建立的是级别1,所以不让这个口发级别2的包出

interface LoopBack0

ip address 10.0.2.2 255.255.255.255

isis enable 1

bgp 100

router-id 10.0.2.2

peer 10.0.1.1 as-number 100

peer 10.0.1.1 connect-interface LoopBack0

peer 10.0.3.3 as-number 100

peer 10.0.3.3 connect-interface LoopBack0

ipv4-family unicast

undo synchronization

peer 10.0.1.1 enable

peer 10.0.1.1 reflect-client

peer 10.0.3.3 enable

peer 10.0.3.3 reflect-client

ospf 1 router-id 10.0.2.2

import-route isis 1

area 0.0.0.0

network 10.0.2.2 0.0.0.0

network 10.0.12.2 0.0.0.0

R3

dhcp enable

ip pool test

gateway-list 192.168.56.254

network 192.168.56.0 mask 255.255.255.0

excluded-ip-address 192.168.56.6

dns-list 192.168.1.1

isis 1

is-level level-1

cost-style wide

network-entity 49.0001.0000.0000.0003.00

firewall zone Local

priority 15

interface GigabitEthernet0/0/0

interface GigabitEthernet0/0/1

ip address 10.0.23.3 255.255.255.0

isis enable 1

interface GigabitEthernet0/0/2.35 //用子接口

dot1q termination vid 35

ip address 10.0.35.3 255.255.255.0

arp broadcast enable

dhcp select global

interface LoopBack0

ip address 10.0.3.3 255.255.255.255

isis enable 1

bgp 100

router-id 10.0.3.3

peer 10.0.2.2 as-number 100

peer 10.0.2.2 connect-interface LoopBack0

ipv4-family unicast

undo synchronization

import-route static //导入静态,刚好静态通过ip route-static查看只有56段

peer 10.0.2.2 enable

peer 10.0.2.2 next-hop-local

ip route-static 192.168.56.0 255.255.255.0 10.0.35.5

SW5

vlan batch 35 56

dhcp enable

interface Vlanif35

ip address 10.0.35.5 255.255.255.0

interface Vlanif56

ip address 192.168.56.254 255.255.255.0

dhcp select relay //中继R3上面的dhcp地址池

dhcp relay server-ip 10.0.35.3

interface GigabitEthernet0/0/2

port link-type trunk

port trunk allow-pass vlan 35

interface GigabitEthernet0/0/4

port link-type trunk

port trunk allow-pass vlan 56

ip route-static 0.0.0.0 0.0.0.0 10.0.35.3

SW6

vlan batch 56

interface GigabitEthernet0/0/4

port link-type trunk

port trunk allow-pass vlan 56

interface GigabitEthernet0/0/10

port link-type access

port default vlan 56

interface GigabitEthernet0/0/11

port link-type access

port default vlan 56

相关推荐
Kaede61 小时前
如何应对Linux云服务器磁盘空间不足的情况
linux·运维·服务器
Zfox_3 小时前
Redis:Hash数据类型
服务器·数据库·redis·缓存·微服务·哈希算法
DevSecOps选型指南7 小时前
2025软件供应链安全最佳实践︱证券DevSecOps下供应链与开源治理实践
网络·安全·web安全·开源·代码审计·软件供应链安全
ABB自动化8 小时前
for AC500 PLCs 3ADR025003M9903的安全说明
服务器·安全·机器人
努力学习的小廉8 小时前
深入了解linux系统—— 进程池
linux·运维·服务器
秃头菜狗8 小时前
各个主要目录的功能 / Linux 常见指令
linux·运维·服务器
利刃大大8 小时前
【在线五子棋对战】二、websocket && 服务器搭建
服务器·c++·websocket·网络协议·项目
国科安芯8 小时前
抗辐照MCU在卫星载荷电机控制器中的实践探索
网络·嵌入式硬件·硬件工程·智能硬件·空间计算
vfvfb9 小时前
bat批量去掉本文件夹中的文件扩展名
服务器·windows·批处理·删除扩展名·bat技巧
EasyDSS10 小时前
国标GB28181设备管理软件EasyGBS远程视频监控方案助力高效安全运营
网络·人工智能