Versions Compared

Key

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

...

Code Block
languagebash
$ git clone https://github.com/hyunsun/sona-setup.git
$ cd sona-setup

 

4.  The first container is ONOS-vRouter. Refer to the guide(SONA Network Configuration Guide) and write a network configuration for vRouter. Name it vrouter.json, place under sona-setup and run vrouter.sh script, which brings up ONOS container with vRouter application activated. There's a sample named "vrouter.json" under "sona-setup", and note that you don't need to care about all the port numbers at this time (just leave it as it is in the sample file). We're going to fix the port numbers later in Step 7. Just check out the IP, MAC addresses, and also the eth0 interface IP address of the container. These are required to configure Quagga container.At first, write config file for setting up gateway node. Name it vRouterConfig.ini, place under sona-setup.

Code Block
[DEFAULT]
routerBridge = "of:00000000000000b1" #Unique device ID of the router bridge
floatingCidr = "172.27.0.0/24" #Floating IP ranges
dummyHostIp = "172.27.0.1" #Gateway IP address of the floating IP subnet 
quaggaMac = "fe:00:00:00:00:01" #Quagga MAC address
quaggaIp = "172.18.0.254/30" #Quagga instance IP address
gatewayName = "gateway-01" #Quagga instance name
bgpNeighborIp = "172.18.0.253/30" #IP address of the external BGP router that quagga instance peered to
asNum = 65101 #AS number of Quagga instance
peerAsNum = 65100 #AS number of external BGP router
uplinkPortNum = "26" #Port number of uplink interface

5. Next, run createJsonAndvRouter.sh which automatically create vrouter.json and runs ONOS container with vRouter application activated.

Code Block
sona-setup$ ./createJsonAndvRouter.sh
sona-setup$ sudo docker ps
CONTAINER ID        IMAGE
Code Block
# edit vrouter.json
sona-setup$ vrouter.sh
sona-setup$ sudo docker ps
CONTAINER ID        IMAGE                  COMMAND                  CREATED             STATUS              PORTS          COMMAND                  CREATED        NAMES
e5ac67e62bbb     STATUS   onosproject/onos:1.6   "./bin/onos-service"     9 days ago PORTS         Up 9 days           6653/tcp,               NAMES
e5ac67e62bbb        onosproject/onos:1.6   "./bin/onos-service"     9 days ago          Up 9 days           6653/tcp, 8101/tcp, 8181/tcp, 9876/tcp   onos-vrouter

 5

6. Next, edit run createQuagga.sh which automatically create 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

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.253 remote-as 65100
  neighbor 172.18.0.253 ebgp-multihop
  neighbor 172.18.0.253 timers connect 5
  neighbor 172.18.0.253 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

Note that the FPM connection IP should be the ONOS-vRouter container's eth0 IP address. Docker increments the IP address whenever a new container created, so normally it would be 172.17.0.2 but if you have problem with FPM connection later, please check this IP is correct.

 

Code Block
languagebash
$ ./quagga.sh --name=gateway-01 --ip=172.18.0.254/30 --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. 

 

...

, update vrouter.json and run Quagga container based on those config files.

Code Block
sona-setup$ ./createQuagga.sh
sona-setup$ sudo docker ps
CONTAINER ID        IMAGE                  COMMAND                  CREATED             STATUS              PORTS                                    NAMES
978dadf41240        onosproject/onos:1.6   "./bin/onos-service"     11 hours ago        Up 11 hours         6653/tcp, 8101/tcp, 8181/tcp, 9876/tcp   onos-vrouter
5bf4f2d59919        hyunsun/quagga-fpm     "/usr/bin/supervisord"   11 hours ago        Up 11 hours         179/tcp, 2601/tcp, 2605/tcp              gateway-01
 
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.253 remote-as 65100
  neighbor 172.18.0.253 ebgp-multihop
  neighbor 172.18.0.253 timers connect 5
  neighbor 172.18.0.253 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

Note that the FPM connection IP should be the ONOS-vRouter container's eth0 IP address. Docker increments the IP address whenever a new container created, so normally it would be 172.17.0.2 but if you have problem with FPM connection later, please check this IP is correct.

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

 

Code Block
sona-setup$ sudo ovs-ofctl show br-router
OFPT_FEATURES_REPLY (xid=0x2): dpid:00000000000000b1
n_tables:254, n_buffers:256
capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst
 1(patch-rout): addr:1a:46:69:5a:8e:f6
     config:     0
     state:      0
     speed: 0 Mbps now, 0 Mbps max
 2(quagga): addr:7a:9b:05:57:2c:ff
     config:     0
     state:      0
     current:    10GB-FD COPPER
     speed: 10000 Mbps now, 0 Mbps max

 LOCAL(br-router): addr:1a:13:72:57:4a:4d
     config:     PORT_DOWN
     state:      LINK_DOWN
     speed: 0 Mbps now, 0 Mbps max
OFPT_GET_CONFIG_REPLY (xid=0x4): frags=normal miss_send_len=0


 

7. If there's no external router or emulation of it in your setup, add another Quagga container which acts as an external router. You can just run createQuaggaRouter.sh which automatically volumes/gateway/zebra.conf and volumes/gateway/bgpd.conf, modify vrouter.json and vRouterConfig.ini, and run Quagga router instance.

Code Block
sona-setup$ ./createQuaggaRouter.sh
sona-setup$ sudo docker ps

CONTAINER ID        IMAGE                  COMMAND                  CREATED             STATUS              PORTS                                    NAMES
978dadf41240        onosproject/onos:1.6   "./bin/onos-service"     11 hours ago        Up 11 hours         6653/tcp, 8101/tcp, 8181/tcp, 9876/tcp   onos-vrouter
32b10a038d78        hyunsun/quagga-fpm     "/usr/bin/supervisord"   11 hours ago        Up 11 hours         179/tcp, 2601/tcp, 2605/tcp              router-01
5bf4f2d59919        hyunsun/quagga-fpm     "/usr/bin/supervisord"   11 hours ago        Up 11 hours         179/tcp, 2601/tcp, 2605/tcp              gateway-01
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.253
  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 
Code Block
titlevolumes/router/zebra.conf
!
hostname router-01
password zebra
!
Code Block
languagebash
$ ./quagga.sh --name=router-01 --ip=172.18.0.253/30 --mac=fa:00:00:00:00:01 --external-router

 

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

...