Injecting routes in to BGP for advertisement: BGP network command

  • 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 ) "

    interface Loopback0
     ip address
    interface GigabitEthernet0/0
     ip address
    interface GigabitEthernet0/1.10
     encapsulation dot1Q 10 native
     ip address
    interface GigabitEthernet0/1.20
     encapsulation dot1Q 20
     ip address
    router bgp XXXXX
     bgp log-neighbor-changes
     neighbor remote-as 7795
     neighbor ebgp-multihop 10
     address-family ipv4
      neighbor activate
      neighbor send-community
      neighbor soft-reconfiguration inbound
      no auto-summary
      no synchronization
      **network mask**
      network mask

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

    but when we split the network command individually

     "network mask"
     " network mask"

    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 null0` in there? The network statement will not inject routes that aren't in your route table.

    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.

    We didn't have a ip route null0 .

  • Ricky

    Ricky Correct answer

    8 years ago

    From an old archive config...

    router bgp 7866
     network mask
    ip route 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.

License under CC-BY-SA with attribution

Content dated before 7/24/2021 11:53 AM

Tags used