Huawei ipv6 bgp配置 - CyberSecurityBook

时间:2024-02-24 13:17:20

Huawei ipv6 bgp配置

网络拓扑如下:

XRV1的配置

===========================================================

interface GigabitEthernet0/0/0
ipv6 enable
ipv6 address 2020:18FC::1/64
#
interface GigabitEthernet0/0/1
ipv6 enable
ipv6 address 2020:18FC:0:2::1/64
#
interface GigabitEthernet0/0/2
ipv6 enable
ipv6 address 2020:18FC:0:4::1/64
#
bgp 65010
router-id 10.255.255.1
graceful-restart
peer 2020:18FC::2 as-number 65020
peer 2020:18FC::2 password simple cisco
peer 2020:18FC:0:2::2 as-number 65027
peer 2020:18FC:0:2::2 password simple cisco
peer 2020:18FC:0:4::2 as-number 65001
peer 2020:18FC:0:4::2 password simple cisco
#
ipv6-family unicast
undo synchronization
peer 2020:18FC::2 enable
peer 2020:18FC:0:2::2 enable
peer 2020:18FC:0:4::2 enable
#

XRV2的配置

===========================================================

#

interface GigabitEthernet0/0/0
ipv6 enable
ipv6 address 2020:18FC:0:1::1/64
#
interface GigabitEthernet0/0/1
ipv6 enable
ipv6 address 2020:18FC:0:2::2/64
#
interface GigabitEthernet0/0/2
ipv6 enable
ipv6 address 2020:18FC:0:6::1/64
#
bgp 65027
router-id 10.255.255.2
peer 2020:18FC:0:1::2 as-number 65025
peer 2020:18FC:0:1::2 password simple cisco
peer 2020:18FC:0:2::1 as-number 65010
peer 2020:18FC:0:2::1 password simple cisco
peer 2020:18FC:0:6::2 as-number 65001
peer 2020:18FC:0:6::2 password simple cisco
#
ipv6-family unicast
undo synchronization
peer 2020:18FC:0:1::2 enable
peer 2020:18FC:0:2::1 enable
peer 2020:18FC:0:6::2 enable
#

XRV3的配置

===========================================================

#
interface GigabitEthernet0/0/0
ipv6 enable
ipv6 address 2020:18FC::2/64
#
interface GigabitEthernet0/0/1
ipv6 enable
ipv6 address 2020:18FC:0:3::1/64
#
interface GigabitEthernet0/0/2
ipv6 enable
ipv6 address 2020:18FC:0:5::1/64
#
bgp 65020
router-id 10.255.255.3
peer 2020:18FC::1 as-number 65010
peer 2020:18FC::1 password simple cisco
peer 2020:18FC:0:3::2 as-number 65025
peer 2020:18FC:0:3::2 password simple cisco
peer 2020:18FC:0:5::2 as-number 65002
peer 2020:18FC:0:5::2 password simple cisco
#
ipv6-family unicast
undo synchronization
peer 2020:18FC::1 enable
peer 2020:18FC:0:3::2 enable
peer 2020:18FC:0:5::2 enable
#

XRV4的配置

===========================================================

#
interface GigabitEthernet0/0/0
ipv6 enable
ipv6 address 2020:18FC:0:1::2/64
#
interface GigabitEthernet0/0/1
ipv6 enable
ipv6 address 2020:18FC:0:3::2/64
#
interface GigabitEthernet0/0/2
ipv6 enable
ipv6 address 2020:18FC:0:8::1/64
#
bgp 65025
router-id 10.255.255.4
peer 2020:18FC:0:1::1 as-number 65027
peer 2020:18FC:0:1::1 password simple cisco
peer 2020:18FC:0:3::1 as-number 65020
peer 2020:18FC:0:3::1 password simple cisco
peer 2020:18FC:0:8::2 as-number 65002
peer 2020:18FC:0:8::2 password simple cisco
#
ipv6-family unicast
undo synchronization
peer 2020:18FC:0:1::1 enable
peer 2020:18FC:0:3::1 enable
peer 2020:18FC:0:8::2 enable
#

