Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

4. Modify volumes/gateway/zebra.conf and volumes/gateway/bgpd.conf as you want. Here are samples of the config files. Note that fpm connection ip in zebra.conf should be the eth0 interface IP address of onos-vrouter container, assigned by Docker. Run Quagga container with those config files. The IP address comes with the command would be equals to router-id in bgpd.conf. And the MAC address can be any value, just remember it since it will be used in vrouter.json latermust be "fe:00:00:00:00:01", it is hard-coded right now and needs to be improved soon.

Code Block
titlevolumes/gateway/bgpd.conf
! -*- bgp -*-
!
! BGPd sample configuration file
!
!
hostname gateway-01
password zebra
!
router bgp 65101
  bgp router-id 172.18.0.254
  timers bgp 3 9
  neighbor 172.18.0.1 remote-as 65100
  neighbor 172.18.0.1 ebgp-multihop
  neighbor 172.18.0.1 timers connect 5
  neighbor 172.18.0.1 advertisement-interval 5
  network 172.27.0.0/24
!
log file /var/log/quagga/bgpd.log
Code Block
titlevolumes/gateway/zebra.conf
!
hostname gateway-01
password zebra
!
fpm connection ip 172.17.0.2 port 2620

 

 

...

Code Block
languagebash
$ ./quagga.sh --name=gateway-01 --ip=172.18.0.254/24 --mac=fe:00:00:00:00:01

If you check the result of ovs-vsctl show, there should be a new port named quagga on br-router bridge. 

 

 

5. If there's no external router or emulation of it in your setup, add another Quagga container which acts as an external router. First, modify volumes/router/zebra.conf and volumes/router/bgpd.conf to make this Quagga an external router neighboring with the one created right before, and use the same command above but with additional argument --external-router to bring up the router container. You can put any MAC address this time.

Code Block
titlevolumes/router/bgpd.conf
! -*- bgp -*-
!
! BGPd sample configuration file
!
!
hostname router-01
password zebra
!
router bgp 65100
  bgp router-id 172.18.0.1
  timers bgp 3 9
  neighbor 172.18.0.254 remote-as 65101
  neighbor 172.18.0.254 ebgp-multihop
  neighbor 172.18.0.254 timers connect 5
  neighbor 172.18.0.254 advertisement-interval 5
  neighbor 172.18.0.254 default-originate
!
log file /var/log/quagga/bgpd.log 

...

7. Once it is up and running, check ports result. If any port number does not match to the ones in vrouter.json, modify the config file with the correct port numbers, and just re-run the vrouter.sh. It actually happens often since you are going to re-create Quagga containers to fix the Quagga config files and OVS increase port number whenever new port is added to a bridge. 

Code Block
$ ssh -p 8101 
Code Block
$ ssh -p 8101 karaf@172.17.0.2
# password is karaf

onos> ports
id=of:00000000000000b1, available=true, role=MASTER, type=SWITCH, mfr=Nicira, Inc., hw=Open vSwitch, sw=2.3.0, serial=None, driver=softrouter, channelId=172.17.0.1:58292, managementAddress=172.17.0.1, name=of:00000000000000b1, protocol=OF_13
  port=local, state=disabled, type=copper, speed=0 , portName=br-router, portMac=e6:a0:79:f9:d1:4a
  port=1, state=enabled, type=copper, speed=0 , portName=patch-rout, portMac=fe:da:85:15:b1:bf
  port=224, state=enabled, type=copper, speed=10000 , portName=veth1quagga, portMac=a206:fe:d4:6a:e9:c1
  port=24, state=enabled, type=copper, speed=10000 , portName=quagga, portMac=06:96:96:1b:36:32:77
  port=25, state=enabled, type=copper, speed=10000 , portName=quagga-router, portMac=ea:1e:71:d1:fd:81
Code Block
linenumbers

 

If any port number does not match to the ones in vrouter.json, modify the config file with the correct port numbers, and just re-run the vrouter.sh. It actually happens often since you are going to re-create Quagga containers to fix the Quagga config files and OVS increase port number whenever new port is added to a bridge. 

