7

I am a complete newbie at BGP configurations.Need some clarification on understanding BGP network command.

One of our MPLS site routers have the following config : (Pasting only config snippets ) "

R1#
interface Loopback0
 ip address 10.129.110.157 255.255.255.252

interface GigabitEthernet0/0
 ip address 10.129.110.154 255.255.255.252

interface GigabitEthernet0/1.10
 encapsulation dot1Q 10 native
 ip address 10.129.135.129 255.255.255.192

!         
interface GigabitEthernet0/1.20
 encapsulation dot1Q 20
 ip address 10.129.135.193 255.255.255.192



router bgp XXXXX
 bgp log-neighbor-changes
 neighbor 10.129.110.153 remote-as 7795
 neighbor 10.129.110.153
 neighbor 10.129.110.153 ebgp-multihop 10
 !
 address-family ipv4
  neighbor 10.129.110.153 activate
  neighbor 10.129.110.153 send-community
  neighbor 10.129.110.153 soft-reconfiguration inbound
  no auto-summary
  no synchronization
  **network 10.129.110.152 mask 255.255.255.248**
  network 10.129.135.128 mask 255.255.255.128
 exit-address-family
"

When the BGP network command "network 10.129.110.152 mask 255.255.255.248" was put in , we cud not get connectivity to the loop back address "10.129.110.157"and the router from any where else from our network.

but when we split the network command individually

 "network 10.129.110.152 mask 255.255.255.252"
 " network 10.129.110.156 mask 255.255.255.252"

every thing worked fine.

Can some body explain me the correct uasge of network command in BGP. Also, When and in what cases do we use the aggregate-address in BGP.

Thanks in advance.

  • Do you have an ip route 10.129.110.152 255.255.255.248 null0 in there? The network statement will not inject routes that aren't in your route table. – Ricky Beam Sep 16 '13 at 22:04
  • 2
    I'm highly opinionated that 'network' statement should never be used, it creates config duplicity and in human-operated network over time rots the config (route is pulled, network-statement not). I'd highly suggest giving tag to static routes, which over redistribute route-map is advertised as desired. This way of config will also model better in multi-vendor networks. Unfortunately for connected networks you cannot set today tag (please do PERS/ER to account team), so in connected networks you'll either match to interface name or create prefix-list, which voids duplicity argument. – ytti Sep 17 '13 at 4:45
  • We didn't have a ip route 10.129.110.152 255.255.255.248 null0 . – Indu Reddy Sep 17 '13 at 13:45
5

From an old archive config...

router bgp 7866
...
 network 66.152.0.0 mask 255.255.224.0
...
ip route 66.152.0.0 255.255.224.0 Null0 200

We controlled exactly what was broadcast using network. Null routes a) prevent flapping (when there's an actual interface for that network -- eg. customer provided block), and b) put networks in the route table that wouldn't be there otherwise.

| improve this answer | |
6

If you're familiar with IGP's(EIGRP, OSPF), the network command is used for advertising networks and establishing neighbors using multicast addresses. BGP is different because we statically assign neighbors and the network command is used to simply advertise routes.

With IGP's, you will advertise all prefixes within the aggregate network block so if you have:

"network 10.129.110.152 mask 255.255.255.248"

under say, EIGRP, you will advertise both of the /30's within that network.

BGP works differently in that in that you must have an exact match for you network statement in the RIB. Because you didn't have an exact match for the 10.129.110.152/29 network, it didn't advertise. Once you added the network statements that matched the RIB, you were good to go.

In some cases, you may prefer to anchor the advertisement with a null route. So you could have:

 ip route 10.129.110.152 255.255.255.248 null 0

This would place the network route in the routing table and would always advertise the route even if the more specific routes are unavailable. This also helps when you have a flapping link because your advertisements won't withdraw and re-advertise.

The Aggregate-address is different than the network command. With the Aggregate-address command, you need a match in the BGP table and not the RIB. The network doesn't need to be an exact match, there only needs to be a longer prefix within the aggregate address.

Here's a link to an incredibly helpful troubleshooting resource as well.

NANOG BGP troubleshooting

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.