EBGP的基本配置

在这里插入图片描述

系列文章

内部BGP邻居

外部BGP配置

BGP实战拓扑

BGP基本配置

BGP基本知识

实验拓扑

在这里插入图片描述

实验要求

所有路由器都配置BGP协议使R3和R4能收到R1的环回口地址的路由条目。

IP地址表

路由器接口IP地址
R1f0/0192.168.1.1
R2f1/0192.168.1.2
R2f0/0192.168.2.1
R3f1/0192.168.2.2
R3f0/0192.168.3.1
R4f1/0192.168.3.2
R1loopback01.1.1.1

实验配置

配置R1

R1#configure terminal 
R1(config)#interface f0/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface loopback0
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config-if)#exit
R1(config)#router bgp 100	//配置BGP协议
R1(config-router)#neighbor 192.168.1.2  remote-as 200	//指定EBGP邻居并标明邻居所在的BGP进程
R1(config-router)#neighbor 192.168.1.2 ebgp-multihop 5	//指定EBGP邻居关系可以传递5跳
R1(config-router)#network 1.1.1.0 mask 255.255.255.0	//宣告需要传递的路由条目并指定子网掩码
R1(config-router)#end

配置R2

R2#configure terminal 
R2(config)#interface f1/0
R2(config-if)#ip address 192.168.1.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface f0/0
R2(config-if)#ip address 192.168.2.1 255.255.255.0 
R2(config-if)#no shutdown 
R2(config)#router bgp 200	//配置BGP协议
R2(config-router)#neighbor 192.168.1.1 remote-as 100	//指定EBGP邻居并标明邻居所在的BGP进程
R2(config-router)#neighbor 192.168.1.1 ebgp-multihop 5	//指定EBGP邻居关系可以传递5跳
R2(config-router)#neighbor 192.168.2.2 remote-as 200	//指定IBGP邻居并标明邻居所在的BGP进程
R2(config-router)#neighbor 192.168.2.2 next-hop-self	//通告192.168.2.2地址其下一跳为R2,需要通过R2来和EBGP传递路由条目
R2(config-router)#neighbor 192.168.3.2 next-hop-self 
R2(config-router)#exit       
R2(config)#ip route 192.168.3.2 255.255.255.255 192.168.2.2
R2(config)#router bgp 200
R2(config-router)#neighbor 192.168.3.2 remote-as 200	此处需要直接指定R4的地址,因为IBGP只传递一跳,若指到R3的地址,R4将接收不到路由条目
R2(config-router)#end

配置R3

R3#configure terminal 
R3(config)#interface f1/0
R3(config-if)#ip address 192.168.2.2 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#interface f0/0
R3(config-if)#ip address 192.168.3.1 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#router bgp 200
R3(config-router)#neighbor 192.168.2.1 remote-as 200

配置R4

R4#configure terminal 
R4(config)#interface f1/0
R4(config-if)#ip address 192.168.3.2 255.255.255.0
R4(config-if)#no shutdown
R4(config-if)#exit
R4(config)#ip route 192.168.2.1 255.255.255.255 192.168.3.1 
R4(config)#router bgp 200
R4(config-router)#neighbor 192.168.2.1 remote-as 200
R4(config-router)#end

接下来

通过:show ip route ------+查看路由表,R3、R4会收到来自R1环回口的BGP协议路由条目。

R3R3#show ip route 
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     1.0.0.0/24 is subnetted, 1 subnets
B       1.1.1.0 [200/0] via 192.168.2.1, 00:21:01
C    192.168.2.0/24 is directly connected, FastEthernet1/0
C    192.168.3.0/24 is directly connected, FastEthernet0/0
R4R4#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     1.0.0.0/24 is subnetted, 1 subnets
B       1.1.1.0 [200/0] via 192.168.2.1, 00:05:18
     192.168.2.0/32 is subnetted, 1 subnets
S       192.168.2.1 [1/0] via 192.168.3.1
C    192.168.3.0/24 is directly connected, FastEthernet1/0

实验总结

配置EBGP协议首先需要保证底层互通,通过neighbor命令来传递路由条目并且在EBGP中需要配置多跳命令。
  • 41
    点赞
  • 33
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 27
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 27
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

牧鸯人

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值