BGP; Why we need to create static route to advertise a network?

Before BGP advertised its network, it checks the forwarding table for an exact match of network number and mask on router’s routing table.

R1 is expected to advertise network 128.20.0.0/16 and 10.10.10.0/24 to R2 using this configuration

router bgp 1
no auto-summary
network 128.20.0.0 mask 255.255.0.0
network 10.10.10.0 mask 255.255.255.0

However, when we check on R1, it is only 128.20.0.0 network that is being advertised.

R1#sh ip bgp
BGP table version is 2, local router ID is 192.22.11.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 128.20.0.0       0.0.0.0                  0         32768 i

R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

C    128.20.0.0/16 is directly connected, Loopback0
C    192.168.20.0/24 is directly connected, Serial1/0.601

Also in R2, we only see network 128.20.0.0.

R2#sh ip bgp
BGP table version is 19, local router ID is 192.168.20.21
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 128.20.0.0       192.168.20.20            0             0 20 i

R2#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

B    128.20.0.0/16 [20/0] via 192.168.20.20, 00:06:58
C    192.168.20.0/24 is directly connected, Serial1/0.106

Aren’t 10.10.10.0/24 supposed to be advertised like 128.20.0.0/16?

Apparently NOT!

Why network 128.20.0.0/16 is being advertised? It is because network 128.20.0.0/16 has entry on router’s routing table and 10.10.10.0/24 is not.

R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

C    128.20.0.0/16 is directly connected, Loopback0
C    192.168.20.0/24 is directly connected, Serial1/0.601

Again, on the first paragraph of this article, it’s stated:

Before BGP advertised its network, it checks the forwarding table for an exact match of network number and mask on router’s routing table.

Therefore, as no entry for 10.10.10.0/24 on the routing table, the network will not be advertised.

The solution is, if we want to include network 10.10.10.0/24 to be advertised, make sure that R1 has a component route for network 10.10.10.0/24 either by learning it through IGP or through static configuration. In the example shown, the static route is configured to null 0.

ip route 10.10.10.0 255.255.255.0 null 0

Now, let’s check the routing table on both R1 and R2.

R1#sh ip bgp
BGP table version is 3, local router ID is 192.22.11.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 10.10.10.0/24    0.0.0.0                  0         32768 i
*> 128.20.0.0       0.0.0.0                  0         32768 i

R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

C    128.20.0.0/16 is directly connected, Loopback0
     10.0.0.0/24 is subnetted, 1 subnets
S       10.10.10.0 is directly connected, Null0

R2#sh ip bgp
BGP table version is 24, local router ID is 192.168.20.21
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 10.10.10.0/24    192.168.20.20            0             0 20 i
*> 128.20.0.0       192.168.20.20            0             0 20 i

R2#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

B    128.20.0.0/16 [20/0] via 192.168.20.20, 00:01:12
     10.0.0.0/24 is subnetted, 1 subnets
B       10.10.10.0 [20/0] via 192.168.20.20, 00:01:12

NOTE. There is actually another way to do this. You can replace network 128.20.0.0 mask 255.255.0.0 with redistribute connected and replace network 10.10.10.0 mask 255.255.255.0 with redistribute static. But still, you need to create a static routing for network 10.10.10.0/16 so that BGP able to see it from the routing table.

Source: Troubleshooting When BGP Routes Are Not Advertised

Compiling Dynamips on Intel Mac + Leopard.

This article is a continuity from my previous article.

As I’ve upgrade my MBP from Tiger to Leopard, some adjustment needs to be made.

Installing XCode 3.0

If you get the Leopard CD, you can install XCode 3.0 from it. Go to Optional InstallXcode Tools – and run XcodeTools.mpkg to install.

Or you can also download it from http://developer.apple.com/tools/download/. You need to get Apple Developer Connection to get it.

Installing X11 SDK

This package is installed by default when you have Leopard on your machine. However, if you need to install X11 SDK, you can use Leopard CD. Go to Optional InstallXcode ToolsPackages – and run X11SDK.mpkg to install.

MacPorts

Get this MacPorts-1.5.0-10.5.dmg and install it.

Update your port list.

sudo port -v selfupdate

Install libpcap

$ sudo port install libpcap
$ sudo ln -s /opt/usr/local/libpcap.a /usr/local/lib/libpcap.a

Instal libelf

$ sudo port install libelf

Download the latest Dynamips 0.2.8-RC2 source code and install it.

$ curl 'http://www.ipflow.utc.fr/dynamips/dynamips-0.2.8-RC2.tar.gz' -o dynamips-0.2.8-RC2.tar.gz
$ tar -zxvf dynamips-0.2.8-RC2.tar.gz
$ cd dynamips-0.2.8-RC2
$ make
$ mv dynamips dynamips-0.2.8-RC2.intel-mac.bin
$ strip dynamips-0.2.8-RC2.intel-mac.bin

Greg has put his Dynamips compiled on Leopard. You can download this binary from here

Putty Issue

I did a change for 175 routers last night. Easy job. Copy and paste the about 100 lines of configuration using Putty. However, funny things happened. Some lines were not copied properly and only affecting about 50 devices. Is this Putty issue? as I can’t find anything on the net.

Should I use SecureCRT or probably TeraTerm Pro?