I have two routers that I'm setting up currently and they will be feeding my network of servers with a private AS number provided by the datacentre.
What I want to do is provide both a VRRP failover default route for servers on the network, and also ensure that routing out and inbound will always be preferred via one path and only take the other path if and only if the primary preferred path is down. i.e. a MASTER/BACKUP setup.
I have the VRRP stuff sorted out already. But my knowledge of BGP is very basic.
Let me draw some ascii art of the topology to make it a bit clearer.
ISPA (AS 1) ISPB (AS 1) | | | | R1 --- P2P (ethernet) --- R2 (AS65007) | | +------- LAN (ipoib) -----+
The ISP A & B routers are the remote routers at the same datacentre. Lets assume they have AS 1. And also I have a private AS which is 65007
Now lets state it again. I want traffic from AS 1 to always reach me via R1 and never R2 unless the R1 path to ISP A is offline.
Lets assume ISPA and R1 have IP's 10.1.1.1/30 & 10.1.1.2/30 respectively. And assume ISPB and R2 have IP's 10.1.1.5/30 & 10.1.1.6/30 respectively.
Also assume the network range I want to advertise is 192.168.1.0/25.
My current config with no biased routing currently works and looks like this:
For R1 (R2 being almost the same).
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
** Which also has a problem because R1 doesn't know that it can reach R2 at 10.1.1.6. There is no IBGP. How do I fix that in the above? **
I'm told I can bias the data in several ways. From my NOC I'm told I can use localpref and prepend my AS on the backup router.
If I understood this right it would look something like the following. Where R1 config would remain the same. Is this the correct syntax for quagga and would this work?
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
However, when I described my problem to an acquaintance who works in the networking field, he told me that there is still a good chance that data will still come down through R2 side from the ISP and described another way to do it. He said I could also use MED if the ISP will accept it. Or alternatively, because both lines come from the same ISP he said to me that routing is very deterministic and will always select the most specialized path. So he suggested on my primary R1 router I instead advertised two networks. i.e. two /26's. Is this correct and would it work. Should I perhaps combine both methods?
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
So what would you BGP experts suggest to me, and how do I determine after making the necessary changes that it is in fact working.
Update: The subnet method directly above didn't work. I guess my provider is rejecting anything smaller than a 25. Confirmed when I tried it on one router. show ip bgp didn't propagate the route at all. Perhaps I can use MED? would that be any better than the first method?