Configure Hosts in the Fabric

Typically ONOS can discover hosts via ARP or NDP (when using IPv6) or DHCP messages (when using dhcp-relay app) from the hosts.

In certain scenarios, it may be necessary to configure host information in ONOS via the 'netcfghostprovider' app. Assuming DHCP is not being used, and a host does not 'speak' via ARP or NDP,  ONOS would not know the location of this host until it speaks. At this point, if there is some other end-point trying to reach this host, traffic will be black-holed. Of course, one way to get around this is to always use a DHCP relay/server, so ONOS will become aware of the host IP as soon as the DHCP server assigns and acks the IP offer/request.

Another way - eg. in CORD - when an orchestrator is assigning IPs to hosts, it can additionally configure the host information in ONOS as well. This is done via the 'netcfghostprovider' app.

Host configuration via netcfg is shown below.

"hosts" : {
  "00:00:00:00:00:01/-1" : {
    "basic": {
      "ips": [""],
      "locations": ["of:0000000000000001/1"]

line 2: Host is identified by mac-address/vlan tuple. In this case vlan -1 means there's no vlan tag.
line 4: IP address of the host. There can be multiple IP addresses.
line 5: The switchport to which this host attaches is identified by device-id/port-number tuple.

Configure the Host Network Interface

Note that when you configure switch ports with subnet information, the hosts in these subnets also need to be configured with the same subnet information. This is irrespective of whether you expect the host to be discovered by ONOS, or you are configuring host information into ONOS (as described in the section above).

The user needs to ensure that the host routing table conforms to the switchport configuration. Consider the following example


  1. Configure the IP address and subnet mask

    Make sure the IP address and the subnet mask on the host network interface connected to the leaf (eg. eth1 in this example) is consistent with the switchport config on the fabric. 
    For example, if the fabric switchport is configured for the subnet and a gateway IP of, the interface 'eth1' on the host should have the following configuration. We assume the host-IP  in this example is on eth1

    ip addr add dev eth1
  2. Configure the default route in the host routing table

    Make sure the default route of the host is set via the gateway IP of the leaf switch interface it connects to.
    For example, you can run

    ip route add default via

    In this case, the host will try to reach all other dst-IPs outside its subnet ( via the gateway reachable via the device/interface eth1.


  3. Configure the management subnet

    Typically hosts also have a management interface (say eth0) that is accessible via a different management network that is different from the dataplane network (fabric). For example, assume the management interface (eth0) is, and a few other networks (say and  are reachable by the router ( on the management network.

    ip addr add dev mgmt0
    ip route add via
    ip route add via

    Note that with this config, host access to the internet happens via the dataplane intf ('eth1') not the management intf ('eth0'). Of course this means that the fabric should be connected to an external router to provide such access. The host routing table looks like this:


admin@h1:~$ netstat -nr

Kernel IP routing table

Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface         UG        0 0          0 eth1   U         0 0          0 eth1   UG        0 0          0 eth0 UG        0 0          0 eth0     U         0 0          0 eth0


host-config.jpg (image/jpeg)
image2017-9-1 15:27:29.png (image/png)