Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Quagga: Dev
[PATCH] Zebra rib/fib to be in sinc with kernel routing table.
 

Index | Next | Previous | View Flat


igorm at etf

Oct 20, 2011, 5:18 AM


Views: 347
Permalink
[PATCH] Zebra rib/fib to be in sinc with kernel routing table.

From: Igor Maravic <igorm [at] etf>

Hi all,
I have one doubt. I declared some routes to be directly connected to my interface, with command ip route. Exact command was this:
sudo ip route add 1.2.3.4/32 dev eth1
zebra reads this perfectly and when I do command
show ip route
in zebra this is what I get
---
zebra# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
I - ISIS, B - BGP, > - selected route, * - FIB route

K>* 0.0.0.0/0 via 147.91.8.1, eth0
K>* 1.2.3.4/32 is directly connected, eth1
C>* 10.200.1.1/32 is directly connected, lo
C>* 127.0.0.0/8 is directly connected, lo
C>* 147.91.8.0/23 is directly connected, eth0
K>* 169.254.0.0/16 is directly connected, eth1
C>* 192.168.2.0/24 is directly connected, eth1
---
with command
route
in linux terminal I get
---
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
1.2.3.4 * 255.255.255.255 UH 0 0 0 eth1
192.168.2.0 * 255.255.255.0 U 1 0 0 eth1
147.91.8.0 * 255.255.254.0 U 1 0 0 eth0
link-local * 255.255.0.0 U 1000 0 0 eth1
default rtr3.etf.bg.ac. 0.0.0.0 UG 0 0 0 eth0
---
That' s all fine. But my doubt is this - when I bring interface eth1 down in zebra I get this:
---
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
I - ISIS, B - BGP, > - selected route, * - FIB route

K>* 0.0.0.0/0 via 147.91.8.1, eth0
K * 1.2.3.4/32 is directly connected, eth1 inactive
C>* 10.200.1.1/32 is directly connected, lo
C>* 127.0.0.0/8 is directly connected, lo
C>* 147.91.8.0/23 is directly connected, eth0
K * 169.254.0.0/16 is directly connected, eth1 inactive
---
Shoud routes directly connected to eth1 be inactive? When I bring interface eth1 up, there are no more directly connected routes in kernel IP routing table, but zebra still saves them as kernel routes. When I bring eth1 up this is what I get with route command in terminal
---
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.2.0 * 255.255.255.0 U 1 0 0 eth1
147.91.8.0 * 255.255.254.0 U 1 0 0 eth0
link-local * 255.255.0.0 U 1000 0 0 eth1
default rtr3.etf.bg.ac. 0.0.0.0 UG 0 0 0 eth0
---
and in zebra show ip route
---
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
I - ISIS, B - BGP, > - selected route, * - FIB route

K>* 0.0.0.0/0 via 147.91.8.1, eth0
K>* 1.2.3.4/32 is directly connected, eth1
C>* 10.200.1.1/32 is directly connected, lo
C>* 127.0.0.0/8 is directly connected, lo
C>* 147.91.8.0/23 is directly connected, eth0
K>* 169.254.0.0/16 is directly connected, eth1
C>* 192.168.2.0/24 is directly connected, eth1
---
Link local address exists in both tables because it's created when interface goes up. So in Zebra's RIB it's first deleted and then it's created again. This is RIB debug log from zebra for link-local address:
---
2011/10/20 12:09:19 ZEBRA: rib_add_ipv4: calling rib_addnode (0xb82d0018, 0xb82cfed0)
2011/10/20 12:09:19 ZEBRA: rib_link: 169.254.0.0/16: rn 0xb82d0018, rib 0xb82cfed0
2011/10/20 12:09:19 ZEBRA: rib_link: 169.254.0.0/16: new head, rn_status copied over
2011/10/20 12:09:19 ZEBRA: rib_add_ipv4: calling rib_delnode (0xb82d0018, 0xb82cfed0)
2011/10/20 12:09:19 ZEBRA: rib_delnode: 169.254.0.0/16: rn 0xb82d0018, rib 0xb82d0058, removing
2011/10/20 12:09:19 ZEBRA: rib_process: 169.254.0.0/16: Removing existing route, fib 0xb82d0058
2011/10/20 12:09:19 ZEBRA: rib_process: 169.254.0.0/16: Adding route, select 0xb82cfed0
2011/10/20 12:09:19 ZEBRA: rib_process: 169.254.0.0/16: Deleting fib 0xb82d0058, rn 0xb82d0018
2011/10/20 12:09:19 ZEBRA: rib_unlink: 169.254.0.0/16: rn 0xb82d0018, rib 0xb82d0058
---
To sum up, I think that kernel routes, shouldn't be inactive, but they should be deleted when interface to which they are directly connected goes down. I made a patch for that, and I'm sending it to the list.
BR
Igor Maravić
PS. I'm running quagga 0.99.20, freshly cloned from git

Igor Maravic (1):
Enable Zebra rib/fib to be in sinc with kernel routing table. That
means when interface goes down, all routes that are directly
connected to it are deleted from Zebra's rib/fib just like they
are delete from kernel routing table

zebra/zebra_rib.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)

--
1.7.4.1

_______________________________________________
Quagga-dev mailing list
Quagga-dev [at] lists
http://lists.quagga.net/mailman/listinfo/quagga-dev

Subject User Time
[PATCH] Zebra rib/fib to be in sinc with kernel routing table. igorm at etf Oct 20, 2011, 5:18 AM
    Re: [PATCH] Zebra rib/fib to be in sinc with kernel routing table. joakim.tjernlund at transmode Oct 20, 2011, 7:34 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.