配置BGP联盟
如下图所示,AS 2中有多台路由器,配置BGP联盟使得BGP全互联;
配置接口IP地址:
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip address 12.1.1.1 24
配置类似,不做阐述;
配置BGP:
[r1]bgp 1
[r1-bgp]router-id 1.1.1.1
[r1-bgp]peer 12.1.1.2 as-number 2
[r1-bgp]ipv4-family unicast
[r1-bgp-af-ipv4]network 1.1.1.0 255.255.255.0
[r2]bgp 65001
[r2-bgp]router-id 2.2.2.2
[r2-bgp]confederation id 2
[r2-bgp]confederation peer-as 65002
[r2-bgp]peer 23.1.1.2 as-number 65002
[r2-bgp]ipv6-family unicast
[r2-bgp-af-ipv4]peer 23.1.1.2 next-hop-local
[r3]bgp 65002
[r3-bgp]router-id 3.3.3.3
[r3-bgp]confederation id 2
[r3-bgp]confederation peer-as 65001
[r3-bgp]peer 23.1.1.1 as-number 65001
[r3-bgp]peer 34.1.1.2 as-number 65002
[r4]bgp 65002
[r4-bgp]router-id 4.4.4.4
[r4-bgp]confederation id 2
[r4-bgp]peer 34.1.1.1 as-number 65002
查看配置结果:
[r3]display bgp routing-table 1.1.1.1
BGP local router ID : 3.3.3.3
Local AS number : 65002
Paths: 1 available, 1 best, 1 select
BGP routing table entry information of 1.1.1.0/24:
From: 23.1.1.1 (2.2.2.2)
Route Duration: 00h01m19s
Relay IP Nexthop: 0.0.0.0
Relay IP Out-Interface: GigabitEthernet0/0/1
Original nexthop: 23.1.1.1
Qos information : 0x0
<font color=red> **AS-path (65001) 1**</font>, origin igp, MED 0, localpref 100, pref-val 0, valid, <font color=red>**external-confed**</font>, best, select, active, pre 255
Advertised to such 1 peers:
34.1.1.2
[r4]display bgp routing-table 1.1.1.1
BGP local router ID : 4.4.4.4
Local AS number : 65002
Paths: 1 available, 0 best, 0 select
BGP routing table entry information of 1.1.1.0/24:
From: 34.1.1.1 (3.3.3.3)
Route Duration: 00h00m59s
Relay IP Nexthop: 0.0.0.0
Relay IP Out-Interface:
Original nexthop: 23.1.1.1
Qos information : 0x0
<font color=red> **AS-path (65001) 1**</font>, origin igp, MED 0, localpref 100, pref-val 0, <font color=red>**internal-confed**</font>, pre 255
Not advertised to any peer yet