Environment: ONOS tutorial OVA (Ubuntu Xenial ONOS 1.15.0)
The OVA can be downloaded here: https://wiki.onosproject.org/display/ONOS/Basic+ONOS+Tutorial
1. Checkout SDN-IP tutorial codes under home directory:
$ svn export https://github.com/opennetworkinglab/onos/trunk/tools/tutorials/sdnip
2. Install bridge utilities:
$ sudo apt install bridge-utils
2. Install Quagga package:
$ sudo apt-get install quagga
3. Check the followings and adjust as required before running tutorial.py :
a. run directory /var/run/quagga exists
b. binary of zebra and bgpd installed under /usr/lib/quagga
4. As VM host has 10.0.2.0 assigned, IP subnets 10.0.x.x need to be changed to say 10.1.x.x. All relevant files in ~/sdnip should be changed accordingly.
$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.0.2.2 0.0.0.0 UG 0 0 0 enp0s3
10.0.2.0 0.0.0.0 255.255.255.0 U 0 0 0 enp0s3
5. To peer Mininet host root 10.10.10.2 with onos-1, the latter should be assigned another IP say 10.10.10.3. File ~/sdnip/configs/quagga-sdn.conf should be changed accordingly:
neighbor 10.10.10.3 remote-as 65000
neighbor 10.10.10.3 port 2000
neighbor 10.10.10.3 timers connect 5
6. Create docker bridge:
$ docker network create --subnet 10.10.10.0/24 --ip-range 10.10.10.0/24 sdnip
7. Note name of bridge created:
$ sudo brctl show
bridge name bridge id STP enabled interfaces
br-fb2a5d5b6f8e 8000.02428d00da0a no veth71fb89a
docker0 8000.024231751c7f no veth1289400
veth46bdbff
veth8b25d1d
veth8c5706a
vethad2fb3e
vethbb09655
8. Attach onos-1 to docker bridge:
$ docker network connect --ip 10.10.10.3 sdnip onos-1
9. Verify additional network interface is created for onos-1:
$ docker exec onos-1 ifconfig -a
10. Run tutorial.py as follows:
$ sudo mn --custom /home/sdn/sdnip/tutorial.py --topo sdnip --controller remote,172.17.0.5 --nolistenport
11. Add mininet host root to docker bridge:
$ sudo brctl addif br-fb2a5d5b6f8e root-eth0
12. Upload network configuration to onos-1:
$ curl --user onos:rocks -X POST -H "Content-Type: application/json" http://172.17.0.5:8181/onos/v1/network/configuration/ -d @/home/sdn/sdnip/configs/network-cfg.json
13. Activate ONOS application required:
onos> app activate org.onosproject.config
onos> app activate org.onosproject.proxyarp
onos> app activate org.onosproject.sdnip
14. Check BGP details:
onos> bgp-speakers
speaker1: port=of:00000000000000a3/1, vlan=None, peers=[10.1.1.1, 10.1.2.1, 10.1.3.1, 10.1.4.1]
onos> bgp-neighbors
BGP neighbor is 10.10.10.1, remote AS 65000, local AS 65000
Remote router ID 10.10.10.1, IP /10.10.10.1:47348, BGP version 4, Hold time 9
Remote AFI/SAFI IPv4 Unicast YES Multicast NO, IPv6 Unicast NO Multicast NO
Local router ID 10.10.10.3, IP /10.10.10.3:2000, BGP version 4, Hold time 9
Local AFI/SAFI IPv4 Unicast YES Multicast NO, IPv6 Unicast NO Multicast NO
4 Octet AS Capability: Advertised Received
onos> bgp-routes
Network Next Hop Origin LocalPref MED BGP-ID
192.168.3.0/24 10.1.3.1 IGP 100 0 10.10.10.1
AsPath 65003
192.168.2.0/24 10.1.2.1 IGP 100 0 10.10.10.1
AsPath 65002
192.168.1.0/24 10.1.1.1 IGP 100 0 10.10.10.1
AsPath 65001
Total BGP IPv4 routes = 3
Network Next Hop Origin LocalPref MED BGP-ID
Total BGP IPv6 routes = 0
15.