我现在有两台路由器,他们将用数据中心提供的私有AS号码来提供服务器的networking。
我想要做的是为networking上的服务器提供一个VRRP故障转移默认路由,并且确保路由出站和入站将始终优先通过一条path,并且只有当主优先pathclosures时才采用另一条path。 即MASTER / BACKUP设置。
我已经整理了VRRP的东西。 但是我对BGP的了解是非常基本的。
让我画一些ascii艺术的拓扑,使其更清晰一点。
ISPA (AS 1) ISPB (AS 1) | | | | R1 --- P2P (ethernet) --- R2 (AS65007) | | +------- LAN (ipoib) -----+
ISP A&B路由器是同一数据中心的远程路由器。 让我们假设他们有AS 1.而且我有一个私人AS是65007
现在让我们再说一遍。 我希望AS 1的stream量始终通过R1到达我,而不是R2,除非到ISP A的R1path处于脱机状态。
假设ISPA和R1的IP分别为10.1.1.1/30和10.1.1.2/30。 假设ISPB和R2的IP分别为10.1.1.5/30和10.1.1.6/30。
还假设我想要宣传的networking范围是192.168.1.0/25。
我目前的configuration没有偏见的路由工作,看起来像这样:
对于R1(R2几乎相同)。
ip prefix-list Net:Out seq 5 permit 192.168.1.0/25 router bgp 65007 bgp router-id 10.1.1.2 redistribute connected route-map Redist:BGP neighbor 10.1.1.1 remote-as 558 neighbor 10.1.1.1 description Net neighbor 10.1.1.1 soft-reconfiguration inbound neighbor 10.1.1.1 prefix-list Net:Out out route-map Redist:BGP permit 10 match ip address prefix-list Net:Out
**这也有问题,因为R1不知道它能达到10.1.1.6的R2。 没有IBGP。 我如何解决上述问题? **
我被告知可以通过多种方式来偏倚数据。 从我的NOC我告诉我可以使用localpref和prepend我的自动备份路由器上。
如果我理解这个权利,那么看起来像下面这样。 R1configuration将保持不变。 这是否是对于quagga正确的语法,并且这工作?
ip prefix-list Net:Out seq 5 permit 192.168.1.0/25 router bgp 65007 bgp router-id 10.1.1.6 redistribute connected route-map Redist:BGP neighbor 10.1.1.5 remote-as 558 neighbor 10.1.1.5 route-map Net:In in neighbor 10.1.1.5 description Net neighbor 10.1.1.5 soft-reconfiguration inbound neighbor 10.1.1.5 prefix-list Net:Out out route-map Redist:BGP permit 10 match ip address prefix-list Net:Out set as-path prepend 65007 65007 route-map Net:In set local-preference 10
但是,当我向在networking领域工作的熟人描述我的问题时,他告诉我,数据仍然有可能通过R2方面从ISP那里下来,并描述了另一种方式来做到这一点。 他说,如果ISP能接受,我也可以使用MED。 或者,因为两条线都来自同一个ISP,所以他说我的路由是非常确定的,并且总是select最专业的path。 所以他在我的主R1路由器上build议我改为宣传两个networking。 即二/二十六。 这是正确的,它会工作。 我应该结合这两种方法吗?
ip prefix-list Net:Out seq 5 permit 192.168.1.0/26 ip prefix-list Net:Out seq 10 permit 192.168.1.64/26 router bgp 65007 bgp router-id 10.1.1.2 redistribute connected route-map Redist:BGP neighbor 10.1.1.1 remote-as 558 neighbor 10.1.1.1 route-map in Net:In neighbor 10.1.1.1 description Net neighbor 10.1.1.1 soft-reconfiguration inbound neighbor 10.1.1.1 prefix-list Net:Out out route-map Redist:BGP permit 10 match ip address prefix-list Net:Out
那么,BGP专家会给我什么build议呢?在做出必要的修改之后,我怎么确定它实际上是在工作。
更新:直接上面的子网方法不起作用。 我想我的提供者是拒绝任何小于25的东西。当我在一台路由器上尝试时确认。 显示ip bgp根本没有传播路线。 也许我可以使用MED? 那会比第一种方法更好吗?
有几种方法可以完成你想要的function,是的,将你自己的AS添加到你向ISP公布的路由(前缀)中,同时设置一个LOCAL_PREF给你将在内部重新发布的LOCAL_PREF是个好主意。
基本上,你需要:
对于第1点,MED,AS预先定义,社区等是可能的度量(即BGP属性)调整,但是从远程侧无需修改就可以工作的是AS预先最有可能的(例如,MED可能需要语句像ISP路由器中的“bgp always-compare-med”可能取决于它们的configuration)。
对于第二点,可以使用LOCAL_PREF和WEIGHT(在这种情况下还有我们不关心的社区和其他技术)。 重量是思科专有的(但Quagga使用它),也不包括在BGP更新(本地重要),所以我会去LOCAL_PREF(与iBGP的工作,但你还没有)。
话虽如此,为了达到netdc.com如你所愿,一个select是:
# # R1 # router bgp 65007 bgp router-id 10.1.1.2 network 192.168.1.0/25 neighbor 10.1.1.1 remote-as 558 neighbor 10.1.1.1 description Net neighbor 10.1.1.1 soft-reconfiguration inbound neighbor 10.1.1.1 route-map Net:In in neighbor 10.1.1.1 route-map Net:Out out neighbor iBGP_peers peer-group neighbor iBGP_peers remote-as 65007 neighbor iBGP_peers password $whatyouwant neighbor iBGP_peers update-source $IP #The interface in the common subnet 192.168.1.0/25, otherwise you need an internal routing protocol (IGP) also neighbor iBGP_peers next-hop-self # Otherwise you need to advertise the p2p network between you and ISP neighbor $IP_R2_in_192.168.1.0 peer-group iBGP_peers neighbor $IP_R2_in_192.168.1.0 description R2 ip prefix-list local-allocations seq 10 permit 192.168.1.0/25 route-map Net:In description allow everything route-map Net:Out description announce allocated routes sourced from our AS only (avoid to become a transit AS) match ip address prefix-list local-allocations # # R2 # router bgp 65007 bgp router-id 10.1.1.6 network 192.168.1.0/25 neighbor 10.1.1.5 remote-as 558 neighbor 10.1.1.5 description Net neighbor 10.1.1.5 soft-reconfiguration inbound neighbor 10.1.1.5 route-map Net:In_backup in neighbor 10.1.1.5 route-map Net:Out_backup out neighbor iBGP_peers peer-group neighbor iBGP_peers remote-as 65007 neighbor iBGP_peers password $whatyouwant neighbor iBGP_peers update-source $IP #The interface in the common subnet 192.168.1.0/25, otherwise you need an internal routing protocol (IGP) also neighbor iBGP_peers next-hop-self # Otherwise you need to advertise the p2p network between you and ISP neighbor $IP_R1_in_192.168.1.0 peer-group iBGP_peers neighbor $IP_R1_in_192.168.1.0 description R1 ip prefix-list local-allocations seq 10 permit 192.168.1.0/25 route-map Net:In_backup description iBGP will de-prefer all the prefixes set local-preference 10 route-map Net:Out_backup description announce allocated routes sourced from our AS only match ip address prefix-list local-allocations set as-path prepend 65007 65007 65007
在旁注中,如果可以避免,重新分配是不好的。 使用“networking”命令来宣传您的前缀(在Quagga中,您不需要与RIB相反的RIB中的子网,甚至更好)。