Injecting route into bird/ospf
Hello, I would like to hear some advices about bird on linux, what is the best way to inject some route into OSPF on bird. I want for my router to announce via OSPF to other routers that some IPs should be directed to it. Example: I want IPs 10.0.0.1/32 and 10.0.0.5/32 to be directed to my router. I would set dummy0 interface, set those IPs there, include dummy0 in OSPF and voila! the rest of network "knows" 10.0.0.1 and 10.0.0.5 is here. This doesn't seem as a good solution for me, because the traffic to 10.0.0.1 and 10.0.0.5 would then be NATed or modified in other way so these IPs really don't need to exist. I'd like to change these settings few times in an hour so writing it to bird config doesn't seem like a good solution. Is there a way to do it without setting IPs anywhere? Maybe set some custom local routing table for this and tell bird to announce routes found there? echo "25 mytable" >> /etc/iproute2/rt_tables ip route show table mytable # empty ip route add 10.0.0.1/32 dev lo table mytable ip route show table mytable # shows 10.0.0.1 on loopback # and now also bird picks up 10.0.0.1 and announces it What is the best way to do it "the most dynamic way"? Thank you ico
Anno domini 2017 ico scripsit: Hi,
I would like to hear some advices about bird on linux, what is the best way to inject some route into OSPF on bird. I want for my router to announce via OSPF to other routers that some IPs should be directed to it.
Example: I want IPs 10.0.0.1/32 and 10.0.0.5/32 to be directed to my router. I would set dummy0 interface, set those IPs there, include dummy0 in OSPF and voila! the rest of network "knows" 10.0.0.1 and 10.0.0.5 is here. This doesn't seem as a good solution for me, because the traffic to 10.0.0.1 and 10.0.0.5 would then be NATed or modified in other way so these IPs really don't need to exist. [...]
So like interface "dummy0" { stub yes; }; within the OSPF protocol? That seems like a fine way for me. What's the problem of configuring an IP on the dummy0 interface? You would have to configure routes into your 'mytable' table, add a second kernel protocol, learn routes there and export those to OSPF as E1/E2. That's more hassle IMO. Best Max -- "I have to admit I've always suspected that MTBWTF would be a more useful metric of real-world performance." -- Valdis Kletnieks on NANOG
On Fri, Jul 28, 2017 at 11:27:23AM +0000, ico wrote:
Hello,
Is there a way to do it without setting IPs anywhere? Maybe set some custom local routing table for this and tell bird to announce routes found there?
echo "25 mytable" >> /etc/iproute2/rt_tables ip route show table mytable # empty ip route add 10.0.0.1/32 dev lo table mytable ip route show table mytable # shows 10.0.0.1 on loopback # and now also bird picks up 10.0.0.1 and announces it
What is the best way to do it "the most dynamic way"?
Hi You could add 'learn' option to kernel protocol and then learn routes from that table. These could be exported to the OSPF protocol as external routes. -- 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)
-
ico -
Maximilian Wilhelm -
Ondrej Zajicek