2014-08-13 BGP联盟实验(华为模拟器)

更新时间:2023-11-09 17:58:01 阅读量: 教育文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

BGP联盟实验

实验要求:

各AS之间相互建立EBGP邻居,并将自己Loopback 1接口宣告进BGP,AS 100内的IGP使用RIP协议实现互通,其他AS之间使用静态实现Loopback之间的互访。

R1的配置: bgp 100

peer 2.2.2.2 as-number 100

peer 2.2.2.2 connect-interface LoopBack0 peer 3.3.3.3 as-number 300 peer 3.3.3.3 ebgp-max-hop 255

peer 3.3.3.3 connect-interface LoopBack0 network 11.11.11.11 255.255.255.255 # rip 1

undo summary version 2

network 12.0.0.0 network 1.0.0.0 #

ip route-static 3.3.3.3 255.255.255.255 13.0.0.3

R2的配置: bgp 100

peer 1.1.1.1 as-number 100

peer 1.1.1.1 connect-interface LoopBack0 peer 4.4.4.4 as-number 400 peer 4.4.4.4 ebgp-max-hop 255

peer 4.4.4.4 connect-interface LoopBack0 network 22.22.22.22 255.255.255.255 # rip 1

undo summary version 2

network 12.0.0.0 network 2.0.0.0 #

ip route-static 4.4.4.4 255.255.255.255 24.0.0.4

R3的配置: bgp 300

peer 1.1.1.1 as-number 100 peer 1.1.1.1 ebgp-max-hop 255

peer 1.1.1.1 connect-interface LoopBack0 peer 5.5.5.5 as-number 500 peer 5.5.5.5 ebgp-max-hop 255

peer 5.5.5.5 connect-interface LoopBack0 network 33.33.33.33 255.255.255.255 #

ip route-static 1.1.1.1 255.255.255.255 13.0.0.1 ip route-static 5.5.5.5 255.255.255.255 35.0.0.5

R4的配置: bgp 400

peer 2.2.2.2 as-number 100 peer 2.2.2.2 ebgp-max-hop 255

peer 2.2.2.2 connect-interface LoopBack0 peer 6.6.6.6 as-number 600 peer 6.6.6.6 ebgp-max-hop 255

peer 6.6.6.6 connect-interface LoopBack0 network 44.44.44.44 255.255.255.255 #

ip route-static 2.2.2.2 255.255.255.255 24.0.0.2 ip route-static 6.6.6.6 255.255.255.255 46.0.0.6

R5的配置: bgp 500

peer 3.3.3.3 as-number 300 peer 3.3.3.3 ebgp-max-hop 255

peer 3.3.3.3 connect-interface LoopBack0 peer 6.6.6.6 as-number 600 peer 6.6.6.6 ebgp-max-hop 255

peer 6.6.6.6 connect-interface LoopBack0 network 55.55.55.55 255.255.255.255 #

ip route-static 3.3.3.3 255.255.255.255 35.0.0.3 ip route-static 6.6.6.6 255.255.255.255 56.0.0.6

R6的配置: bgp 600

peer 4.4.4.4 as-number 400 peer 4.4.4.4 ebgp-max-hop 255

peer 4.4.4.4 connect-interface LoopBack0 peer 5.5.5.5 as-number 500 peer 5.5.5.5 ebgp-max-hop 255

peer 5.5.5.5 connect-interface LoopBack0 network 66.66.66.66 255.255.255.255 #

ip route-static 4.4.4.4 255.255.255.255 46.0.0.4 ip route-static 5.5.5.5 255.255.255.255 56.0.0.5

现在查看R1的BGP路由表: [R1]dis bgp routing-table

BGP Local router ID is 12.0.0.1

Status codes: * - valid, > - best, d - damped,

h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete

Total Number of Routes: 10

Network NextHop MED LocPrf PrefVal Path/Ogn

*> 11.11.11.11/32 0.0.0.0 0 0 i *>i 22.22.22.22/32 2.2.2.2 0 100 0 i *> 33.33.33.33/32 3.3.3.3 0 0 300i

i 4.4.4.4 100 0 400 600 500300i *> 44.44.44.44/32 3.3.3.3 0 300 500 600400i i 4.4.4.4 0 100 0 400i *> 55.55.55.55/32 3.3.3.3 0 300 500i i 4.4.4.4 100 0 400 600 500i *> 66.66.66.66/32 3.3.3.3 0 300 500 600i i 4.4.4.4 100 0 400 600i

R1上学到了所有的路由条目。

现在使AS 100和AS 300称为一个联盟,对外宣称自己的AS号为1000. R1的配置: [R1]bgp 100

[R1-bgp]confederation id 1000 //指定联盟的AS号为1000

[R1-bgp]confederation peer-as 300

