首先:
我是新的BGP和鸟互联网路由守护进程。
情况:
ISP1 - R1 - SW1 - R3
|
ISP2 - R2 - SW2 - R4我有一个eBGP实例,用于R1和ISP1,R2和ISP2之间也是如此。另外,我在两个路由器上都有一个iBGP实例,用于R1和R2。
下面是来自R1 for iBGP的示例配置:
protocol bgp bgp1 {
local as 200000;
neighbor 10.0.0.2 as 200000;
multihop 1;
keepalive time 5;
source address 10.0.0.1;
}下面是来自R2 for iBGP的示例配置:
protocol bgp bgp1 {
local as 200000;
neighbor 10.0.0.1 as 200000;
multihop 1;
keepalive time 5;
source address 10.0.0.2;
}此外,在R1和R2之间还有一个保持不变的集群是
R3和R4的默认网关。
现在,如果从R1到ISP1的链接中断了呢?集群不会改变
我没有任何网络连接。
我想让交通流,即使这个happens.My的想法是
R1将整个流量发送给R2,以便R2将其发送到互联网。
我现在的问题是:
( 1)用iBGP和鸟做这件事最好的方法是什么?
( 2)是否有其他更好的机制?
问候
发布于 2015-09-24 14:05:36
我自己找到了答案:
如果要在两个路由器之间创建一个故障转移,请使用
鸟互联网路由守护进程您需要遵循下面的步骤:
下面是一个示例配置:
# example ID, change at R2, e.g. 144.233.0.2
router id 144.233.0.1;
debug protocols all;
# filtering routes
function avoid_martians()
prefix set martians;
{
martians = [ 169.254.0.0/16+, 172.16.0.0/12+, 192.168.0.0/16+, 10.0.0.0/8+, 0.0.0.0/0 ];
# Avoid RFC1918 and similar networks
if net ~ martians then return false;
return true;
}
filter bgp_in {
if ! (avoid_martians())
then reject;
accept;
}
# tell BGP about your routes to your systems
# change to 144.233.0.3 at R2
protocol static {
route 144.233.0.0/22 via 144.233.0.2;
}
protocol kernel {
learn;
scan time 20;
import filter bgp_in;
export all;
}
protocol device {
scan time 10;
}
protocol bgp iBGP_INSTANCE {
local as 500000; # local AS
neighbor 144.233.0.3 as 500000; # iBGP peering to R2, change to 144.233.0.2 at R2
keepalive time 5; # keepalive timer
graceful restart;
import filter bgp_in;
export all;
preference 150; # highest preference "wins", 100 at R2
direct;
gateway direct;
}
protocol bgp eBGP_INSTANCE {
local as 500000;
neighbor 155.0.0.3 as 102; # eBGP peering to ISP1, change at R2
direct;
keepalive time 5;
graceful restart;
import filter bgp_in;
export all;
hold time 10;
preference 150; # highest preference "wins", 100 at R2
}上面的配置创建了两个BGP实例。
一个用于内部BGP (与其他路由器相同)和一个外部BGP (另一个作为其他路由器)。
正如我在配置中评论的那样,具有最高偏好的路由器将是“主路由器”。流量现在通过R1流到ISP1。
但是,如果R1没有从ISP获得任何更新和/或保持活动消息,该怎么办?
答案很简单:
R1没有从ISP1那里得到任何更新。意思是,没有通往目的地的路线。
既然R1和R2已经形成了对等程序(iBGP),R1就会从R2获得更新。
这意味着现在R1必须将从下面发送的所有流量发送给R2,后者将其发送到ISP2。
//编辑:更正的排版
https://networkengineering.stackexchange.com/questions/22326
复制相似问题