神州数码BGP路由协议配置

实验要求:了解BGP路由协议的配置方法及原理

拓扑如下

R1

enable  进入特权模式

config  进入全局模式

hostname R1  修改名称

interface l0  进入端口

ip address 192.168.3.254 255.255.255.0  设置IP地址

interface s0/1  进入端口

ip address 192.168.1.1 255.255.255.0   设置IP地址

physical-layer speed 64000  设置同步时钟

exit  返回上一级

router bgp 200  启动BGP协议

neighbor 192.168.1.2 remote-as 100  指明EBGP邻居

network 192.168.1.0  添加直连网段到BGP

network 192.168.3.0   添加直连网段到BGP

 

R2

enable  进入特权模式

config  进入全局模式

hostname R2  修改名称

interface s0/2  进入端口

ip address 192.168.1.2 255.255.255.0  设置IP地址

physical-layer speed 64000  设置同步时钟

interface s0/1  进入端口

ip address 192.168.2.1 255.255.255.0  设置IP地址

physical-layer speed 64000  设置同步时钟

exit  返回上一级

router bgp 100  启动BGP协议

neighbor 192.168.1.1 remote-as 200  指明EBGP邻居

neighbor 192.168.2.2 remote-as 100  指明IBGP邻居

network 192.168.1.0  添加直连网段到BGP

network 192.168.2.0  添加直连网段到BGP

no synchronization   取消IBGP同步

neighbor 192.168.2.2 next-hop-self  修改发送给IBGP邻居的路由条目,将下一跳改为自己

 

R3

enable  进入特权模式

config  进入全局模式

hostname R3  修改名称

interface s0/2  进入端口

ip address 192.168.2.2 255.255.255.0  设置IP地址

physical-layer speed 64000  设置同步时钟

interface l0  进入端口

ip address 192.168.4.254 255.255.255.0  设置IP地址

exit  返回上一级

router bgp 100  启动BGP协议

neighbor 192.168.2.1 remote-as 100  指明IBGP邻居

network 192.168.2.0  添加直连网段到BGP

network 192.168.4.0  添加直连网段到BGP

no synchronization  取消IBGP同步

 

注意事项:

当ABR收到EBGP邻居发来的条目时,不会修改其条目的下一跳,会直接发送给IBGP邻居,所以需要手动修改下一跳地址

 

相关命令

router bgp [自治系统ID]           启动bgp协议

neighbor [IP地址] remote-as [自治系统ID]   指明邻居和其所在自治系统

no synchronization             关闭同步

原文地址:https://www.cnblogs.com/guoshiyu/p/9324037.html