目录
1、按照图示配 IP 地址,R2,R3,R4,R5分别配 Loopbacke 口地址作为OSPF的Route_id和IBGP邻居地址,地址格式为 x.x.x.x/32,x为设备编号。R1 上配置Loopback口模拟业务网段
2、As 200内部配置OSPF,仅用于实现BGP的TCP可达
3、AS 200内部建立BGP联盟,联盟A为 AS 200,包含2个子AS为 AS 6501 和 AS 65002。R1和R2建立EBGP邻居,R4 和 R6 建立 EBGP邻居,R2和R4建立EBGP邻居,子AS内部建立IBGP全连接
4、R1把业务网段宣告进BGP,要求AS 200内部所有路由器都能够学习到该业务网段路由
5、通过配置团体属性,使 192.168.0.0/24 网段路由只能传递至 AS 200
- [AR1]int g0/0/0
- [AR1-GigabitEthernet0/0/0]ip add 100.1.1.1 24
- [AR1-GigabitEthernet0/0/0]int l0
- [AR1-LoopBack0]ip add 192.168.0.1 24
- [AR1-LoopBack0]int l1
- [AR1-LoopBack1]ip add 192.168.1.1 24
- [AR2]int g0/0/0
- [AR2-GigabitEthernet0/0/0]ip add 100.1.1.2 24
- [AR2-GigabitEthernet0/0/0]int g0/0/1
- [AR2-GigabitEthernet0/0/1]ip add 100.2.2.2 24
- [AR2-GigabitEthernet0/0/1]int g0/0/2
- [AR2-GigabitEthernet0/0/2]ip add 100.3.3.2 24
- [AR2]int l0
- [AR2-LoopBack0]ip add 2.2.2.2 32
- [AR3]int g0/0/0
- [AR3-GigabitEthernet0/0/0]ip add 100.3.3.3 24
- [AR3-GigabitEthernet0/0/0]int g0/0/1
- [AR3-GigabitEthernet0/0/1]ip add 100.5.5.3 24
- [AR3-GigabitEthernet0/0/1]int l0
- [AR3-LoopBack0]ip add 3.3.3.3 32
- [AR4]int g0/0/0
- [AR4-GigabitEthernet0/0/0]ip add 100.2.2.4 24
- [AR4-GigabitEthernet0/0/0]int g0/0/1
- [AR4-GigabitEthernet0/0/1]ip add 100.6.6.4 24
- [AR4-GigabitEthernet0/0/1]int g0/0/2
- [AR4-GigabitEthernet0/0/2]ip add 100.4.4.4 24
- [AR4-GigabitEthernet0/0/2]int l0
- [AR4-LoopBack0]ip add 4.4.4.4 32
- [AR5]int g0/0/0
- [AR5-GigabitEthernet0/0/0]ip add 100.5.5.5 24
- [AR5-GigabitEthernet0/0/0]int g0/0/1
- [AR5-GigabitEthernet0/0/1]ip add 100.4.4.5 24
- [AR5-GigabitEthernet0/0/1]int l0
- [AR5-LoopBack0]ip add 5.5.5.5 32
- [AR6]int g0/0/0
- [AR6-GigabitEthernet0/0/0]ip add 100.6.6.6 24
- [AR2]ospf 1 router-id 2.2.2.2
- [AR2-ospf-1]a 0
- [AR2-ospf-1-area-0.0.0.0]net 100.2.2.0 0.0.0.255
- [AR2-ospf-1-area-0.0.0.0]net 100.3.3.0 0.0.0.255
- [AR2-ospf-1-area-0.0.0.0]net 2.2.2.2 0.0.0.0
-
- [AR3]ospf 1 router-id 3.3.3.3
- [AR3-ospf-1]a 0
- [AR3-ospf-1-area-0.0.0.0]net 0.0.0.0 255.255.255.255 # 懒人宣告法
-
- [AR4]ospf 1 router-id 4.4.4.4
- [AR4-ospf-1]a 0
- [AR4-ospf-1-area-0.0.0.0]net 100.2.2.0 0.0.0.255
- [AR4-ospf-1-area-0.0.0.0]net 100.4.4.0 0.0.0.255
- [AR4-ospf-1-area-0.0.0.0]net 4.4.4.4 0.0.0.0
-
- [AR5]ospf 1 router-id 5.5.5.5
- [AR5-ospf-1]a 0
- [AR5-ospf-1-area-0.0.0.0]net 0.0.0.0 255.255.255.255
- [AR1]bgp 100
- [AR1-bgp]peer 100.1.1.2 as-number 200
-
- [AR2]bgp 65001 # 申明联盟AS
- [AR2-bgp]confederation id 200
- [AR2-bgp]confederation peer-as 65002 # 申明联盟同伴
- [AR2-bgp]peer 100.1.1.1 as-number 100
- [AR2-bgp]peer 3.3.3.3 as-number 65001
- [AR2-bgp]peer 3.3.3.3 connect-interface l0
- [AR2-bgp]peer 3.3.3.3 next-hop-local
- [AR2-bgp]peer 100.2.2.4 as-number 65002
- [AR2-bgp]peer 100.2.2.4 next-hop-local
-
- [AR3]bgp 65001
- [AR3-bgp]confederation id 200
- [AR3-bgp]peer 2.2.2.2 as 65001
- [AR3-bgp]peer 2.2.2.2 connect-interface l0
-
- [AR4]bgp 65002
- [AR4-bgp]confederation id 200
- [AR4-bgp]confederation peer-as 65001
- [AR4-bgp]peer 100.2.2.2 as-number 65001
- [AR4-bgp]peer 100.2.2.2 next-hop-local
- [AR4-bgp]peer 100.6.6.6 as-number 300
- [AR4-bgp]peer 5.5.5.5 as-number 65002
- [AR4-bgp]peer 5.5.5.5 connect-interface l0
- [AR4-bgp]peer 5.5.5.5 next-hop-local
-
- [AR5]bgp 65002
- [AR5-bgp]confederation id 200
- [AR5-bgp]peer 4.4.4.4 as-number 65002
- [AR5-bgp]peer 4.4.4.4 connect-interface l0
-
- [AR6]bgp 300
- [AR6-bgp]peer 100.6.6.4 as-number 200
- [AR1]bgp 100
- [AR1-bgp]net 192.168.0.0 24
- [AR1-bgp]net 192.168.1.0 24
- [AR1]acl 2000
- [AR1-acl-basic-2000]rule permit source 192.168.0.0 0.0.0.255
- [AR1]route-policy com permit node 10
- [AR1-route-policy]if-match acl 2000
- [AR1-route-policy]apply community no-export
- [AR1]route-policy com permit node 20
- [AR1]bgp 100
- [AR1-bgp]peer 100.1.1.2 route-policy com export
- [AR1-bgp]peer 100.1.1.2 advertise-community
- [AR2-bgp]peer 100.2.2.4 advertise-community
-