[FROG] BGP over GRE interfaces
Daniel Corbe
daniel at corbe.net
Wed Jan 1 19:59:12 EST 2020
Hello All,
My apologies for the incoming wall of text.
I'm having an issue with bgpd over a GRE interface. BGP keeps
flapping and I suspect it's because the GRE tunnel actually goes down
once BGP comes up. Realizing this may be an issue with what's
actually being announced, I added host routes to the kernel table for
the tunnel endpoints; however that didn't make much of a difference.
My setup right now kind of relies on Linux doing the right thing and
preferring the longest prefix match to route traffic but I don't think
that's what's happening in my case so I'm looking for suggestions on
how to proceed.
My other, sort of related question, is why does FRR's BGP advertise
routes it learns back to the peer it learned them from? Is there a
way to stop that behavior?
My local endpoint (hostname alpine) is configured like this:
auto gre1
iface gre1 inet manual
pre-up ip tunnel add gre1 mode gre remote 193.160.88.2 local
73.57.99.182 ttl 255
pre-up ip route add 193.160.88.2/32 via $(ip -4 route list
default | awk '{print $3}')
pre-up ip addr add 10.64.14.2/24 dev gre1
pre-up ip link set gre1 up
post-down ip route del 193.160.88.2/32
post-down ip tunnel del gre1
alpine# show run
Building configuration...
Current configuration:
!
frr version 7.2
frr defaults traditional
hostname alpine
!
router bgp 65001
neighbor core peer-group
neighbor core remote-as 57335
neighbor core bfd
neighbor 10.64.14.1 peer-group core
!
address-family ipv4 unicast
redistribute connected
exit-address-family
!
line vty
!
bfd
peer 10.64.14.1
no shutdown
!
!
end
The remote side (hostname melbidedi1-vrf) is configured like this:
auto gre1
iface gre1 inet manual
pre-up ip tunnel add gre1 mode gre local 193.160.88.2 remote
73.57.99.182 ttl 255
pre-up ip route add 73.57.99.182/32 via $(ip -4 route list
default | awk '{print $3}')
pre-up ip addr add 10.64.14.1/24 dev gre1
pre-up ip link set gre1 up
post-down ip route del 73.57.99.182/32
post-down ip tunnel del gre1
melbidedi1-vrf# show run
Building configuration...
Current configuration:
!
frr version 7.2
frr defaults traditional
hostname melbidedi1
hostname melbidedi1-vrf
!
router bgp 57335
neighbor corbe peer-group
neighbor corbe remote-as 65001
neighbor corbe bfd
neighbor core peer-group
neighbor core remote-as 57335
neighbor 10.64.14.2 peer-group corbe
neighbor 193.160.88.1 peer-group core
!
address-family ipv4 unicast
redistribute connected
neighbor core next-hop-self
exit-address-family
!
ip prefix-list AS57335-V4 seq 10 permit 184.203.204.0/22 le 24
ip prefix-list AS57335-V4 seq 15 permit 193.160.88.0/22 le 24
ip prefix-list AS57335-V4 seq 20 permit 45.154.216.0/22 le 24
ip prefix-list AS57335-V4 seq 5 permit 45.132.96.0/22 le 24
ip prefix-list DEFAULT-V4 seq 5 permit 0.0.0.0/0
ip prefix-list INTERNET-V4 seq 5 permit 0.0.0.0/0 le 24
!
line vty
!
bfd
peer 10.64.14.2
no shutdown
!
!
end
alpine routing table (as you can see the more specific route is in the
kernel routing table):
alpine# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
F - PBR, f - OpenFabric,
> - selected route, * - FIB route, q - queued route, r - rejected route
K>* 0.0.0.0/0 [0/203] via 73.57.98.1, eth1, src 73.57.99.182, 00:53:51
C>* 10.0.0.0/24 is directly connected, eth2, 00:53:51
C>* 10.64.14.0/24 is directly connected, gre1, 00:29:15
K * 73.57.98.0/23 [0/203] is directly connected, eth1, 00:53:51
C>* 73.57.98.0/23 is directly connected, eth1, 00:53:51
K * 169.254.0.0/16 [0/204] is directly connected, eth2, 00:53:50
C>* 169.254.0.0/16 is directly connected, eth2, 00:53:50
When the tunnel is up, these are the routes being advertised:
alpine# show ip bgp neighbors 10.64.14.1 advertised-routes
BGP table version is 4151, local router ID is 73.57.99.182, vrf id 0
Default local pref 100, local AS 65001
Status codes: s suppressed, d damped, h history, * valid, > best, = multipath,
i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 10.0.0.0/24 0.0.0.0 0 32768 ?
*> 10.64.14.0/24 0.0.0.0 0 32768 ?
*> 73.57.98.0/23 0.0.0.0 0 32768 ?
*> 172.16.1.0/24 10.64.14.1 0 57335 ?
*> 193.160.88.0/22 10.64.14.1 0 57335 ?
*> 193.160.88.0/24 10.64.14.1 0 57335 ?
*> 213.183.46.232/29
10.64.14.1 0 57335 ?
Routing table on melbidedi1-vrtf:
melbidedi1-vrf# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
F - PBR, f - OpenFabric,
> - selected route, * - FIB route, q - queued route, r - rejected route
K>* 0.0.0.0/0 [0/0] via 193.160.88.1, eth0, 1d10h18m
B>* 10.0.0.0/24 [20/0] via 10.64.14.2, gre1, 00:00:00
C>* 10.64.14.0/24 is directly connected, gre1, 00:23:32
B>* 73.57.98.0/23 [20/0] via 10.64.14.2, gre1, 00:00:00
K>* 73.57.99.182/32 [0/0] via 193.160.88.1, eth0, 00:23:32
C>* 172.16.1.0/24 is directly connected, eth1, 1d10h18m
B>* 193.160.88.0/22 [200/0] via 193.160.88.1, eth0, 15:56:10
C>* 193.160.88.0/24 is directly connected, eth0, 1d10h18m
B>* 213.183.46.232/29 [200/0] via 193.160.88.1, eth0, 15:56:10
melbidedi1-vrf# show ip bgp neighbors 10.64.14.2 advertised-routes
BGP table version is 1146, local router ID is 193.160.88.2, vrf id 0
Default local pref 100, local AS 57335
Status codes: s suppressed, d damped, h history, * valid, > best, = multipath,
i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 10.0.0.0/24 10.64.14.2 0 65001 ?
*> 10.64.14.0/24 0.0.0.0 0 32768 ?
*> 73.57.98.0/23 10.64.14.2 0 65001 ?
*> 172.16.1.0/24 0.0.0.0 0 32768 ?
*> 193.160.88.0/22 0.0.0.0 100 0 ?
*> 193.160.88.0/24 0.0.0.0 0 32768 ?
*> 213.183.46.232/29
0.0.0.0 100 0 ?
Total number of prefixes 7
More information about the frog
mailing list