mhristache/cniguru

Add the container routing table

Opened this issue · 0 comments

It would be helpful to include the container routing table in the output of cniguru

[root@kh1 ~]# ip netns exec aa41e96576b ip r        
default via 21.23.96.126 dev net1 
10.96.0.0/12 via 10.244.0.1 dev eth0 
10.244.0.0/24 dev eth0 proto kernel scope link src 10.244.0.216 
21.23.80.128/25 via 10.244.0.1 dev eth0 
21.23.81.128/25 via 10.244.0.1 dev eth0 
21.23.82.128/25 via 10.244.0.1 dev eth0 
21.23.84.128/25 via 10.244.0.1 dev eth0 
blackhole 21.23.90.200 
21.23.92.129 via 10.244.0.1 dev eth0 
21.23.95.0/25 dev net0 proto kernel scope link src 21.23.95.1 
21.23.96.0/25 dev net1 proto kernel scope link src 21.23.96.1 
21.23.97.0/25 dev net2 proto kernel scope link src 21.23.97.1 
blackhole 22.8.0.0/16 
172.19.0.0/27 via 21.23.95.126 dev net0 

Note: a container might use more routing tables (e.g. policy based routing) so it might be nice to detect other non-default tables and print routes in those as well.

# cat /etc/iproute2/rt_tables 
#
# reserved values
#
255     local
254     main
253     default
0       unspec
#
# local
#
#1      inr.ruhep
512     Custom
...