本文主要是介绍华为设备配置MBGP基本功能,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
- 配置各Switch的接口IP地址
[LSW1]vlan batch 10 50
[LSW1-GigabitEthernet0/0/1]port link-type access
[LSW1-GigabitEthernet0/0/1]port default vlan 50
[LSW1-GigabitEthernet0/0/2]port link-type trunk
[LSW1-GigabitEthernet0/0/2]port trunk allow-pass vlan 10
[LSW2]vlan batch 10 20 40 60
[LSW2-GigabitEthernet0/0/1]port link-type trunk
[LSW2-GigabitEthernet0/0/1]port trunk allow-pass vlan 10
[LSW2-GigabitEthernet0/0/3]port link-type trunk
[LSW2-GigabitEthernet0/0/3]port trunk allow-pass vlan 20
[LSW2-GigabitEthernet0/0/4]port link-type trunk
[LSW2-GigabitEthernet0/0/4]port trunk allow-pass vlan 40
[LSW2-GigabitEthernet0/0/2]port link-type trunk
[LSW2-GigabitEthernet0/0/2]port link-type access
[LSW2-GigabitEthernet0/0/2]port default vlan 60
[LSW3]vlan batch 20 30
[LSW3-GigabitEthernet0/0/2]port link-type trunk
[LSW3-GigabitEthernet0/0/2]port trunk allow-pass vlan 20
[LSW3-GigabitEthernet0/0/4]port link-type trunk
[LSW3-GigabitEthernet0/0/4]port trunk allow-pass vlan 30
[LSW4]vlan batch 30 40 70
[LSW4-GigabitEthernet0/0/3]port link-type trunk
[LSW4-GigabitEthernet0/0/3]port trunk allow-pass vlan 30
[LSW4-GigabitEthernet0/0/2]port link-type trunk
[LSW4-GigabitEthernet0/0/2]port trunk allow-pass vlan 40
[LSW4-GigabitEthernet0/0/1]port link-type access
[LSW4-GigabitEthernet0/0/1]port default vlan 70
[LSW1-Vlanif50]ip add 10.1.5.1 24
[LSW1-Vlanif10]ip add 10.1.1.1 24
[LSW1-LoopBack0]ip add 1.1.1.1 32
[LSW2-Vlanif10]ip add 10.1.1.2 24
[LSW2-Vlanif20]ip add 10.1.2.2 24
[LSW2-Vlanif40]ip add 10.1.4.2 24
[LSW2-Vlanif60]ip add 10.1.6.2 24
[LSW2-LoopBack0]ip add 2.2.2.2 32
[LSW3-Vlanif20]ip add 10.1.2.3 24
[LSW3-Vlanif30]ip add 10.1.3.3 24
[LSW3-LoopBack0]ip add 3.3.3.3 32
[LSW4-Vlanif30]ip add 10.1.3.4 24
[LSW4-Vlanif40]ip add 10.1.4.4 24
[LSW4-Vlanif70]ip add 10.1.7.4 24
[LSW4-LoopBack0]ip add 4.4.4.4 32
[LSW1]stp disable
[LSW2]stp disable
[LSW3]stp disable
[LSW4]stp disable
2. 在自治系统内配置OSPF协议,确保AS200中设备在网络层互通
[LSW2]ospf 1
[LSW2-ospf-1]area 0
[LSW2-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255
[LSW2-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255
[LSW2-ospf-1-area-0.0.0.0]network 10.1.4.0 0.0.0.255
[LSW2-ospf-1-area-0.0.0.0]network 10.1.6.0 0.0.0.255
[LSW2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[LSW3]ospf 1
[LSW3-ospf-1]area 0
[LSW3-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255
[LSW3-ospf-1-area-0.0.0.0]network 10.1.3.0 0.0.0.255
[LSW3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[LSW4]ospf 1
[LSW4-ospf-1]area 0
[LSW4-ospf-1-area-0.0.0.0]network 10.1.3.0 0.0.0.255
[LSW4-ospf-1-area-0.0.0.0]network 10.1.4.0 0.0.0.255
[LSW4-ospf-1-area-0.0.0.0]network 10.1.7.0 0.0.0.255
[LSW4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0
-
配置BGP,使能MBGP协议,配置MBGP对等体
[LSW1]bgp 100
[LSW1-bgp]peer 10.1.1.2 as-number 200
[LSW1-bgp]ipv4-family multicast
[LSW1-bgp-af-multicast]peer 10.1.1.2 enable
[LSW2]bgp 200
[LSW2-bgp]peer 10.1.1.1 as-number 100
[LSW2-bgp]peer 10.1.2.3 as-number 200
[LSW2-bgp]peer 10.1.4.4 as-number 200
[LSW2-bgp]ipv4-family multicast
[LSW2-bgp-af-multicast]peer 10.1.2.3 enable
[LSW2-bgp-af-multicast]peer 10.1.1.1 enable
[LSW2-bgp-af-multicast]peer 10.1.4.4 enable
[LSW3]bgp 200
[LSW3-bgp]peer 10.1.3.4 as-number 200
[LSW3-bgp]peer 10.1.2.2 as-number 200
[LSW3-bgp]ipv4-family multicast
[LSW3-bgp-af-multicast]peer 10.1.2.2 enable
[LSW3-bgp-af-multicast]peer 10.1.3.4 enable
[LSW4]bgp 200
[LSW4-bgp]peer 10.1.3.3 as-number 200
[LSW4-bgp]peer 10.1.4.2 as-number 200
[LSW4-bgp]ipv4-family multicast
[LSW4-bgp-af-multicast]peer 10.1.3.3 enable
[LSW4-bgp-af-multicast]peer 10.1.4.2 enable
-
配置要发布的路由
[LSW1]bgp 100
[LSW1-bgp]import-route direct
[LSW1-bgp]ipv4-family multicast
[LSW1-bgp-af-multicast]import-route direct
[LSW2]bgp 200
[LSW2-bgp]import-route direct
[LSW2-bgp]import-route ospf 1
[LSW2-bgp]ipv4-family multicast
[LSW2-bgp-af-multicast]import-route direct
[LSW2-bgp-af-multicast]import-route ospf 1 -
使能各LSW及其相连接口的组播功能
[LSW1]multicast routing-enable
[LSW1-Vlanif10]pim sm
[LSW1-Vlanif50]pim sm
[LSW2]multicast routing-enable
[LSW2-Vlanif10]pim sm
[LSW2-Vlanif20]pim sm
[LSW2-Vlanif40]pim sm
[LSW3]multicast routing-enable
[LSW3-Vlanif20]pim sm
[LSW3-Vlanif30]pim sm
[LSW4]multicast routing-enable
[LSW4-Vlanif30]pim sm
[LSW4-Vlanif40]pim sm
[LSW4-Vlanif70]pim sm -
在各AS内部配置BSR和RP
[LSW1]int LoopBack 0
[LSW1-LoopBack0]pim sm
[LSW1]pim
[LSW1-pim]c-bsr LoopBack 0
[LSW1-pim]c-rp LoopBack 0
[LSW2]int LoopBack 0
[LSW2-LoopBack0]pim sm
[LSW2]pim
[LSW2-pim]c-bsr LoopBack 0
[LSW2-pim]c-rp LoopBack 0 -
在域间相连接口上配置BSR服务边界
[LSW1]int Vlanif 10
[LSW1-Vlanif10]pim bsr-boundary
[LSW2]int Vlanif 10
[LSW2-Vlanif10]pim bsr-boundary -
配置MSDP对等体
[LSW1]msdp
[LSW1-msdp]peer 10.1.1.2 connect-interface Vlanif 10
[LSW2]msdp
[LSW2-msdp]peer 10.1.1.1 connect-interface Vlanif 10
9.验证配置
这篇关于华为设备配置MBGP基本功能的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!