Border Gateway Protocol (BGP)

This section covers some of the most common BGP related topics.

Find BGP namespaces:

# ip netns list
bgp-1401c51
[...]

Verify that the Quagga process is running:

# ip netns exec bgp-1401c51 ps aux | grep [q]uagga
quagga   10614  0.0  0.0 114544  7664 ?        S    04:06   0:00 /usr/sbin/bgpd --vty_port 2606 --config_file /etc/midolman/quagga/bgpd.conf --pid_file /var/run/quagga/bgpd.2606.pid --socket /var/run/quagga/zserv1.api

Verify that Quagga is listening on both VTYSH and BGP ports:

# ip netns exec bgp-1401c51 netstat -tulpen
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode      PID/Program name
tcp        0      0 0.0.0.0:2606            0.0.0.0:*               LISTEN      92         4052614    24029/bgpd
tcp        0      0 0.0.0.0:179             0.0.0.0:*               LISTEN      92         4052693    24029/bgpd
tcp6       0      0 :::2606                 :::*                    LISTEN      92         4052615    24029/bgpd
tcp6       0      0 :::179                  :::*                    LISTEN      92         4052694    24029/bgpd

Check the BGP-related interfaces and routing information:

# ip netns exec bgp-1401c51 ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
5: bgp-1401c51_m: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether ac:ca:ba:1a:af:24 brd ff:ff:ff:ff:ff:ff
    inet 192.0.2.2/30 scope global bgp-1401c51_m
       valid_lft forever preferred_lft forever
    inet6 fe80::aeca:baff:fe1a:af24/64 scope link
       valid_lft forever preferred_lft forever
7: bgp-1401c51_vm: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether c6:89:e2:2b:b0:8e brd ff:ff:ff:ff:ff:ff
    inet 172.23.0.6/30 scope global bgp-1401c51_vm
       valid_lft forever preferred_lft forever
    inet6 fe80::c489:e2ff:fe2b:b08e/64 scope link
       valid_lft forever preferred_lft forever
# ip netns exec bgp-1401c51 ip route
192.0.2.0/30   dev bgp-1401c51_m     proto kernel  scope link  src 192.0.2.2
172.23.0.4/30  dev bgp-1401c51_vm  proto kernel  scope link  src 172.23.0.6

Ensure that the BGP peers are REACHABLE:

# ip netns exec bgp-1401c51 ip neigh show

Dump the VTYSH interface’s traffic:

# ip netns exec bgp-1401c51 tcpdump -vvv -i mbgp1_vtym

Dump ARP, BGP and ICMP traffic on the BGP interface:

# ip netns exec bgp-1401c51 tcpdump -vvv -i mbgp1_m "icmp or arp or port 179"

Dump ARP, BGP and ICMP traffic on the corresponding physical interface:

# tcpdump -vvv -i eth1 "icmp or arp or port 179"

In order to verify connectivity , launch midonet-cli

# midonet-cli

Inside Midonet CLI , find your edge-router(s)

midonet> router list
router router0 name edge-router state up infilter chain0 outfilter chain1 asn 12345

Find the BGP port(s)

midonet> router router0 port list
port port0 device router0 state up plugged no mac fa:16:3e:ad:5c:30 address 200.200.200.1 net 200.200.200.1/24 peer bridge0:port0
port *port1* device router0 state up plugged yes mac fa:16:3e:a7:9f:82 address 10.88.88.3 net 10.88.88.3/29

Show the BGP status

midonet> router router0 port port1 bgp-status show
BGP neighbor is 10.88.88.2, remote AS 65535, local AS 12345, external link
  BGP version 4, remote router ID 10.20.0.254
  BGP state = Established, up for 05w1d16h
  Last read 00:00:19, hold time is 180, keepalive interval is 60 seconds
  Configured hold time is 180, keepalive interval is 60 seconds
  Neighbor capabilities:
    4 Byte AS: advertised and received
    Route refresh: advertised and received(old & new)
    Address family IPv4 Unicast: advertised and received
  Message statistics:
    Inq depth is 0
    Outq depth is 0
                         Sent       Rcvd
    Opens:                  3          0
    Notifications:          0          1
    Updates:                1          1
    Keepalives:         52802      52801
    Route Refresh:          0          0
    Capability:             0          0
    Total:              52806      52803
  Minimum time between advertisement runs is 30 seconds

 For address family: IPv4 Unicast
  Community attribute sent to this neighbor(both)
  Outbound path policy configured
  Outgoing update AS path filter list is *1
  1 accepted prefixes

  Connections established 1; dropped 0
  Last reset never
Local host: 10.88.88.3, Local port: 179
Foreign host: 10.88.88.2, Foreign port: 54094
Nexthop: 10.88.88.3
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
Read thread: on  Write thread: off
Questions? Discuss on Mailing Lists or Chat.
Found an error? Report a bug.