true
    "apps" : {
    
Code Block
linenumberstrue
    "devicesorg.onosproject.router" : {
        "of:00000000000000b1    "router" : {
            "basic    "controlPlaneConnectPoint" : "of:00000000000000b1/24",
                "ospfEnabled" : {"true",
                "driverinterfaces" : [ "b1-1", "softrouterb1-2" ]
            }
        }
    },
    "appsports" : {
        "org.onosproject.routerof:00000000000000b1/25" : {
            "routerinterfaces" : {[
                "controlPlaneConnectPoint" : "of:00000000000000b1/2",
{
                    "ospfEnabledname" : "trueb1-1",
                    "interfacesips"  : [ "b1-1", "b1-2172.18.0.254/24" ],
            }
        }
"mac"  :  },
"fe:00:00:00:00:01"
     "ports" : {
        " }
            ]
        },
        "of:00000000000000b1/31" : {
            "interfaces" : [
                {
                    "name" : "b1-12",
                    "ips"  : [ "172.1827.0.254/24" ],
                    "mac"  : "fe:00:00:00:00:01"
                }
            ]
        }
    }
  • Device id and port number with portName=quagga -> controlPlaneConnectPoint of vrouter.json
  • Port number with portName=quagga-router or any other uplink port(uplink port defined in sona.json if you have external router) -> ports of interface with 172.18.0.254/24 IP address.
  • Port number with portName=patch-rout -> ports of interface with 172.27.0.254/24, explain this interface later. Same port number goes to the hosts location with IP 172.27.0.1
    Once you modify vrouter.json, re-run the ONOS-vRouter.

 

...

,
    "hosts" : {
        "fe:00:00:00:00:02/-1" : {
            "basic": {
                "ips": ["172.27.0.1"],
                "location": "of:00000000000000b1/1"
            }
        }
    }

Line 11: Device ID and port number of the port with portName=quagga -> controlPlaneConnectPoint

Line 18: Device ID and port number of the port with portName=quagga-router or other actual uplink port

If you have a floating range, 172.27.0.0/24 in this example, check the following configurations also.

Line 27: (optional interface config for floating IP address range) Device ID and port number of the port with portName=patch-rout

Line 41: (optional interface config for floating IP gateway) Device ID and port number of the port with portName=patch-rout 

 

Once you fix the vrouter.json file, re-create onos-vrouter container with the updated configuration. vrouter.sh script takes care of removing the existing container.

Code Block
sona-setup$ vrouter.sh

 

8. If everything's right, check fpm-connectionshosts and routes172.18.0.1 is the external default gateway in this example. The host with IP address 172.27.0.1 is for the floating IP but routable from outside, which will explain later.

Code Block
onos> hosts
id=FA:00:00:00:00:01/None, mac=FA:00:00:00:00:01, location=of:00000000000000b1/25, vlan=None, ip(s)=[172.18.0.1]
id=FE:00:00:00:00:01/None, mac=FE:00:00:00:00:01, location=of:00000000000000b1/24, vlan=None, ip(s)=[172.18.0.254]
id=FE:00:00:00:00:02/None, mac=FE:00:00:00:00:02, location=of:00000000000000b1/1, vlan=None, ip(s)=[172.27.0.1], name=FE:00:00:00:00:02/None

onos> fpm-connections
172.17.0.2:52332 connected since 6m ago

onos> next-hops
ip=172.18.0.1, mac=FA:00:00:00:00:01, numRoutes=1

onos> routes
Table: ipv4
   Network            Next Hop
   0.0.0.0/0          172.18.0.1
   Total: 1

Table: ipv6
   Network            Next Hop
   Total: 0


Code Block
onos> openstack-nodes
hostname=compute-01, type=COMPUTE, managementIp=10.203.25.244, dataIp=10.134.34.222, intBridge=of:00000000000000a1, routerBridge=Optional.empty init=COMPLETE
hostname=compute-02, type=COMPUTE, managementIp=10.203.25.245, dataIp=10.134.34.223, intBridge=of:00000000000000a2, routerBridge=Optional.empty init=COMPLETE
hostname=gateway-01, type=GATEWAY, managementIp=10.203.198.125, dataIp=10.134.33.208, intBridge=of:00000000000000a3, routerBridge=Optional[of:00000000000000b1] init=COMPLETE
hostname=gateway-02, type=GATEWAY, managementIp=10.203.198.131, dataIp=10.134.33.209, intBridge=of:00000000000000a4, routerBridge=Optional[of:00000000000000b2] init=COMPLETE
Total 4 nodes

...