题目
IP地址配置
172.16.X.0/24为模拟用户环回接口接口
172.16.7.X/32为BGP邻居关系建立的环回接口
R1:
R2:
R3:
R4:
R5:
R6:
R7:
R8:
BGP邻居关系建立、宣告和反射器、联邦配置
R1:
bgp 1
router-id 1.1.1.1
peer 172.16.7.1 as-number 2
peer 172.16.7.1 ebgp-max-hop 255
peer 172.16.7.1 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
network 1.1.1.0 255.255.255.0
peer 172.16.7.1 enable
R2:
bgp 64512
router-id 2.2.2.2
confederation id 2
confederation peer-as 64513
peer 1.1.1.1 as-number 1
peer 1.1.1.1 ebgp-max-hop 255
peer 1.1.1.1 connect-interface LoopBack0
peer 172.16.7.2 as-number 64512
peer 172.16.7.2 connect-interface LoopBack0
peer 172.16.7.4 as-number 64513
peer 172.16.7.4 ebgp-max-hop 2
peer 172.16.7.4 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
network 172.16.1.0 255.255.255.0
network 172.16.7.0 255.255.255.0
peer 1.1.1.1 enable
peer 172.16.7.2 enable
peer 172.16.7.2 next-hop-local
peer 172.16.7.4 enable
peer 172.16.7.4 next-hop-local
R3:
bgp 64512
router-id 3.3.3.3
confederation id 2
peer 172.16.7.1 as-number 64512
peer 172.16.7.1 connect-interface LoopBack0
peer 172.16.7.3 as-number 64512
peer 172.16.7.3 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
network 172.16.2.0 255.255.255.0
peer 172.16.7.1 enable
peer 172.16.7.3 enable
peer 172.16.7.3 reflect-client
R4:
bgp 64512
router-id 4.4.4.4
confederation id 2
confederation peer-as 64513
peer 172.16.7.2 as-number 64512
peer 172.16.7.2 connect-interface LoopBack0
peer 172.16.7.6 as-number 64513
peer 172.16.7.6 ebgp-max-hop 2
peer 172.16.7.6 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
network 172.16.3.0 255.255.255.0
peer 172.16.7.2 enable
peer 172.16.7.6 enable
R5:
bgp 64513
router-id 5.5.5.5
confederation id 2
confederation peer-as 64512
peer 172.16.7.1 as-number 64512
peer 172.16.7.1 ebgp-max-hop 2
peer 172.16.7.1 connect-interface LoopBack0
peer 172.16.7.5 as-number 64513
peer 172.16.7.5 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
network 172.16.4.0 255.255.255.0
peer 172.16.7.1 enable
peer 172.16.7.5 enable
R6:
bgp 64513
router-id 6.6.6.6
confederation id 2
peer 172.16.7.4 as-number 64513
peer 172.16.7.4 connect-interface LoopBack0
peer 172.16.7.6 as-number 64513
peer 172.16.7.6 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
network 172.16.5.0 255.255.255.0
peer 172.16.7.4 enable
peer 172.16.7.6 enable
peer 172.16.7.6 reflect-client
R7:
bgp 64513
router-id 7.7.7.7
confederation id 2
confederation peer-as 64512
peer 8.8.8.8 as-number 3
peer 8.8.8.8 ebgp-max-hop 2
peer 8.8.8.8 connect-interface LoopBack0
peer 172.16.7.3 as-number 64512
peer 172.16.7.3 ebgp-max-hop 2
peer 172.16.7.3 connect-interface LoopBack0
peer 172.16.7.5 as-number 64513
peer 172.16.7.5 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
network 172.16.6.0 255.255.255.0
network 172.16.7.0 255.255.255.0
peer 8.8.8.8 enable
peer 172.16.7.3 enable
peer 172.16.7.3 next-hop-local
peer 172.16.7.5 enable
peer 172.16.7.5 next-hop-local
R8:
bgp 3
router-id 8.8.8.8
peer 172.16.7.6 as-number 2
peer 172.16.7.6 ebgp-max-hop 2
peer 172.16.7.6 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
network 8.8.8.0 255.255.255.0
peer 172.16.7.6 enable
结果
实现了连接用户的接口网络可以和R1/8的环回通讯