Correct way to advertise network in BIRD 2.x
Hi, I am unfortunatley finding the docs a little terse in terms of lack of real-life examples. I have a simple question, how do I advertise networks to my peers ? I am guessing the syntax below is not correct because I see error messages such as "Apr 27 11:08:53 vpw bird: KRT: Received route 192.0.2.224/28 with strange next-hop 198.51.100.33" in my logs. 2a01:db8:a1d:1e11::1111 / 198.51.100.33 is the IP of the interface facing the upstream BGP peer. protocol static { ipv4; route 192.0.2.224/28 via 198.51.100.33; } protocol static { ipv6; route 2a01:db8:6a66::/48 via 2a01:db8:a1d:1e11::1111; } filter out_filter { if net ~ 2a01:db8:6a66::/48 then accept; if net ~ 192.0.2.224/28 then accept; else reject; } protocol bgp v4n1 { local as 65200; source address 198.51.100.33; neighbor 198.51.100.250 as 64515; med metric on; default bgp_med 0; ipv4 { import all; export filter out_filter; graceful restart on; }; } protocol bgp v6n1 { local as 65200; source address 2a01:db8:a1d:1e11::1111; neighbor 2a01:db8:a1d:1e11::2222 as 64515; med metric on; default bgp_med 0; ipv6 { import all; export filter out_filter; graceful restart on; }; }
Just use something like: protocol static { ipv4; route 192.168.1.0/24 unreachable; } You don't really need a valid next-hop if you are only importing static routes to eBGP since eBGP will overwrite next-hop to yourself. On Mon, Apr 27, 2020, at 10:15, Laura Smith wrote:
Hi,
I am unfortunatley finding the docs a little terse in terms of lack of real-life examples.
I have a simple question, how do I advertise networks to my peers ? I am guessing the syntax below is not correct because I see error messages such as
"Apr 27 11:08:53 vpw bird: KRT: Received route 192.0.2.224/28 with strange next-hop 198.51.100.33" in my logs.
2a01:db8:a1d:1e11::1111 / 198.51.100.33 is the IP of the interface facing the upstream BGP peer.
protocol static { ipv4; route 192.0.2.224/28 via 198.51.100.33; }
protocol static { ipv6; route 2a01:db8:6a66::/48 via 2a01:db8:a1d:1e11::1111; }
filter out_filter { if net ~ 2a01:db8:6a66::/48 then accept; if net ~ 192.0.2.224/28 then accept; else reject; }
protocol bgp v4n1 { local as 65200; source address 198.51.100.33; neighbor 198.51.100.250 as 64515; med metric on; default bgp_med 0; ipv4 { import all; export filter out_filter; graceful restart on; }; }
protocol bgp v6n1 { local as 65200; source address 2a01:db8:a1d:1e11::1111; neighbor 2a01:db8:a1d:1e11::2222 as 64515; med metric on; default bgp_med 0; ipv6 { import all; export filter out_filter; graceful restart on; }; }
Thanks James. Will try that. ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Monday, 27 April 2020 11:25, James Swineson <bird-users@public.swineson.me> wrote:
Just use something like:
protocol static { ipv4; route 192.168.1.0/24 unreachable; }
You don't really need a valid next-hop if you are only importing static routes to eBGP since eBGP will overwrite next-hop to yourself.
On Mon, Apr 27, 2020, at 10:15, Laura Smith wrote:
Hi, I am unfortunatley finding the docs a little terse in terms of lack of real-life examples. I have a simple question, how do I advertise networks to my peers ? I am guessing the syntax below is not correct because I see error messages such as "Apr 27 11:08:53 vpw bird: KRT: Received route 192.0.2.224/28 with strange next-hop 198.51.100.33" in my logs. 2a01:db8:a1d:1e11::1111 / 198.51.100.33 is the IP of the interface facing the upstream BGP peer. protocol static { ipv4; route 192.0.2.224/28 via 198.51.100.33; } protocol static { ipv6; route 2a01:db8:6a66::/48 via 2a01:db8:a1d:1e11::1111; } filter out_filter { if net ~ 2a01:db8:6a66::/48 then accept; if net ~ 192.0.2.224/28 then accept; else reject; } protocol bgp v4n1 { local as 65200; source address 198.51.100.33; neighbor 198.51.100.250 as 64515; med metric on; default bgp_med 0; ipv4 { import all; export filter out_filter; graceful restart on; }; } protocol bgp v6n1 { local as 65200; source address 2a01:db8:a1d:1e11::1111; neighbor 2a01:db8:a1d:1e11::2222 as 64515; med metric on; default bgp_med 0; ipv6 { import all; export filter out_filter; graceful restart on; }; }
On Mon, Apr 27, 2020 at 10:25:44AM +0000, James Swineson wrote:
Just use something like:
protocol static { ipv4; route 192.168.1.0/24 unreachable; }
You don't really need a valid next-hop if you are only importing static routes to eBGP since eBGP will overwrite next-hop to yourself.
Yes, this is the best way. Not only you do not need a valid next hop for EBGP routes, but also having unreachable route for your whole prefix is useful if you have say OSPF routes for its subnets that do not fully cover it, and a default route to upstream. Having unreachable route ensures that a packet from the upstream to a non-assigned IP would not loop between the router and the upstream. -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
participants (3)
-
James Swineson -
Laura Smith -
Ondrej Zajicek