BGP 边界网关协议

网络拓扑图:

配置代码:

R1:
enable
conf t
host r1
no ip domain-lookup
int g0/0
ip address 192.168.2.1 255.255.255.0
no shut
int g0/1
ip address 192.168.1.1 255.255.255.0
no shut
exit
router bgp 1
!1为自治系统号
neighbor 192.168.2.2 remote-as 2
!2为邻居自治系统号
neighbor 192.168.1.2 remote-as 4
network 192.168.1.0 mask 255.255.255.0
network 192.168.2.0 mask 255.255.255.0
bgp router-id 1.1.1.1

R2:
enable
conf t
host r2
no ip domain-lookup
int g0/0
ip address 192.168.2.2 255.255.255.0
no shut
int g0/1
ip address 192.168.3.1 255.255.255.0
no shut
exit
router bgp 2
!2为自治系统号
neighbor 192.168.2.1 remote-as 1
!1为邻居自治系统号
neighbor 192.168.3.2 remote-as 3
network 192.168.2.0 mask 255.255.255.0
network 192.168.3.0 mask 255.255.255.0
bgp router-id 2.2.2.2

R3:
enable
conf t
host r3
no ip domain-lookup
int g0/0
ip address 192.168.3.2 255.255.255.0
no shut
int g0/1
ip address 192.168.4.1 255.255.255.0
no shut
exit
router bgp 3
!3为自治系统号
neighbor 192.168.3.1 remote-as 2
!2为邻居自治系统号
neighbor 192.168.4.2 remote-as 4
network 192.168.3.0 mask 255.255.255.0
network 192.168.4.0 mask 255.255.255.0
bgp router-id 3.3.3.3

R4:
enable
conf t
host r4
no ip domain-lookup
int g0/0
ip address 192.168.4.2 255.255.255.0
no shut
int g0/1
ip address 192.168.1.2 255.255.255.0
no shut
exit
router bgp 4
!4为自治系统号
neighbor 192.168.4.1 remote-as 3
!3为邻居自治系统号
neighbor 192.168.1.1 remote-as 1
network 192.168.4.0 mask 255.255.255.0
network 192.168.1.0 mask 255.255.255.0
bgp router-id 4.4.4.4

配置结果:

路由表:

R1:

R2:

R3:

R4:

R1->R3:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值