BGP实验
1.如图连接网络,合理规格IP地址,AS200内IGP协议
为OSPF
2.R1属于AS 100;R2-R3-R4小AS 234 R5-R6-R7小AS
567,同时声明大AS 200,R8属于AS300
3.R2-R5 R4-R7之间为联邦EBGP邻居关系
4.R1-R8之间通信
配置ip环回,以R2、R7为例
[r2-ui-console0]int l0
[r2-LoopBack0]ip addr 2.2.2.2 24
[r2-LoopBack0]int g0/0/0
[r2-GigabitEthernet0/0/0]ip addr 12.1.1.2 24
[r2-GigabitEthernet0/0/0]int g0/0/1
[r2-GigabitEthernet0/0/1]ip addr 23.1.1.1 24
[r2-GigabitEthernet0/0/1]int g0/0/2
[r2-GigabitEthernet0/0/2]ip addr 25.1.1.1 24
[r7-ui-console0]int l0
[r7-LoopBack0]ip addr 7.7.7.7 24
[r7-LoopBack0]int g0/0/0
[r7-GigabitEthernet0/0/0]ip addr 67.1.1.2 24
[r7-GigabitEthernet0/0/0]int g0/0/1
[r7-GigabitEthernet0/0/1]ip addr 78.1.1.1 24
[r7-GigabitEthernet0/0/1]
[r7-GigabitEthernet0/0/1]int g0/0/2
[r7-GigabitEthernet0/0/2]ip addr 47.1.1.2 24
测试:
配置ospf以R2、R7为例
[r2]ospf 1
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 23.1.1.1 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 25.1.1.1 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[r7-GigabitEthernet0/0/2]ospf 1
[r7-ospf-1]area 0
[r7-ospf-1-area-0.0.0.0]network 7.7.7.7 0.0.0.0
[r7-ospf-1-area-0.0.0.0]network 47.1.1.2 0.0.0.0
[r7-ospf-1-area-0.0.0.0]network 67.1.1.2 0.0.0.0
BGP配置(以R1、R2、R3、R8为例)
R1:
[r1]bgp 100
[r1-bgp]router-id 1.1.1.1
[r1-bgp]peer 12.1.1.2 as-number 200
[r1-bgp-af-ipv4]import-route direct
R2:
[r2]bgp 234
[r2-bgp]router-id 2.2.2.2
[r2-bgp]confederation id 200
[r2-bgp]confederation peer-as 567
[r2-bgp]peer 3.3.3.3 as-number 234
[r2-bgp]peer 3.3.3.3 connect-interface L0
[r2-bgp]peer 5.5.5.5 as-number 567
[r2-bgp]peer 5.5.5.5 connect-interface l0
[r2-bgp]peer 12.1.1.1 as-number 100
[r2-bgp]peer 3.3.3.3 next-hop-local
[r2-bgp]import-route direct
[r2-bgp]import-route ospf 1
R3:
[r3]bgp 234
[r3-bgp]router-id 3.3.3.3
[r3-bgp]confederation id 200
[r3-bgp]peer 2.2.2.2 as-number 234
[r3-bgp]peer 2.2.2.2 connect-interface L0
[r3-bgp]peer 4.4.4.4 as-number 567
[r3-bgp]peer 4.4.4.4 connect-interface l0
[r3-bgp]peer 4.4.4.4 reflect-client
[r3-bgp]peer 2.2.2.2 reflect-client
R8:
r8]bgp 300
[r8-bgp]router-id 8.8.8.8
[r8-bgp]peer 78.1.1.1 as-number 200
[r8-bgp]import-route direct