No subject
Sat Oct 25 20:44:27 CEST 2014
I want to announce 2001:db8:2177::/48, which also needs to be in the
kernel routing table as a blackhole, and also 2001:db8:30a9:ffff::/64,
which is a subnet of 2001:db8:30a9::/48. Static protocol is used to also
blackhole the 2001:db8:30a9::/48. Traffic for this 2001:db8:30a9::/48
besides the /64 we announce at this point will flow into AS64515 via
another router that is connected to AS65517 and which is announcing the
whole 2001:db8:30a9::/48
Anyway...
router id 1.3.3.7;
debug protocols { states, routes, filters, interfaces }
protocol kernel {
persist;
scan time 60;
import none;
export all;
}
protocol device {
scan time 60;
}
protocol static {
import all;
route 2001:db8:30a9::/48 via "dummy0";
route 2001:db8:2177::/48 via "dummy0";
}
template bgp template_bgp {
local as 64515;
import all;
export all;
route limit 1000;
}
template pipe template_pipe {
table master;
mode transparent;
}
table T65517;
filter bgp_pipe_T65517_to_master
{
if net = ::/0 then accept;
reject;
}
filter bgp_pipe_master_to_T65517
{
if net = 2001:db8:2177::/48 then accept;
reject;
}
protocol pipe P65517 from template_pipe {
peer table T65517;
import filter bgp_pipe_T65517_to_master;
export filter bgp_pipe_master_to_T65517;
}
protocol static static_bgp_T65517 {
table T65517;
import all;
route 2001:db8:30a9:ffff::/64 via "dummy0";
}
protocol bgp bgp_example_peer from template_bgp {
table T65517;
source address 2001:db8:2000:1::202;
neighbor 2001:db8:2000:1::201 as 65517;
}
Note that the /64 route is directy injected into T65517, because it only
has to be used inside the BGP announcement. I don't know if this is the
best way, as I'm obviously still learning to find out, but it works (tm).
Now when the context is clear... let's start bird with this config file...
bird6: kernel1: Initializing
bird6: device1: Initializing
bird6: static1: Initializing
bird6: P65517: Initializing
bird6: static_bgp_T65517: Initializing
bird6: bgp_example_peer: Initializing
bird6: device1: Starting
bird6: device1: Connected to table master
bird6: device1: State changed to feed
bird6: kernel1: Starting
bird6: kernel1: Connected to table master
bird6: kernel1: State changed to feed
bird6: static1: Starting
bird6: static1: Connected to table master
bird6: static1: State changed to feed
bird6: P65517: Starting
bird6: P65517: Connected to table master
bird6: P65517: Connected to table T65517
bird6: P65517: State changed to feed
bird6: static_bgp_T65517: Starting
bird6: static_bgp_T65517: Connected to table T65517
bird6: static_bgp_T65517: State changed to feed
bird6: bgp_example_peer: Starting
bird6: Started
bird6: device1: State changed to up
bird6: kernel1: State changed to up
bird6: static1 < interface lo goes up
bird6: static1 < interface eth0 goes up
bird6: static1 < interface eth1 goes up
bird6: static1 < interface eth2 goes up
bird6: static1 < interface eth3 goes up
bird6: static1 < interface dummy0 created
bird6: static1: State changed to up
bird6: P65517: State changed to up
bird6: static_bgp_T65517 < interface lo goes up
bird6: static_bgp_T65517 < interface eth0 goes up
bird6: static_bgp_T65517 < interface eth1 goes up
bird6: static_bgp_T65517 < interface eth2 goes up
bird6: static_bgp_T65517 < interface eth3 goes up
bird6: static_bgp_T65517 < interface dummy0 created
bird6: static_bgp_T65517: State changed to up
bird6: bgp_example_peer: Connected to table T65517
bird6: bgp_example_peer: State changed to feed
bird6: bgp_example_peer: State changed to up
bird6: bgp_example_peer > added [best] ::/0 via 2001:db8:2000:1::201 on eth0
bird6: P65517 < added ::/0 via 2001:db8:2000:1::201 on eth0
bird6: P65517 > added [best] ::/0 via 2001:db8:2000:1::201 on eth0
bird6: P65517 < rejected by protocol ::/0 via 2001:db8:2000:1::201 on eth0
bird6: kernel1 < added ::/0 via 2001:db8:2000:1::201 on eth0
bird6: bgp_example_peer < rejected by protocol ::/0 via
2001:db8:2000:1::201 on eth0
BGP session is established, we get the predicted ::/0 route from the
remote AS.
bird> show route table T65517
::/0 via 2001:db8:2000:1::201 on eth0 [bgp_example_peer
00:33] * (100) [AS3265i]
bird> show route table master
::/0 via 2001:db8:2000:1::201 on eth0 [bgp_example_peer
00:41] * (100) [AS3265i]
But!... the static routes are not in the system. I don't see the /48's
and /64 anywhere...
Let's gently reload the same (!) configuration file again...
bird> configure soft
Reading configuration from /etc/bird6.conf
Reconfigured
bird6: Reconfiguring
bird6: kernel1: Reconfigured
bird6: device1: Reconfigured
bird6: static1 > added [best] 2001:db8:30a9::/48 dev dummy0
bird6: P65517 < filtered out 2001:db8:30a9::/48 dev dummy0
bird6: kernel1 < added 2001:db8:30a9::/48 dev dummy0
bird6: static1 > added [best] 2001:db8:2177::/48 dev dummy0
bird6: P65517 < added 2001:db8:2177::/48 dev dummy0
bird6: P65517 > added [best] 2001:db8:2177::/48 dev dummy0
bird6: P65517 < rejected by protocol 2001:db8:2177::/48 dev dummy0
bird6: bgp_example_peer < added 2001:db8:2177::/48 dev dummy0
bird6: kernel1 < added 2001:db8:2177::/48 dev dummy0
bird6: static1: Reconfigured
bird6: P65517: Reconfigured
bird6: static_bgp_T65517 > added [best] 2001:db8:30a9:ffff::/64 dev dummy0
bird6: P65517 < filtered out 2001:db8:30a9:ffff::/64 dev dummy0
bird6: bgp_example_peer < added 2001:db8:30a9:ffff::/64 dev dummy0
bird6: static_bgp_T65517: Reconfigured
bird6: bgp_example_peer: Reconfigured
bird6: Reconfigured
bird> show route table T65517
::/0 via 2001:db8:2000:1::201 on eth0 [bgp_example_peer
00:41] * (100) [AS3265i]
2001:db8:30a9:ffff::/64 dev dummy0 [static_bgp_T65517 00:48] * (200)
2001:db8:2177::/48 dev dummy0 [static1 00:48] * (200)
bird> show route table master
::/0 via 2001:db8:2000:1::201 on eth0 [bgp_example_peer
00:41] * (100) [AS3265i]
2001:db8:2177::/48 dev dummy0 [static1 00:48] * (200)
2001:db8:30a9::/48 dev dummy0 [static1 00:48] * (200)
And tadaa.wav:
# ip -6 r list proto bird
2001:db8:2177::/48 dev dummy0 metric 1024 mtu 1500 advmss 1440
hoplimit 4294967295
2001:db8:30a9::/48 dev dummy0 metric 1024 mtu 1500 advmss 1440
hoplimit 4294967295
default via 2001:db8:2000:1::201 dev eth0 metric 1024 mtu 1500 advmss
1440 hoplimit 4294967295
My question is: what's going on here? Why are the static routes not fed
into bird at startup, but only after I reload the unchanged
configuration? Have I overlooked a configuration detail, or is there
something else 'fishy' going on?
Thanks,
--
Hans van Kranenburg - System / Network Engineer
T +31 (0)10 2760434 | hans.van.kranenburg at mendix.com | www.mendix.com
More information about the Bird-users
mailing list