Error: Confederation sub-AS 300 is the same as the number of an exisiting sub-AS,please delete the existing sub-AS first.

//配置联盟的对等体出现错误,因为配置联盟需要先指定联盟的对等体,在指定BGP的对等体,否则,联盟会认为对等体是联盟外部对等体而报错 [R1-bgp]undo peer 3.3.3.3 //删除BGP的邻居

[R1-bgp]confederation peer-as 300 //重新配置联盟对等体

[R1-bgp]peer 3.3.3.3 as-number 300

[R1-bgp]peer 3.3.3.3 connect-interface LoopBack 0 [R1-bgp]peer 3.3.3.3 ebgp-max-hop

R2的配置: [R2]bgp 100

[R2-bgp]confederation id 1000

//因为R2和R1都在AS 100内,所以R2只配置联盟ID就可以。

R3的配置: [R3]bgp 300

[R3-bgp]confederation id 1000 [R3-bgp]confederation peer-as 100

[R3-bgp]peer 1.1.1.1 as-number 100

[R3-bgp]peer 1.1.1.1 connect-interface LoopBack 0 [R3-bgp]peer 1.1.1.1 ebgp-max-hop

在R1、R2和R3上查看那BGP邻居表: [R1]dis bgp peer

BGP local router ID : 12.0.0.1 Local AS number : 100

Total number of peers : 2 Peers in established state : 2

Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv

2.2.2.2 4 100 5 6 0 00:02:05 Established 1 3.3.3.3 4 300 14 18 0 00:11:23 Established 1

[R2-bgp]dis bgp peer

BGP local router ID : 12.0.0.2 Local AS number : 100

Total number of peers : 2 Peers in established state : 1

Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv

1.1.1.1 4 100 6 6 0 00:02:16 Established 2 4.4.4.4 4 400 0 0 0 00:00:07 Idle 0

[R3-bgp]dis bgp peer

BGP local router ID : 13.0.0.3 Local AS number : 300

Total number of peers : 2 Peers in established state : 1

Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pref Rcv

1.1.1.1 4 100 17 16 0 00:11:41 Established 2 5.5.5.5 4 500 0 0 0 00:00:19 Idle 0

可以看出,R1和R2、R1和R3都建立了BGP邻居关系,但是R2和R4的BGP邻居,R3和R5的BGP邻居都没有建立起来。

原因:R2和R3都向外通告的是联盟的ID 1000,而R2和R4的BGP邻居建立时指的是AS 100,R3和R5的BGP邻居建立时指的是AS 300,因此邻居关系建立不起来。

修改命令: R4上的配置: [R4]bgp 400

[R4-bgp]undo pee 2.2.2.2

[R4-bgp]peer 2.2.2.2 as-number 1000

[R4-bgp]peer 2.2.2.2 connect-interface LoopBack 0 [R4-bgp]peer 2.2.2.2 ebgp-max-hop

R5的配置: [R5]bgp 500

[R5-bgp]undo pee 3.3.3.3

[R5-bgp]peer 3.3.3.3 as-number 1000

[R5-bgp]peer 3.3.3.3 connect-interface LoopBack 0 [R5-bgp]peer 3.3.3.3 ebgp-max-hop

再次,查看R2和R3的BGP邻居表: [R2-bgp]dis bgp peer

BGP local router ID : 12.0.0.2 Local AS number : 100

Total number of peers : 2 Peers in established state : 2

Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pref Rcv

1.1.1.1 4 100 17 20 0 00:13:31 Established 2 4.4.4.4 4 400 11 9 0 00:03:02 Established 3

[R3-bgp]dis bgp peer

BGP local router ID : 13.0.0.3 Local AS number : 300

Total number of peers : 2 Peers in established state : 2

Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pref Rcv

1.1.1.1 4 100 29 31 0 00:23:40 Established 2 5.5.5.5 4 500 11 9 0 00:03:14 Established 3

邻居关系已经建立,在查看R4和R5的BGP邻居表: [R4-bgp]dis bgp peer

BGP local router ID : 24.0.0.4 Local AS number : 400

Total number of peers : 2 Peers in established state : 2

Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pref Rcv

2.2.2.2 4 1000 9 13 0 00:05:40 Established 2 6.6.6.6 4 600 178 183 0 02:38:04 Established 3

[R5-bgp]dis bgp peer

BGP local router ID : 56.0.0.5 Local AS number : 500

Total number of peers : 2 Peers in established state : 2

Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pref Rcv

3.3.3.3 4 1000 9 13 0 00:05:43 Established 2 6.6.6.6 4 600 93 98 0 01:19:08 Established 4

表明R2和R3向外宣告的AS为联盟的ID,并不是自己所在的AS号了。

未完待续…………

本文来源:https://www.bwwdw.com/article/76cv.html

Top