XRV5的配置

===========================================================

#
interface GigabitEthernet0/0/0
ipv6 enable
ipv6 address 2020:18FC:0:9::1/64
ospfv3 100 area 0.0.0.0
ospfv3 network-type p2p
#
interface GigabitEthernet0/0/1
ipv6 enable
ipv6 address 2020:18FC:0:4::2/64
#
interface GigabitEthernet0/0/2
ipv6 enable
ipv6 address 2020:18FC:0:6::2/64
#
bgp 65001
router-id 10.255.255.5
peer 2020:18FC:0:4::1 as-number 65010
peer 2020:18FC:0:4::1 password simple cisco
peer 2020:18FC:0:6::1 as-number 65027
peer 2020:18FC:0:6::1 password simple cisco
#
ipv6-family unicast
undo synchronization
import-route ospfv3 100 med 1000
peer 2020:18FC:0:4::1 enable
peer 2020:18FC:0:6::1 enable
#
route-policy bgp-to-ospf permit node 10
if-match ipv6 address prefix-list bgp-to-ospf
#
ip ipv6-prefix bgp-to-ospf index 10 permit 2020:1808:: 35
ip ipv6-prefix bgp-to-ospf index 20 permit 2020:1808:2000:: 35
ip ipv6-prefix bgp-to-ospf index 30 permit 2020:1808:4000:: 35
ip ipv6-prefix bgp-to-ospf index 40 permit 2020:1808:6000:: 35
ip ipv6-prefix bgp-to-ospf index 50 permit 2020:1808:8000:: 35
ip ipv6-prefix bgp-to-ospf index 60 permit 2020:1808:C000:: 35
ip ipv6-prefix bgp-to-ospf index 70 permit 2020:1808:E000:: 35
ip ipv6-prefix bgp-to-ospf index 80 permit 2020:1808:A000:: 35
#

XRV6的配置

===========================================================

#
interface GigabitEthernet0/0/0
ipv6 enable
ipv6 address 2020:18FC:0:1C::1/64
ospfv3 100 area 0.0.0.0
#
interface GigabitEthernet0/0/1
ipv6 enable
ipv6 address 2020:18FC:0:5::2/64
ipv6 address 2020:18FC:0:7::2/64
#
interface GigabitEthernet0/0/2
ipv6 enable
ipv6 address 2020:18FC:0:8::2/64
#
interface GigabitEthernet1/0/0
#
interface GigabitEthernet2/0/0
#
interface GigabitEthernet3/0/0
#
interface GigabitEthernet4/0/0
#
interface NULL0
#
bgp 65002
router-id 10.255.255.2
graceful-restart
peer 2020:18FC:0:5::1 as-number 65020
peer 2020:18FC:0:5::1 password simple cisco
peer 2020:18FC:0:8::1 as-number 65025
peer 2020:18FC:0:8::1 password simple cisco
#
ipv4-family unicast
undo synchronization
#
ipv6-family unicast
undo synchronization
import-route ospfv3 100
peer 2020:18FC:0:5::1 enable
peer 2020:18FC:0:8::1 enable
#
route-policy ospf-to-bgp permit node 10
if-match ipv6 address prefix-list bgp-to-ospf
#
ip ipv6-prefix bgp-to-ospf index 10 permit 2020:1814:2000:: 35
ip ipv6-prefix bgp-to-ospf index 20 permit 2020:1814:4000:: 35
ip ipv6-prefix bgp-to-ospf index 30 permit 2020:1814:6000:: 35
ip ipv6-prefix bgp-to-ospf index 40 permit 2020:1814:8000:: 35
ip ipv6-prefix bgp-to-ospf index 50 permit 2020:1814:A000:: 35
ip ipv6-prefix bgp-to-ospf index 60 permit 2020:1814:C000:: 35
ip ipv6-prefix bgp-to-ospf index 70 permit 2020:1814:E000:: 35
#

在XRV5上查看ipv6 bgp邻居

===========================================================

在XRV5上查看ipv6 bgp路由

===========================================================