EBGP的基本配置

简介: 文章目录系列文章实验拓扑实验要求IP地址表实验配置配置R1配置R2配置R3配置R4接下来实验总结

实验拓扑


实验要求

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

IP地址表

路由器 接口 IP地址
R1 f0/0 192.168.1.1
R2 f1/0 192.168.1.2
R2 f0/0 192.168.2.1
R3 f1/0 192.168.2.2
R3 f0/0 192.168.3.1
R4 f1/0 192.168.3.2
R1 loopback0 1.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协议路由条目。

R3:
R3#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
R4:
R4#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中需要配置多跳命令。

目录
相关文章
|
2天前
|
存储 算法 Linux
VDO卷的配置
在CentOS 7环境下,VDO通过重删和压缩技术节省磁盘空间,使1T磁盘可存储1.5T数据,降低成本。创建VDO步骤包括:添加64GB新硬盘,安装vdo和kmod-kvdo软件,使用`vdo create`命令创建VDO卷,如`vdo create --name=myvdo --device=/dev/sdb --vdoLogicalSize=200G`。之后,可通过`vdo list`、`vdo status`和`vdostats`检查状态和空间使用。最后,格式化VDO卷,创建挂载点并挂载,完成设置。
15 0
|
2天前
|
Ubuntu 安全 算法
UbuntuSSH配置
UbuntuSSH配置
45 0
|
NoSQL Java Redis
springbootAsyncConfig配置的处理
springbootAsyncConfig配置的处理
271 0
springbootAsyncConfig配置的处理
|
安全 Shell 网络安全
安全配置
一、 密码配置1、 全局明文密码:控制路由器从用户模式登录到特权模式的密码,显示为明文。Router (confi g)#enable password yujieRouter (config)#Router>enablePassword:明文密码加密:输入明文密码后,通过该命令将密码加密。Router (config)#service password-encryptionRouter(config)#2、 全局密文密码:控制路由器从用户模式登录到特权模式的密码,显示为密文。Router(config)#enable secret cntc-edu.comRoute(通过设置可使用用户在本地
安全配置
|
运维
一个配置引发的血案
一个配置引发的血案一个配置引发的血案,记一次线上事故的复盘。 一天晚上的业务高峰期,出现了超时(数据加载不出来的情况)。 联想到前一天有发版的工作,第一功能上并没有太大的调整,此次发版内容更多的是新增的功能,用户使用量也较少,基本可以排除因功能导致的问题;第二是否中间件出现问题,因数据的交互,有80%是和redis交互,从慢日志查询中未发现有异常情况;第三隐约有人说过用于负载的服务,昨天发版关闭掉了一台。
1270 0
|
Ubuntu Java Linux