Chapter 7. BGP Uplink Configuration

MidoNet utilizes the Border Gateway Protocol (BGP) for external connectivity.

For production deployments it is strongly recommended to use BGP due to it’s scalability and redundancy.

For demo or POC environments, alternatively static routing can be used.

The following instructions assume below sample environment:

  • One floating IP network

    • 192.0.2.0/24
  • Two MidoNet gateway nodes

    • gateway1, connecting to bgp1 via eth1
    • gateway2, connecting to bgp2 via eth1
  • Two remote BGP peers

    • bgp1, 198.51.100.1, AS 64513
    • bgp2, 203.0.113.1, AS 64514
  • Corresponding MidoNet BGP peers

    • 198.51.100.2, AS 64512
    • 203.0.113.2, AS 64512

Follow these steps to configure the BGP uplinks.

  1. Launch the MidoNet CLI and find the Edge Router

    midonet-cli> router list
    router router0 name Edge Router state up
    router router1 name Tenant Router state up infilter chain0 outfilter chain1

    In this example the Edge Router is router0.

  2. Create and bind virtual ports for the BGP sessions

    Refer to Chapter 6, Edge Router Setup for instructions on how to create the necessary ports and bind them to the Gateway hosts' physical network interfaces.

    You can confirm the port configuration within MidoNet CLI by listing the Edge Router’s ports:

    midonet> router router0 port list
    port port0 device router0 state up mac fa:16:3e:11:11:11 addresses 198.51.100.2/30
    port port1 device router0 state up mac fa:16:3e:22:22:22 addresses 203.0.113.2/30
    [...]
  3. Configure basic BGP settings

    midonet> router router0 set asn 64512
    
    midonet> router router0 add bgp-peer asn 64513 address 198.51.100.1
    router0:peer0
    
    midonet> router router0 add bgp-peer asn 64514 address 203.0.113.1
    router0:peer1
    
    midonet> router router0 list bgp-peer
    peer peer0 asn 64513 address 198.51.100.1
    peer peer1 asn 64514 address 203.0.113.1
  4. If needed, configure MD5 authentication:

    midonet> router router0 bgp-peer peer0 set password BGP_PASSWORD
    midonet> router router0 bgp-peer peer1 set password BGP_PASSWORD
  5. If needed, configure custom timers that will take precedence over the default ones defined in the MidoNet configuration:

    midonet> router router0 bgp-peer peer0 set connect-retry 10
    midonet> router router0 bgp-peer peer0 set hold-time 5
    midonet> router router0 bgp-peer peer0 set keep-alive 5
    midonet> router router0 bgp-peer peer1 set connect-retry 10
    midonet> router router0 bgp-peer peer1 set hold-time 5
    midonet> router router0 bgp-peer peer1 set keep-alive 5
    midonet> router router0 list bgp-peer
    peer peer0 asn 64513 address 198.51.100.1 keep-alive 5 hold-time 5 connect-retry 10
    peer peer1 asn 64514 address 203.0.113.1 keep-alive 5 hold-time 5 connect-retry 10
  6. Add routes to the remote BGP peers

    In order to be able to establish connections to the remote BGP peers, corresponding routes have to be added.

    midonet> router router0 route add src 0.0.0.0/0 dst 198.51.100.0/30 port router0:port0 type normal
    router0:route0
    
    midonet> router router0 route add src 0.0.0.0/0 dst 203.0.113.0/30 port router0:port1 type normal
    router0:route1
  7. Advertise BGP routes

    In order to provide external connectivity for hosted virtual machines, the floating IP network has to be advertised to the BGP peers.

    midonet> router router0 add bgp-network net 192.0.2.0/24
    router0:net0
    
    midonet> router router0 list bgp-network
    net net0 net 192.0.2.0/24
Questions? Discuss on Mailing Lists or Chat.
Found an error? Report a bug.