Charles Chan | 9e5c617 | 2019-09-07 11:24:54 -0700 | [diff] [blame^] | 1 | Address Assignment |
| 2 | ================== |
| 3 | |
| 4 | .. tip:: |
| 5 | We strongly recommend you to setup DHCP relay and configure the hosts to **obtain address via DHCP**. |
| 6 | |
| 7 | DHCP Relay |
| 8 | ---------- |
| 9 | |
| 10 | |
| 11 | Static IP |
| 12 | --------- |
| 13 | Although we strongly recommend to use `DHCP Relay`_ for IP assignment, |
| 14 | it is also possible to statically configure the IP address and route on the host. |
| 15 | |
| 16 | 1. **Configure the IP address and subnet mask** |
| 17 | |
| 18 | Make sure the IP address and the subnet mask on the fabric network interface of the host is consistent with |
| 19 | the information in the Network Configuration section. For example, you can run |
| 20 | |
| 21 | .. code-block:: console |
| 22 | |
| 23 | # ip addr add 10.0.0.1/24 dev mlx0 |
| 24 | |
| 25 | 2. **Configure the default route** |
| 26 | |
| 27 | Make sure you change the default route of the host to the interface IP of the leaf switch it connects to. |
| 28 | For example, you can run |
| 29 | |
| 30 | .. code-block:: console |
| 31 | |
| 32 | # ip route add default via 10.0.0.254 |
| 33 | |
| 34 | .. note:: |
| 35 | In the case that you want to keep default route through the management network, |
| 36 | you need to add routes to all other subnets in the network one by one. |
| 37 | |
| 38 | 3. **Trigger host learning** |
| 39 | |
| 40 | We need to let ONOS learn the host in order to program corresponding flows and groups. |
| 41 | This is automatically done as part of the DHCP process. |
| 42 | However, we need to manually triggers it by sending an ARP or ND packet if the host is configured to use static IP. |
| 43 | |
| 44 | .. code-block:: console |
| 45 | |
| 46 | # arping -c 1 ${GATEWAY_IP} |
| 47 | |
| 48 | .. code-block:: console |
| 49 | |
| 50 | # ndsend ${HOST_IP} ${INTF} |