目录
7,AS 200 内部配置 OSPF,仅用于实现 BGP 的 TCP 可达
9,R1 把业务网段宣告进 BGP,要求 AS 200 内部所有路由器都能够学习到该业务网段路由
10,通过配置团体属性,使 192.168.0.0/24 网段路由只能传递至 AS 200
11,效果查看BGP AS200区域中即存在192.168.0.0的网段,也存在192.168.1.0的网段,而不同区域AS300只有一条192.168.1.0的网段
实验拓扑
拓扑下载连接:

图1-1
注:如无特别说明,描述中的R1或SW1对应拓扑中设备名称末尾数字为1的设备,R2或SW2对应拓扑中设备名称末尾数字为2的设备,以此类推
实验需求
1.按照图示配置 IP 地址,R2,R3,R4,R5 分别配置 Loopback0 口地址作为 OSPF 的 Router_id 和 IBGP 邻居地址,地址格式为 X.X.X.X/32,X 为设备编号。R1 上配置 Loopback 口模拟业务网段
2.AS 200 内部配置 OSPF,仅用于实现 BGP 的 TCP 可达
3.AS 200 内部建立 BGP 联盟,联盟 AS 为 AS 200,包含 2个 子 AS 为 AS 65001 和 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
实验解法
6,按照图示配置 IP 地址,R2,R3,R4,R5 分别配置 Loopback0 口地址作为 OSPF 的 Router_id 和 IBGP 邻居地址,地址格式为 X.X.X.X/32,X 为设备编号。R1 上配置 Loopback 口模拟业务网段
R1
SYS
System View: return to User View with Ctrl+Z.
[H3C]sysn r1
[r1]int g0/0
[r1-GigabitEthernet0/0]ip add 100.1.1.1 24
[r1-LoopBack0]int loo 0
[r1-LoopBack0]ip add 192.168.0.1 24
[r1-LoopBack0]int loo 1
[r1-LoopBack1]ip add 192.168.1.1 24
R2
sys
System View: return to User View with Ctrl+Z.
[H3C]sysn r2
[r2]int g0/0
[r2-GigabitEthernet0/0]ip add 100.1.1.2 24
[r2-GigabitEthernet0/0]int g0/2
[r2-GigabitEthernet0/2]ip add 100.3.3.2 24
[r2-GigabitEthernet0/2]int g0/1
[r2-GigabitEthernet0/1]ip add 100.2.2.2 24
[r2-GigabitEthernet0/1]int loo 0
[r2-LoopBack0]ip add 2.2.2.2 32
R3
sys
System View: return to User View with Ctrl+Z.
[H3C]sysn r3
[r3]int g0/0
[r3-GigabitEthernet0/0]ip add 100.3.3.3 24
[r3-GigabitEthernet0/0]int g0/1
[r3-GigabitEthernet0/1]ip add 100.5.5.3 24
[r3-GigabitEthernet0/1]int loo 0
[r3-LoopBack0]ip add 3.3.3.3 32
R4
sys
System View: return to User View with Ctrl+Z.
[H3C]sysn r4
[r4]int g0/0
[r4-GigabitEthernet0/0]ip add 100.2.2.4 24
[r4-GigabitEthernet0/0]int g0/2
[r4-GigabitEthernet0/2]ip add 100.4.4.4 24
[r4-GigabitEthernet0/2]int g0/1
[r4-GigabitEthernet0/1]ip add 100.6.6.4 24
[r4-GigabitEthernet0/1]int loo 0
[r4-LoopBack0]ip add 4.4.4.4 32
R5
sys
System View: return to User View with Ctrl+Z.
[H3C]sysn r5
[r5]int g0/1
[r5-GigabitEthernet0/1]ip add 100.5.5.5 24
[r5-GigabitEthernet0/1]int g0/0
[r5-GigabitEthernet0/0]ip add 100.4.4.5 24
[r5-GigabitEthernet0/0]int loo 0
[r5-LoopBack0]ip add 5.5.5.5 32
R6
sys
System View: return to User View with Ctrl+Z.
[H3C]sysn r6
[r6]int g0/0
[r6-GigabitEthernet0/0]ip add 100.6.6.6 24
[r6-GigabitEthernet0/0]int loo 0
7,AS 200 内部配置 OSPF,仅用于实现 BGP 的 TCP 可达
步骤1:在R2-----R5上创建ospf进程,并宣告网段
R2
[r2-LoopBack0]ospf 1 rou 2.2.2.2
[r2-ospf-1]a 0
[r2-ospf-1-area-0.0.0.0]netw 2.2.2.2 0.0.0.0
[r2-ospf-1-area-0.0.0.0]netw 100.2.2.0 0.0.0.255
[r2-ospf-1-area-0.0.0.0]netw 100.3.3.0 0.0.0.255
R3
[r3]ospf 1 rou 3.3.3.3
[r3-ospf-1]a 0
[r3-ospf-1-area-0.0.0.0]netw 100.3.3.0 0.0.0.255
[r3-ospf-1-area-0.0.0.0]netw 100.5.5.0 0.0.0.255
[r3-ospf-1-area-0.0.0.0]netw 3.3.3.3 0.0.0.0
R4
[r4-LoopBack0]ospf 1 rou 4.4.4.4
[r4-ospf-1]a 0
[r4-ospf-1-area-0.0.0.0]netw 4.4.4.4 0.0.0.0
[r4-ospf-1-area-0.0.0.0]netw 100.2.2.0 0.0.0.255
[r4-ospf-1-area-0.0.0.0]netw 100.4.4.0 0.0.0.255
R5
[r5-LoopBack0]ospf 1 rou 5.5.5.5
[r5-ospf-1]a 0
[r5-ospf-1-area-0.0.0.0]netw 5.5.5.5 0.0.0.0
[r5-ospf-1-area-0.0.0.0]netw 100.5.5.0 0.0.0.255
[r5-ospf-1-area-0.0.0.0]netw 100.4.4.0 0.0.0.255
8,AS 200 内部建立 BGP 联盟,联盟 AS 为 AS 200,包含 2个 子 AS 为 AS 65001 和 AS 65002。R1 和 R2 建立 EBGP 邻居,R4 和 R6 建立 EBGP 邻居,R2 和 R4 建立 EBGP 邻居,子 AS 内部建立 IBGP 全连接
R1
[r1-LoopBack1]bgp 100
[r1-bgp-default]pe 100.1.1.2 as 200
[r1-bgp-default]add ipv4 un
[r1-bgp-default-ipv4]pe 100.1.1.2 en
R2
[r2-ospf-1-area-0.0.0.0]bgp 65001
[r2-bgp-default]confederation id 200
[r2-bgp-default]con peer-as 65002
[r2-bgp-default]pe 3.3.3.3 as 65001
[r2-bgp-default]pe 3.3.3.3 connect-interface LoopBack 0
[r2-bgp-default]pe 100.1.1.1 as 100
[r2-bgp-default]pe 100.2.2.4 as 65002
[r2-bgp-default]address-family ipv4 un
[r2-bgp-default-ipv4]pe 3.3.3.3 en
[r2-bgp-default-ipv4]pe 3.3.3.3 next-hop-local
[r2-bgp-default-ipv4]pe 100.1.1.1 en
[r2-bgp-default-ipv4]pe 100.2.2.4 en
[r2-bgp-default-ipv4]pe 100.2.2.4 next-hop-local
R3
[r3]bgp 65001
[r3-bgp-default]con id 200
[r3-bgp-default]con pe 65002
[r3-bgp-default]pe 2.2.2.2 as 65001
[r3-bgp-default]pe 2.2.2.2 con LoopBack 0
[r3-bgp-default]add ipv4 un
[r3-bgp-default-ipv4]pe 2.2.2.2 next-hop-local
R4
[r4-ospf-1-area-0.0.0.0]bgp 65002
[r4-bgp-default]con id 200
[r4-bgp-default]con pe 65001
[r4-bgp-default]pe 5.5.5.5 as 65002
[r4-bgp-default]pe 5.5.5.5 con LoopBack 0
[r4-bgp-default]pe 100.2.2.2 as 65001
[r4-bgp-default]pe 100.6.6.6 as 300
[r4-bgp-default]add ipv4 un
[r4-bgp-default-ipv4]pe 5.5.5.5 en
[r4-bgp-default-ipv4]pe 5.5.5.5 nex
[r4-bgp-default-ipv4]pe 100.2.2.2 en
[r4-bgp-default-ipv4]pe 100.2.2.2 nex
[r4-bgp-default-ipv4]pe 100.6.6.6 en
R5
[r5]bgp 65002
[r5-bgp-default]con id 200
[r5-bgp-default]con pe 65001
[r5-bgp-default]pe 4.4.4.4 as 65002
[r5-bgp-default]add ipv4 unicast
[r5-bgp-default-ipv4]pe 4.4.4.4 en
[r5-bgp-default-ipv4]pe 4.4.4.4 nex
R6
[r6]bgp 300
[r6-bgp-default]pe 100.6.6.4 as 200
[r6-bgp-default]add ipv4 unicast
[r6-bgp-default-ipv4]pe 100.6.6.4 en
9,R1 把业务网段宣告进 BGP,要求 AS 200 内部所有路由器都能够学习到该业务网段路由
R1
[r1]bgp 100
[r1-bgp-default]add ipv4 un
[r1-bgp-default-ipv4]netw 192.168.0.0 24
[r1-bgp-default-ipv4]netw 192.168.1.0 24
10,通过配置团体属性,使 192.168.0.0/24 网段路由只能传递至 AS 200
R1
[r1]acl ba 2000
[r1-acl-ipv4-basic-2000]rule per so 192.168.0.0 0.0.0.255
[r1-acl-ipv4-basic-2000]route-po han per node 10
[r1-route-policy-han-10]if-match ip add acl 2000
[r1-route-policy-han-10]app community no-export
[r1-route-policy-han-10]route-po han per node 20
[r1-route-policy-han-20]q
[r1]bgp 100
[r1-bgp-default]add ipv4 un
[r1-bgp-default-ipv4]pe 100.1.1.2 route-po han ex
[r1-bgp-default-ipv4]pe 100.1.1.2 advertise-community
R2
[r2]bgp 65001
[r2-bgp-default]add ipv4 un
[r2-bgp-default-ipv4]pe 100.2.2.4 advertise-community
11,效果查看BGP AS200区域中即存在192.168.0.0的网段,也存在192.168.1.0的网段,而不同区域AS300只有一条192.168.1.0的网段
R2-R4

R6

696

被折叠的 条评论
为什么被折叠?



