Show Commands:
bird> show symbols - list of symbols (filters, protocols, tables, etc...)
bird> show protocols [all] - list of protocols [including details]
birdc> show route for “prefix/ip” [all] - list route for given prefix/ip address [including details]
birdc> show route filter “filtr” [all] - list routes according given filter [including details]
birdc> show route where bgp_path ~ [= * 1234 * =] - list routes with given bgp path
birdc> show route where 127.0.0.5 ~ net - the same as “for prefix” (?)
birdc> show route filter { if 10.100.1.0 ~ net then accept; } - debug filter
birdc> show route where bgp_path.last = 15685 routes with origin 15685
birdc> show route tableT1 where bgp_path ~[ =* 701 *=] all count - list a number of routes that go via Verizon
birdc> show route table T1 all filter { if ( 701 ~ bgp_path ) then accept; reject } count - does the same thing as the previous command
birdc> show route table T1 where bgp_path_first = 2828 && bgp_path.len = 2 all count - list a number of routes originating in XO and have AS-PATH length 2
birdc> show route export EDGE_R1 - equivalent of show route advertising-protocol bgp in junos. 'EDGE_R1' is a name of the bgp group in bird conf
birdc> show route table T1 primary count - show only best routes
Examples:
Filters:
Only BGP routes:
filter BGP {
if source = RTS_BGP then accept;
}
Only OSPF routes:
filter OSPF {
if source = RTS_OSPF then accept;
}
Only default route:
filter DEFAULT{
if net = 0.0.0.0/0 then accept;
reject;
}
Only default route:
filter All_ROUTES {
if net ~ 0.0.0.0/0 then accept;
}
Reject everything:
filter REJECT_ALL {
reject;
}
Filters and Functions can be referenced in export or import statements, for example:
export filter REJECT_FILTER;
export where REJECT_FUNCTION;
Example 1: Find out a number of routes originated in Verizon network:
Verizon ASN: 701;
There are a couple of ways to do it:
bird> show route table T1 where bgp_path.last = 701 count
2771 of 961949 routes for 571160 networks
bird> show route table T1 filter { if ( bgp_path.last = 701 ) then accept; reject; } count
2771 of 962055 routes for 571185 networks
bird> show route table T1 all filter { if ( bgp_path ~[= *701 =] ) then accept; reject; } count
2772 of 962026 routes for 571171 networks
Example 2: Find out a number of routes pass via Verizon network:
bird> show route table T1where 701 ~ bgp_path count
21457 of 961726 routes for 571187 networks
the preceding filter will show routes that pass through Verizon as well as routes originating in Verizon:
If we want to exclude routes originated in Verizon AS and count prefixes that are transiting through Verizon, use the following filter:
bird> show route table T1where bgp_path ~[=* 701 *=] count
21422 of 962449 routes for 571458 networks
Example 3: Find out a number of routes which are two AS-hops away:
bird> show route table T1where bgp_path.len = 2 count
156156 of 962338 routes for 571449 networks
Example 4: Find out a number of routes which are reachable via XO (as# 2828):
bird> show route table T1 where bgp_path.first = 2828 count
325298 of 962331 routes for 571451 networks
Logging & Debuggin:
Set logging of messages having the given class (either all or { error, trace } etc.) into selected destination (a file specified as a filename string, syslog with optional name argument, or the stderr output). Classes are: info, warning, error and fatal for messages about local problems, debug for debugging messages, trace when you want to know what happens in the network, remote for messages about misbehavior of remote machines, auth about authentication failures, bug for internal BIRD bugs. You may specify more than one log line to establish logging to multiple destinations. Default: log everything to the system log. (http://bird.network.cz/?get_doc&f=bird-3.html)
In the following config example we enabled logging for everything, sending it to /var/log/bird.log and enabled debug for all protocols:
Alternatively, we can comment out 'debug protocols all' statement in the config and enabled debugging for a specific protocol from birdc:
Now, lets clear BGP session between two routers and Bird server while tailing log file:
If the above log is too detailed, we can turn the global debugging off ("debug protocols off;") and enable debugging in the the BGP neighbor configuration:
Next