bird: show route behaviour

Dan Rimal danrimal at gmail.com
Sun Feb 24 01:08:21 CET 2013


Hello all,

I make some testbed and testing some scenarios and i found weird "show 
route" behaviour.

I have 2 bgp peers without filter. First router, called testr1, has 3 
tables: master, t_nix and t_tranzit. Second router called "nix1_nix" has 
quite default settings. Conf file from testr1 is attached.

To every single table on testr1 is imported 1 different static route via 
protocol static. Tables t_nix and t_tranzit are "piped" to master table, 
opposite direction is filtered.

BGP peer nix1_nix is defined with "table t_nix".

This is "show protocols" on tesr1:

device1  Device   master   up     00:29
kernel1  Kernel   master   up     00:29
k_nix    Kernel   t_nix    up     00:29
k_tranzit Kernel   t_tranzit up     00:29
p_nix    Pipe     t_nix    up     00:29       => master
p_tranzit Pipe     t_tranzit up     00:29       => master
s_master Static   master   up     00:29
s_nix    Static   t_nix    up     00:29
s_tranzit Static   t_tranzit up     00:29
nix1_nix BGP      t_nix    up     00:29       Established

There is route tables print. Table t_nix has imported default route from 
nix1_nix and table master has the same default route imported through 
pipe from t_nix (this is correct, just explanation):

bird> show route table master
0.0.0.0/0          via 192.168.1.3 on eth1 [nix1_nix 00:29] ! (100) 
[AS65000i]
4.4.4.0/24         via 172.17.1.1 on eth0 [s_master 00:29] * (200)
5.5.5.0/24         via 172.17.1.1 on eth0 [s_nix 00:29] * (200)
6.6.6.0/24         via 172.17.1.1 on eth0 [s_tranzit 00:29] * (200)
bird> show route table t_nix
0.0.0.0/0          via 192.168.1.3 on eth1 [nix1_nix 00:29] * (100) 
[AS65000i]
5.5.5.0/24         via 172.17.1.1 on eth0 [s_nix 00:29] * (200)
bird> show route table t_tranzit
6.6.6.0/24         via 172.17.1.1 on eth0 [s_tranzit 00:29] * (200)

Weird show behaviour comes now:

bird> show route export nix1_nix
4.4.4.0/24         via 172.17.1.1 on eth0 [s_master 00:29] * (200)
5.5.5.0/24         via 172.17.1.1 on eth0 [s_nix 00:29] * (200)
6.6.6.0/24         via 172.17.1.1 on eth0 [s_tranzit 00:29] * (200)

It show all routes from all tables, although table t_nix is defined on 
this peer. But, nix1_nix receive only one route, correct route from 
t_nix table:

bird> show protocols
name     proto    table    state  since       info
device1  Device   master   up     00:28
kernel1  Kernel   master   up     00:28
r1       BGP      master   up     00:29       Established
bird> show route protocol r1
5.5.5.0/24         via 192.168.1.1 on eth1 [r1 00:29] * (100) [AS64000i]


I tryid simplify scenario and delete pipes to master table temporarily 
and situation looks this way:

testr1:

bird> show protocols
name     proto    table    state  since       info
device1  Device   master   up     00:31
kernel1  Kernel   master   up     00:31
k_nix    Kernel   t_nix    up     00:31
k_tranzit Kernel   t_tranzit up     00:31
s_master Static   master   up     00:31
s_nix    Static   t_nix    up     00:31
s_tranzit Static   t_tranzit up     00:31
nix1_nix BGP      t_nix    up     00:31       Established
bird>
bird> show route table master
4.4.4.0/24         via 172.17.1.1 on eth0 [s_master 00:31] * (200)
bird> show route table t_nix
0.0.0.0/0          via 192.168.1.3 on eth1 [nix1_nix 00:31] * (100) 
[AS65000i]
5.5.5.0/24         via 172.17.1.1 on eth0 [s_nix 00:31] * (200)
bird> show route table t_tranzit
6.6.6.0/24         via 172.17.1.1 on eth0 [s_tranzit 00:31] * (200)


and now, command show route from master table only


bird> show route export nix1_nix
4.4.4.0/24         via 172.17.1.1 on eth0 [s_master 00:31] * (200)


although peer receive correct route:

bird> show route protocol r1
5.5.5.0/24         via 192.168.1.1 on eth1 [r1 00:31] * (100) [AS64000i]


It looks like "show" command bug only, which is good, but it is pretty 
confusing :)

Both peers is:
Linux testr1 3.4.4-5.fc17.x86_64 #1 SMP Thu Jul 5 20:20:59 UTC 2012 
x86_64 x86_64 x86_64 GNU/Linux

running latest:
bird> show status
BIRD 1.3.9


Regards,

Dan
-------------- next part --------------
log syslog { debug, trace, info, remote, warning, error, auth, fatal, bug };

router id 192.168.1.1;

table t_tranzit;
table t_nix;

protocol device {
        scan time 10;           # Scan interfaces every 10 seconds
}

protocol kernel {
        persist;                # Don't remove routes on bird shutdown
        scan time 20;           # Scan kernel routing table every 20 seconds
        import all;             # Default is import all
        export all;             # Default is export none
}


## kernelova tabule 10 je plnena z birdovy tabule nix
protocol kernel k_nix {
        kernel table 10;        # Kernel table to synchronize with (default: main)
        table t_nix;
        persist;                # Don't remove routes on bird shutdown
        scan time 20;           # Scan kernel routing table every 20 seconds
        import all;            # Default is import all
        export all;             # Default is export none

}

## kernelova tabule 11 je plnena z birdovy tabule tranzit
protocol kernel k_tranzit {
        kernel table 11;        # Kernel table to synchronize with (default: main)
        table t_tranzit;
        persist;                # Don't remove routes on bird shutdown
        scan time 20;           # Scan kernel routing table every 20 seconds
        import all;            # Default is import all
        export all;             # Default is export none
        
}

## do hlavni tabule posleme vsechno z tabule nix, zpet nic
#protocol pipe p_nix {
#        table t_nix;
#        peer table master;
#        import none;
#        export all;
#}

## do hlavni tabule posleme vsechno z tabule tranzit, zpet nic
#protocol pipe p_tranzit {
#        table t_tranzit;
#        peer table master;
#        import none;
#        export all;
#}


protocol static s_master{
	table master;
        route 4.4.4.0/24 via 172.17.1.1;
}

protocol static s_nix{
	table t_nix;
	route 5.5.5.0/24 via 172.17.1.1;
}

protocol static s_tranzit{
	table t_tranzit;
        route 6.6.6.0/24 via 172.17.1.1;
}


protocol bgp nix1_nix {
	table t_nix;
        debug {events, states};
        local as 64000;
        neighbor 192.168.1.3 as 65000;
        hold time 90;
        startup hold time 90;
        connect retry time 30;
        keepalive time 30;      
        start delay time 5;     
        error wait time 60, 300;
        error forget time 300;  
#       disable after error;    
        gateway direct;
        igp metric off;
        next hop self;          
        path metric 1;          
        default bgp_med 0;
        import all;
        export all;
}




More information about the Bird-users mailing list