OpenDaylight Nuts & Bolts: First-Time Setup of the LFN DaNOS vRouter

With our hands deep into OpenDaylight, we support the community in many ways - project leadership, upstreaming code, bug fixes, and general Q&A. We regularly field questions from the community asking for our expert advice, input, or guidance on specific topics.

In support of this community innovation process, this week we’re delineating step-by-step instructions for first-time setup of the LFN DaNOS vRouter for use with OpenDaylight or our open source SDN controller, Lumina SDN Controller.

The information compiled here is based on months of collected production data across a wide range of use-cases. As this evolves over time, additional updates will be made, aligned to future project releases.

Please review and comment, or contact us to discuss further.

As a reminder, be careful when copying/pasting from a webpage to your console, as special characters like quotes and double-dashes tend to get translated between character sets.


1. Download the DaNOS .ISO from their LFN page
here.
  • Copy this to a normal Linux-KVM server.
    • Note: HW should be Intel CPU + NICs only, or using Linux bridges w/virtio support as shown here.
    • Note: Don't bother with VirtualBox -- its virtio drivers are notoriously incompatible w/normal drivers and Intel DPDK.
2. Use the virtinst package to conveniently create your KVM XML, vdisk, and start the VM (booting from the .iso the first time):

virt-install -v -n DaNOS1 --cpu host --vcpus=2 -r 2048 --disk path=/home/user1/DaNOS1.qcow2,bus=virtio,size=4 --cdrom /home/user1/danos-1908-amd64-vrouter.iso --graphics vnc,password=abcd1234,listen=0.0.0.0 --network bridge=br0,model=virtio --network bridge=br20,model=virtio

 

3. Now connect to the host+VM VNC console with any VNC client. (DaNOS is currently only shipping an interactive installation, so the goal is to complete this once and add a few crucial base-config elements):

  • Type "install image" at the prompt.
  • Press ENTER to accept all defaults, and make the password something obvious like "vyatta" or "admin" -- you're creating a base image to be reused here. You can configure proper security in the deployed configs.
    • Note: There's one "final" prompt where you have to change from the default response to Yes, so pay attention here.
  • Type "reboot" after the installation succeeds.
4. After a couple of minutes for the reboot to complete, you can "virsh console" to create a base config for the image.

Show interfaces

   #verify that two appear; if the first is not dp0s3 then rename it in the config below:

 

df -h 

  #verify mounts look okay

show log 

  #verify logs appear

cat /proc/cpuinfo 

  #verify both cores appear

 

cat /proc/meminfo

   #verify RAM looks right

show configuration commands | grep -v acm
  #view the stock config, slightly filtered

 

Here’s the set of default options you’ll want for all the instances you’ll create, so you can immediately mount them via netconf:

configure
set interfaces dataplane dp0s3 address dhcp
set service netconf
set service ssh port 830
set service ssh port 22
set system login user vyatta level superuser
exit
poweroff
y


5. The virt-install process will have removed the .iso entry from the KVM XML for you after a first successful reboot.Now make a copy of the qcow2 image that you can directly use in other environments (such as OpenStack, etc.), so you don't have to deal with the .iso file anymore. It's recommended to embed the DaNOS version in the filename, such as:

cp DaNOS1.qcow2 DaNOS-1908-clean.qcow2

Add this new qcow2 to your normal image repository for rapid reuse.
You won't need to use steps 1 through 5 above anymore; just deploy instances of this qcow2 image (OpenStack, KVM, etc.).
Just start from step 6-onward.

For example, on Linux KVM w/virtinst you can create new VM instances using a similar command as when using the .iso installer, except you’ll just import the pre-made qcow2:

virt-install -v -n DaNOS1 --cpu host --vcpus=2 -r 2048 --disk path=/home/user1/DaNOS1.qcow2,bus=virtio,size=4 --import --graphics vnc,password=abcd1234,listen=0.0.0.0 --network bridge=br0,model=virtio --network bridge=br20,model=virtio

You can still restart and use the original VM you created, too.

virsh start DaNOS1


OpenDaylight Netconf DaNOS setup:


6. Use Postman or curl to mount the vRouter to an OpenDaylight or Lumina SDN Controller (edit your values accordingly; controller password here is default admin/admin):

curl -X PUT \
http://192.168.1.128:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/DaNOS1 \
-H 'Accept: application/xml' \
-H 'Authorization: Basic YWRtaW46YWRtaW4=' \
-H 'Content-Type: application/xml' \
-H 'cache-control: no-cache' \
-d '<node xmlns="urn:TBD:params:xml:ns:yang:network-topology">
<node-id>DaNOS1</node-id>
<username xmlns="urn:opendaylight:netconf-node-topology">vyatta</username>
<password xmlns="urn:opendaylight:netconf-node-topology">vyatta</password>
<host xmlns="urn:opendaylight:netconf-node-topology">192.168.1.164</host>
<schema-cache-directory xmlns="urn:opendaylight:netconf-node-topology">DaNOS1</schema-cache-directory>
<port xmlns="urn:opendaylight:netconf-node-topology">830</port>
<tcp-only xmlns="urn:opendaylight:netconf-node-topology">false</tcp-only>
<schemaless xmlns="urn:opendaylight:netconf-node-topology">false</schemaless>
<max-connection-attempts xmlns="urn:opendaylight:netconf-node-topology">0</max-connection-attempts>
<connection-timeout-millis xmlns="urn:opendaylight:netconf-node-topology">20000</connection-timeout-millis>
<default-request-timeout-millis xmlns="urn:opendaylight:netconf-node-topology">60000</default-request-timeout-millis>
<sleep-factor xmlns="urn:opendaylight:netconf-node-topology">1.1</sleep-factor>
<between-attempts-timeout-millis xmlns="urn:opendaylight:netconf-node-topology">2000</between-attempts-timeout-millis>
<reconnect-on-changed-schema xmlns="urn:opendaylight:netconf-node-topology">false</reconnect-on-changed-schema>
<keepalive-delay xmlns="urn:opendaylight:netconf-node-topology">60</keepalive-delay>
<concurrent-rpc-limit xmlns="urn:opendaylight:netconf-node-topology">0</concurrent-rpc-limit>
<actor-response-wait-time xmlns="urn:opendaylight:netconf-node-topology">300</actor-response-wait-time>
</node>'


