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