Postman:
http://:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/
Accept:application/xml
Content-Type:application/xml
Authorization:Basic YWRtaW46YWRtaW4=
<node xmlns="urn:TBD:params:xml:ns:yang:network-topology">
<node-id></node-id>
<username xmlns="urn:opendaylight:netconf-node-topology"></username>
<password xmlns="urn:opendaylight:netconf-node-topology"></password>
<host xmlns="urn:opendaylight:netconf-node-topology">0</host>
<schema-cache-directory xmlns="urn:opendaylight:netconf-node-topology"></schema-cache-directory>
<port xmlns="urn:opendaylight:netconf-node-topology">0</port>
<tcp-only xmlns="urn:opendaylight:netconf-node-topology">false</tcp-only>
<schemaless xmlns="urn:opendaylight:netconf-node-topology">false</schemaless>
<max-connection-attempts xmlns="urn:opendaylight:netconf-node-topology">0</max-connection-attempts>
<connection-timeout-millis xmlns="urn:opendaylight:netconf-node-topology">20000</connection-timeout-millis>
<default-request-timeout-millis xmlns="urn:opendaylight:netconf-node-topology">60000</default-request-timeout-millis>
<sleep-factor xmlns="urn:opendaylight:netconf-node-topology">1.1</sleep-factor>
<between-attempts-timeout-millis xmlns="urn:opendaylight:netconf-node-topology">2000</between-attempts-timeout-millis>
<reconnect-on-changed-schema xmlns="urn:opendaylight:netconf-node-topology">false</reconnect-on-changed-schema>
<keepalive-delay xmlns="urn:opendaylight:netconf-node-topology">60</keepalive-delay>
<concurrent-rpc-limit xmlns="urn:opendaylight:netconf-node-topology">0</concurrent-rpc-limit>
<actor-response-wait-time xmlns="urn:opendaylight:netconf-node-topology">300</actor-response-wait-time>
</node>


7. Check the mount status:
curl -X GET \
http://192.168.1.128:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/ \
-H 'Accept: application/xml' \
-H 'Authorization: Basic YWRtaW46YWRtaW4= \
-H 'Content-Type: application/xml' \
-H 'cache-control: no-cache'

Postman:
GET http://:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/


8. From this point onward, you're ready to configure the DaNOS vRouter as normal.You can choose to configure via CLI and GET the whole config via Postman (in order to determine what the relevant URLs & payloads should look like for DaNOS), or you can use RestDOC API Explorer in ODL/LSC.

GET whole config URL:
http://:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node//yang-ext:mount/

Headers: GET whole config in XML:
Accept:application/xml
Content-Type:application/xml
Authorization:Basic YWRtaW46YWRtaW4=

Headers: GET whole config in JSON:
Accept:application/json
Content-Type:application/json
Authorization:Basic YWRtaW46YWRtaW4=

PUTs and DELETEs work on the same path as the GETs; just change the HTTP Method.


RestDoc API Explorer:
http://0:0/apidoc/explorer/index.html
NOTE: takes a couple of minutes to load in Chrome/browser, since the entire set of models is rendered in-browser.


Check https://www.luminanetworks.com/ for additional articles showing various functional use-case configurations, or to set up a quick working/tutorial session with one of our NetDev engineers.



ADDENDUM:
Linux bridging example on Ubuntu 16.04:

cat /etc/network/interfaces:
# This bridges the primary mgmt-network interface p3p1 for use by VM mgmgt vNICs.
auto p3p1
auto br0
iface br0 inet static
bridge_ports p3p1
bridge_stp off
bridge_fd 0
bridge_maxwait 0
address 192.168.1.19
network 192.168.1.0
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameserver 192.168.1.1
up /sbin/ifconfig $IFACE up || /bin/true

# This intf is for dataplane interfaces (although you could easily have separate named bridges for each).
auto eth0
auto eth0.20 eth0.30 eth0.40
auto br20
iface br20 inet static
bridge_ports eth0.20 eth1.20 eth2.20 eth3.20
bridge_stp off
bridge_fd 0
bridge_maxwait 0
address 10.0.20.19
network 10.0.20.0
netmask 255.255.255.0
broadcast 10.0.20.255
up /sbin/ifconfig $IFACE up || /bin/true

#Note: Don't forget to consider sysctl values for IP forwarding and bridge forwarding/filtering. Disable/Enable each to suit your needs.


For commercially-supported OpenDaylight, contact sales@luminanetworks.com or submit your questions at https://www.luminanetworks.com/contactus.

For commercially-supported DaNOS, see https://www.ipinfusion.com/danos-vyatta-edition/.


Other related blogs in our series: