Charles Chan | fcfe890 | 2022-02-02 17:06:27 -0800 | [diff] [blame] | 1 | .. SPDX-FileCopyrightText: 2021 Open Networking Foundation <info@opennetworking.org> |
| 2 | .. SPDX-License-Identifier: Apache-2.0 |
| 3 | |
Wailok Shum | bb7408b | 2021-09-30 22:41:32 +0800 | [diff] [blame] | 4 | DHCP Relay |
| 5 | ========== |
| 6 | |
| 7 | .. tip:: |
| 8 | We strongly recommend you to setup DHCP relay and configure the hosts to |
| 9 | **obtain address via DHCP**. |
| 10 | |
| 11 | See `Alternative: Configure static IP`_ if you want to statically configure |
| 12 | IP address on each host. |
| 13 | |
| 14 | Overview |
| 15 | -------- |
| 16 | The DHCP relay app used in SD-Fabric is an L3 relay. |
| 17 | |
| 18 | That is, it support relaying DHCP packets from/to a server that's not in the |
| 19 | same subnet of the client. |
| 20 | |
| 21 | Here's a list of features supported: |
| 22 | |
| 23 | - DHCPv4 and DHCPv6 |
| 24 | |
| 25 | - DHCP server directly attached to fabric leaves, or indirectly connected via |
| 26 | upstream router |
| 27 | |
| 28 | - DHCP client directly attached to fabric leaves, or indirectly connected via |
| 29 | `LDRA (Light-weight DHCP Relay Agent) <https://tools.ietf.org/html/rfc6221>`_ |
| 30 | |
| 31 | - Multiple DHCP servers for HA |
| 32 | |
| 33 | .. note:: |
| 34 | Please pay attention to the definition of **direct/indirect server/client**. |
| 35 | You will find them many times later in this section. |
| 36 | |
| 37 | Configure DHCP Relay |
| 38 | -------------------- |
| 39 | |
| 40 | Server directly connected to fabric |
| 41 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 42 | |
| 43 | .. image:: ../../images/config-dhcp.png |
| 44 | |
| 45 | In this case, the configuration involves first configuring the switch interface |
| 46 | with the VLAN/subnet the DHCP service is part of. |
| 47 | |
| 48 | For example, if I have a switch ``of:205`` with a DHCP server on port 24 on |
| 49 | VLAN 20, the port config looks like: |
| 50 | |
| 51 | .. code-block:: json |
| 52 | |
| 53 | { |
| 54 | "ports": { |
| 55 | "of:0000000000000205/24" : { |
| 56 | "interfaces" : [ { |
| 57 | "name" : "dhcp-server-intf", |
| 58 | "ips" : [ "10.0.2.254/24", "2001:db8:1::254/64" ], |
| 59 | "vlan-tagged" : [ 20 ] |
| 60 | } ] |
| 61 | } |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | A second part of the configuration for the DHCP relay app requires a json |
| 66 | configuration under the key apps: |
| 67 | |
| 68 | .. code-block:: json |
| 69 | |
| 70 | { |
| 71 | "apps" : { |
| 72 | "org.onosproject.dhcp-relay" : { |
| 73 | "default" : [ |
| 74 | { |
| 75 | "dhcpServerConnectPoint": "of:0000000000000205/24", |
| 76 | "serverIps": ["10.0.2.253", "2001:db8:2::2"] |
| 77 | } |
| 78 | ] |
| 79 | } |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | Note that the ``dhcprelay`` app is configured with location of the DHCP server (the |
| 84 | switch port to which it is connected to the fabric). |
| 85 | |
| 86 | It is also configured with the DHCP server IP, but it is no longer necessary to |
| 87 | configure the MAC address of the server. |
| 88 | |
| 89 | ONOS will automatically learn the MAC and VLAN corresponding to the ``serverIP``. |
| 90 | |
| 91 | |
| 92 | Server reachable via external router |
| 93 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 94 | In this case, it is actually the external router that is directly connected to |
| 95 | the fabric. |
| 96 | |
| 97 | This external router is already configured in the ports section of |
| 98 | network-config (for vRouter functionality). |
| 99 | |
| 100 | For example, if the external router is connected to switch ``of:205`` on port 1 |
| 101 | |
| 102 | .. code-block:: json |
| 103 | |
| 104 | { |
| 105 | "ports": { |
| 106 | "of:0000000000000205/1" : { |
| 107 | "interfaces" : [ { |
| 108 | "ips" : [ "192.168.101.2/30", "2000::c0a8:6402/120" ], |
| 109 | "mac" : "a2:9b:32:9d:7f:b3", |
| 110 | "name" : "internet-router" |
| 111 | } ] |
| 112 | } |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | As before the ``ips`` and ``mac`` configured on port 1, actually correspond to |
| 117 | the addresses configured in Quagga. |
| 118 | |
| 119 | The app config in this case, includes an additional field necessary to inform |
| 120 | the ``dhcprelay`` app of the ``gatewayIP`` through which the DHCP server can be |
| 121 | reached. |
| 122 | |
| 123 | .. code-block:: json |
| 124 | |
| 125 | { |
| 126 | "apps" : { |
| 127 | "org.onosproject.dhcp-relay" : { |
| 128 | "default" : [ |
| 129 | { |
| 130 | "dhcpServerConnectPoint": "of:0000000000000205/1", |
| 131 | "serverIps": ["10.0.2.253", "2001:db8:2::2"], |
| 132 | "gatewayIps": ["192.168.101.1", "1000::100:1"] |
| 133 | } |
| 134 | ] |
| 135 | } |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | .. note:: |
| 140 | Note that the ``dhcpserverConnectPoint`` should now be the switch port to |
| 141 | which the external router is connected to the fabric. |
| 142 | |
| 143 | Setup DHCP server |
| 144 | ----------------- |
| 145 | |
| 146 | Install DHCP server |
| 147 | ^^^^^^^^^^^^^^^^^^^ |
| 148 | |
| 149 | Modern DHCP servers should support relayed DHCP request. |
| 150 | However, the way to configure them are probably different case to case. |
| 151 | Here we use **isc-dhcp-server** on Ubuntu as an example. |
| 152 | To install the DHCP server, simply run: |
| 153 | |
| 154 | .. code-block:: console |
| 155 | |
| 156 | $ sudo apt-get install isc-dhcp-server |
| 157 | |
| 158 | |
| 159 | Configure DHCP Server |
| 160 | ^^^^^^^^^^^^^^^^^^^^^ |
| 161 | |
| 162 | Two configuration files are required by DHCP server. |
| 163 | |
| 164 | First, we need to specify which network interface the DHCP server should listen on. |
| 165 | To do that, we need to modify ``/etc/default/isc-dhcp-server`` and change the following line. |
| 166 | |
| 167 | .. code-block:: text |
| 168 | |
| 169 | INTERFACES="eth1" |
| 170 | |
| 171 | Next, we need to specify the subnet we want to lease. |
| 172 | To do that, we need to modify ``/etc/dhcp/dhcpd.conf`` and add the following lines. |
| 173 | |
| 174 | Note that the subnet of ``eth1`` needs to be included. |
| 175 | |
| 176 | Otherwise, the DHCP server will not listen to the interface even though we have |
| 177 | specified that in ``/etc/default/isc-dhcp-server``. |
| 178 | |
| 179 | .. code-block:: text |
| 180 | |
| 181 | subnet 10.0.1.0 netmask 255.255.255.0 { |
| 182 | range 10.0.1.1 10.0.1.240; |
| 183 | option routers 10.0.1.254; |
| 184 | } |
| 185 | |
| 186 | # A subnet that matches the interface IP address is required by isc-dhcp-server |
| 187 | subnet 10.0.2.0 netmask 255.255.255.0 { |
| 188 | range 10.0.2.1 10.0.2.240; |
| 189 | option routers 10.0.2.254; |
| 190 | } |
| 191 | |
| 192 | It's similar to configure DHCPv6. |
| 193 | |
| 194 | .. code-block:: text |
| 195 | |
| 196 | subnet6 2001:db8:1::/64 { |
| 197 | # Range for clients |
| 198 | range6 2001:db8:1::129 2001:db8:1::250; |
| 199 | |
| 200 | # Range for clients requesting a temporary address |
| 201 | range6 2001:db8:1::/64 temporary; |
| 202 | } |
| 203 | # A subnet that matches the interface IP address is required by isc-dhcp-server |
| 204 | subnet6 2001:db8:2::/64 { |
| 205 | # Range for clients |
| 206 | range6 2001:db8:2::129 2001:db8:2::254; |
| 207 | |
| 208 | # Range for clients requesting a temporary address |
| 209 | range6 2001:db8:2::/64 temporary; |
| 210 | |
| 211 | # Prefix range for delegation to sub-routers |
| 212 | prefix6 2001:db8:1:: 2001:db8:10:: /56; |
| 213 | |
| 214 | } |
| 215 | |
| 216 | Finally, restart the DHCP server. |
| 217 | |
| 218 | .. code-block:: console |
| 219 | |
| 220 | $ sudo service isc-dhcp-server restart |
| 221 | |
| 222 | Testing |
| 223 | ------- |
| 224 | |
| 225 | The host should be able to obtain an IP address from the pool we specified. |
| 226 | Try to run ``dhclient`` and see if the host can get an IP address. |
| 227 | |
| 228 | .. code-block:: console |
| 229 | |
| 230 | sudo dhclient eth1 |
| 231 | |
| 232 | It's similar to test DHCPv6 |
| 233 | |
| 234 | .. code-block:: console |
| 235 | |
| 236 | sudo dhclient -6 -N eth1 # for obtaining ip address |
| 237 | sudo dhclient -6 -P -N eth1 # for obtaining ip address and prefix together |
| 238 | |
| 239 | sudo dhclient -6 -r eth1 # for releasing ip address |
| 240 | sudo dhclient -6 -P -r eth1 # for releasing prefix |
| 241 | |
| 242 | |
| 243 | If something goes wrong, check ``/var/log/syslog`` for DHCP server log and run |
| 244 | ``tcpdump`` on DHCP server to see if the DHCP packets from the host reach the |
| 245 | server correctly. |
| 246 | |
| 247 | Additional Features |
| 248 | ------------------- |
| 249 | |
| 250 | DHCP Relay store |
| 251 | ^^^^^^^^^^^^^^^^ |
| 252 | |
| 253 | DHCP relay application stores information from DHCP packet which processed by |
| 254 | the app, administrator can use CLI command ``dhcp-relay`` to query these |
| 255 | information. |
| 256 | |
| 257 | The store provides these functionality: |
| 258 | |
| 259 | - Latest state of DHCP client (e.g. client location, last seen time, DHCP |
| 260 | type...), for debugging purpose |
| 261 | |
| 262 | - For direct host, ONOS can find location and VLAN from relay agent option, |
| 263 | however, for indirect host, ONOS need to query last state from the store to |
| 264 | find correct destination. |
| 265 | |
| 266 | |
| 267 | DHCPv6 Relay counter |
| 268 | ^^^^^^^^^^^^^^^^^^^^ |
| 269 | There are two DHCPv6 packet counters which are Host basis counters and Global counters. |
| 270 | |
| 271 | Host basis counters count and record DHCPv6 packets received on this host. |
| 272 | |
| 273 | It can be displayed by ``dhcp-relay counter``. These counters can be reset by |
| 274 | typing ``dhcp-relay counter reset``. |
| 275 | |
| 276 | .. code-block:: console |
| 277 | |
| 278 | onos> dhcp-relay counter |
| 279 | DHCP Relay Counters : |
| 280 | Counters for id=00:AA:BB:00:00:01/None, locations=[of:0000000000000204/3] |
| 281 | SOLICIT ............................ 4 packets |
| 282 | REQUEST ............................ 4 packets |
| 283 | ADVERTISE ............................ 4 packets |
| 284 | RENEW ............................ 1000 packets |
| 285 | REPLY ............................ 1004 packets |
| 286 | Counters for id=00:AA:00:00:00:01/None, locations=[of:0000000000000205/3][D] |
| 287 | SOLICIT ............................ 2 packets |
| 288 | REQUEST ............................ 2 packets |
| 289 | ADVERTISE ............................ 2 packets |
| 290 | RENEW ............................ 500 packets |
| 291 | CONFIRM ............................ 2 packets |
| 292 | REPLY ............................ 500 packets |
| 293 | |
| 294 | onos> dhcp-relay counter reset |
| 295 | |
| 296 | Global counters counts and records all DHCPv6 packets received in ONOS. |
| 297 | |
| 298 | It can be displayed by ``dhcp-relay-agg-counters``. These counters can be reset |
| 299 | by typing ``dhcp-relay-agg-counters reset``. |
| 300 | |
| 301 | .. code-block:: console |
| 302 | |
| 303 | onos> dhcp-relay-agg-counters |
| 304 | DHCP Relay Aggregate Counters : |
| 305 | SOLICIT ............................ 12 packets |
| 306 | REQUEST ............................ 12 packets |
| 307 | ADVERTISE ............................ 12 packets |
| 308 | REBIND ............................ 4 packets |
| 309 | RENEW ............................ 3026 packets |
| 310 | CONFIRM ............................ 4 packets |
| 311 | REPLY ............................ 3044 packets |
| 312 | |
| 313 | onos> dhcp-relay-agg-counters reset |
| 314 | |
| 315 | |
| 316 | Indirect client support |
| 317 | ^^^^^^^^^^^^^^^^^^^^^^^ |
| 318 | DHCP relay can support hosts which do not directly connect to SD-Fabric. |
| 319 | |
| 320 | These hosts usually connected to another LDRA, the LDRA will forward DHCP |
| 321 | packet to/from SD-Fabric. |
| 322 | |
| 323 | For **DHCPv4**, packets from the LDRA includes a valid DHCP relay agent option |
| 324 | (option 82). |
| 325 | |
| 326 | DHCP Relay application checks relay agent option and determine the DHCP packet |
| 327 | comes from direct or indirect host. |
| 328 | |
| 329 | .. image:: ../../images/config-dhcp-indirect.jpg |
| 330 | |
| 331 | ONOS uses circuit id option in relay agent option with specific format if DHCP |
| 332 | packet comes without relay agent option, the format of circuit will be: |
| 333 | ``ConnectPoint:VlanId`` |
| 334 | |
| 335 | For example, the DHCP request/discover packet comes from |
| 336 | ``of:000000000000001/1`` with ``VLAN 100``, the circuit ONOS put will be |
| 337 | ``of:000000000000001/1:100`` and send DHCP packet to DHCP server. |
| 338 | |
| 339 | Indirect host won't put into host store. DHCP relay app will put IP address of |
| 340 | indirect host to the route store, and use IP address of relay agent as next |
| 341 | hop. |
| 342 | |
| 343 | **DHCPv6** clients will be handled similar to DHCPv4. |
| 344 | |
| 345 | One major difference is that DHCPv6 supports ``RELAY-FORWARD`` message type and |
| 346 | ``InterfaceId`` option natively, so we utilize those fields to encode |
| 347 | information. |
| 348 | |
| 349 | Overwrite relay agent IP |
| 350 | ^^^^^^^^^^^^^^^^^^^^^^^^ |
| 351 | |
| 352 | The DHCP relay can overwrite the relay agent address (``giaddr`` in **DHCPv4**, |
| 353 | ``link-addr`` in **DHCPv6**) in DHCP message for different device. |
| 354 | |
| 355 | If ``relayAgentIps`` is configured, the app will overwrite ``giaddr`` or |
| 356 | ``link-addr`` before it forward the DHCP message to the server. |
| 357 | |
| 358 | Otherwise, it will retain the original relay agent IP. |
| 359 | |
| 360 | An example configuration is shown below: |
| 361 | |
| 362 | .. code-block:: json |
| 363 | |
| 364 | { |
| 365 | "apps" : { |
| 366 | "org.onosproject.dhcprelay" : { |
| 367 | "default": [{ |
| 368 | "dhcpServerConnectPoint": "of:0000000000000002/2", |
| 369 | "serverIps": ["172.168.10.2", "2000::200:1"], |
| 370 | "gatewayIps": ["192.168.10.254", "1000::100:1"], |
| 371 | "relayAgentIps": { |
| 372 | "of:0000000000000001": { |
| 373 | "ipv4": "10.0.0.10", |
| 374 | "ipv6": "2000::10" |
| 375 | }, |
| 376 | "of:0000000000000002": { |
| 377 | "ipv4": "10.0.1.10", |
| 378 | "ipv6": "2000::1:10" |
| 379 | } |
| 380 | } |
| 381 | }] |
| 382 | } |
| 383 | } |
| 384 | } |
| 385 | |
| 386 | |
| 387 | Configure multiple servers |
| 388 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 389 | |
| 390 | DHCP server HA can be achieved by specifying additional server configuration |
| 391 | objects. |
| 392 | |
| 393 | Client initiated packets like ``SOLICIT`` or ``REBIND`` shall be replicated and |
| 394 | sent to all server objects. |
| 395 | |
| 396 | Below is an example of multiple server configuration: |
| 397 | |
| 398 | .. code-block:: json |
| 399 | |
| 400 | { |
| 401 | "apps" : { |
| 402 | "org.onosproject.dhcprelay" : { |
| 403 | "default": [ |
| 404 | { |
| 405 | "dhcpServerConnectPoint": "of:0000000000000205/5", |
| 406 | "serverIps": ["10.0.3.252", "2002:4::253"], |
| 407 | "gatewayIps": ["10.0.3.100","2001:3::100"], |
| 408 | "relayAgentIps": { |
| 409 | "of:0000000000000204": { |
| 410 | "ipv4": "10.0.2.254", |
| 411 | "ipv6": "2001:2::254" |
| 412 | } |
| 413 | } |
| 414 | }, |
| 415 | { |
| 416 | "dhcpServerConnectPoint": "of:0000000000000206/3", |
| 417 | "serverIps": ["2002:5::253"], |
| 418 | "gatewayIps": ["2001:4::100"], |
| 419 | "relayAgentIps": { |
| 420 | "of:0000000000000204": { |
| 421 | "ipv4": "10.0.2.254", |
| 422 | "ipv6": "2001:2::254" |
| 423 | } |
| 424 | } |
| 425 | } |
| 426 | ], |
| 427 | "indirect": [ |
| 428 | { |
| 429 | "dhcpServerConnectPoint": "of:0000000000000205/5", |
| 430 | "serverIps": ["10.0.3.252", "2002:4::253"], |
| 431 | "gatewayIps": ["10.0.3.100", "2001:3::100"], |
| 432 | "relayAgentIps": { |
| 433 | "of:0000000000000204": { |
| 434 | "ipv4": "10.0.2.254", |
| 435 | "ipv6": "2001:2::254" |
| 436 | } |
| 437 | } |
| 438 | }, |
| 439 | { |
| 440 | "dhcpServerConnectPoint": "of:0000000000000205/5", |
| 441 | "serverIps": ["10.0.3.252", "2002:5::253"], |
| 442 | "gatewayIps": ["10.0.3.100", "2001:3::100"], |
| 443 | "relayAgentIps": { |
| 444 | "of:0000000000000204": { |
| 445 | "ipv4": "10.0.2.254", |
| 446 | "ipv6": "2001:2::254" |
| 447 | } |
| 448 | } |
| 449 | }, |
| 450 | { |
| 451 | "dhcpServerConnectPoint": "of:0000000000000206/3", |
| 452 | "serverIps": ["2002:5::253"], |
| 453 | "gatewayIps": ["2001:4::100"], |
| 454 | "relayAgentIps": { |
| 455 | "of:0000000000000204": { |
| 456 | "ipv4": "10.0.2.254", |
| 457 | "ipv6": "2001:2::254" |
| 458 | } |
| 459 | } |
| 460 | }, |
| 461 | { |
| 462 | "dhcpServerConnectPoint": "of:0000000000000206/3", |
| 463 | "serverIps": ["2002:4::253"], |
| 464 | "gatewayIps": ["2001:4::100"], |
| 465 | "relayAgentIps": { |
| 466 | "of:0000000000000204": { |
| 467 | "ipv4": "10.0.2.254", |
| 468 | "ipv6": "2001:2::254" |
| 469 | } |
| 470 | } |
| 471 | } |
| 472 | ] |
| 473 | } |
| 474 | } |
| 475 | } |
| 476 | |
| 477 | - ``dhcpServerConnectPoint``: represent the location of DHCP server |
| 478 | |
| 479 | - ``serverIps``: IP address of the DHCP server, contains at least one IP address of DHCP server. |
| 480 | IP address can be IPv4 or IPv6 for different version of DHCP. |
| 481 | Will use first address if multiple IPv4 or IPv6 address configured. |
| 482 | |
| 483 | - ``gatewayIps``: Optional. Should be configured if the DHCP server is not |
| 484 | directly connected to the SD-Fabric. It tells which gateway we need to |
| 485 | send to reach the server. |
| 486 | |
| 487 | .. note:: |
| 488 | - If ``indirect`` server configuration is not configured, the app will use |
| 489 | ``default`` configuration for all cases. |
| 490 | |
| 491 | |
| 492 | Ignoring DHCP relay on a particular VLAN |
| 493 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 494 | |
| 495 | In some cases, it may be necessary to avoid punting DHCP packets to the |
| 496 | controller, and letting them be forwarded normally through the data plane. |
| 497 | |
| 498 | In such cases, the DHCP relay application can be configured to avoid punting |
| 499 | DHCP packets on a particular VLAN on a particular switch. |
| 500 | |
| 501 | .. code-block:: json |
| 502 | |
| 503 | { |
| 504 | "apps" : { |
| 505 | "org.onosproject.dhcprelay" : { |
| 506 | "ignoreDhcp" : [ |
| 507 | { "deviceId": "of:0000000000000205", "vlan":24 }, |
| 508 | { "deviceId": "of:0000000000000206", "vlan":24 } |
| 509 | ] |
| 510 | } |
| 511 | } |
| 512 | } |
| 513 | |
| 514 | In the example shown above, DHCP packets on VLAAN 24 are not punted to the |
| 515 | controller from switches of:205 and of:206 |
| 516 | |
| 517 | DHCPv6 Prefix Delegation (PD) Pushing |
| 518 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 519 | |
| 520 | .. note:: |
| 521 | This feature requires both ``dhcprelay`` and ``fpm`` apps to be activated |
| 522 | |
| 523 | PD pushing allows IPv6 prefixes from DhcpRelay to be sent over the FPM |
| 524 | connection to Quagga where they will be configured as a static route. |
| 525 | |
| 526 | Prior to PD Pushing, the FPM connection was only used by Quagga in one |
| 527 | direction to push routes to FPM. PD pushing is disabled by default in DHCP |
| 528 | Relay and FPM. |
| 529 | |
| 530 | To enable in DHCP relay: |
| 531 | |
| 532 | .. code-block:: console |
| 533 | |
| 534 | onos> cfg set org.onosproject.dhcprelay.DhcpRelayManager DhcpFpmEnabled true |
| 535 | |
| 536 | To display PD's stored in DHCP relay, execute the following CLI command: |
| 537 | |
| 538 | .. code-block:: console |
| 539 | |
| 540 | onos> dhcp-fpm-routes |
| 541 | |
| 542 | When PD pushing is enabled in FPM, by default the next-hop to be used for all |
| 543 | prefixes pushed to Quagga will be retrieved from the first interface with |
| 544 | ``RUR`` in the name in ONOS. |
| 545 | |
| 546 | Next-hop may also be configured using FPM component config. This will override |
| 547 | a ``RUR`` interface if present. |
| 548 | |
| 549 | If there is no interface with ``RUR`` in the name and the next-hop is not |
| 550 | configured, no prefixes can be pushed to Quagga even if PD pushing is enabled. |
| 551 | For DhcpRelay, only the IPv6 next-hop is needed. |
| 552 | |
| 553 | To enable in FPM: |
| 554 | |
| 555 | .. code-block:: console |
| 556 | |
| 557 | onos> cfg set org.onosproject.routing.fpm.FpmManager pdPushNextHopIPv4 124.200.1.60 |
| 558 | onos> cfg set org.onosproject.routing.fpm.FpmManager pdPushNextHopIPv6 2001:a08::2 |
| 559 | onos> cfg set org.onosproject.routing.fpm.FpmManager pdPushEnabled true |
| 560 | |
| 561 | |
| 562 | To verify that PD pushing is enabled: |
| 563 | |
| 564 | .. code-block:: console |
| 565 | |
| 566 | onos> fpm-connections |
| 567 | PD Pushing is enabled. |
| 568 | peer 124.200.3.42:48640 connected to 127.0.0.1 since 2m23s ago * (2 routes locally) |
| 569 | |
| 570 | |
| 571 | Prefixes pushed to Quagga can be displayed in ``vtysh`` using ``show ip route`` and ``show ipv6 route``. |
| 572 | If the output is not as expected, check the Quagga log to see if it was received from FPM. |
| 573 | |
| 574 | .. note:: |
| 575 | Quagga requires a patch to be able to receive Netlink Messages from FPM. |
| 576 | |
| 577 | Clean up expired address and PD prefix |
| 578 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 579 | |
| 580 | DHCPv6 relay cleans up stale IP address and pd prefix based on timer whose |
| 581 | default interval is 24 hours (24 * 3600 secs = 86400 secs). |
| 582 | |
| 583 | If the preferred life time of ip address or pd prefix exceeds 1/2 of poll |
| 584 | interval, they will be removed from ONOS. |
| 585 | |
| 586 | The poll interval can be modified by ``cfg set |
| 587 | org.onosproject.dhcprelay.DhcpRelayManager dhcpPollInterval <newVal>`` |
| 588 | |
| 589 | .. code-block:: console |
| 590 | |
| 591 | onos> cfg get org.onosproject.dhcprelay.DhcpRelayManager |
| 592 | org.onosproject.dhcprelay.DhcpRelayManager |
| 593 | name=dhcpPollInterval, type=integer, value=86400, defaultValue=86400, description=dhcp relay poll interval |
| 594 | |
| 595 | onos> cfg set org.onosproject.dhcprelay.DhcpRelayManager dhcpPollInterval 60 |
| 596 | |
| 597 | onos> cfg get org.onosproject.dhcprelay.DhcpRelayManager |
| 598 | org.onosproject.dhcprelay.DhcpRelayManager |
| 599 | name=dhcpPollInterval, type=integer, value=60, defaultValue=86400, description=dhcp relay poll interval |
| 600 | |
| 601 | |
| 602 | Alternative: Configure static IP |
| 603 | -------------------------------- |
| 604 | |
| 605 | Although we strongly recommend to use `DHCP Relay`_ for IP assignment, it is |
| 606 | also possible to statically configure the IP address and route on the host. |
| 607 | |
| 608 | 1. **Configure the IP address and subnet mask** |
| 609 | |
| 610 | Make sure the IP address and the subnet mask on the fabric network interface |
| 611 | of the host is consistent with the information in the Network Configuration |
| 612 | section. For example, you can run |
| 613 | |
| 614 | .. code-block:: console |
| 615 | |
| 616 | # ip addr add 10.0.0.1/24 dev mlx0 |
| 617 | |
| 618 | 2. **Configure the default route** |
| 619 | |
| 620 | Make sure you change the default route of the host to the interface IP of |
| 621 | the leaf switch it connects to. For example, you can run |
| 622 | |
| 623 | .. code-block:: console |
| 624 | |
| 625 | # ip route add default via 10.0.0.254 |
| 626 | |
| 627 | .. note:: |
| 628 | In the case that you want to keep default route through the management network, |
| 629 | you need to add routes to all other subnets in the network one by one. |
| 630 | |
| 631 | 3. **Trigger host learning** |
| 632 | |
| 633 | We need to let ONOS learn the host in order to program corresponding flows |
| 634 | and groups. |
| 635 | |
| 636 | This is automatically done as part of the DHCP process. |
| 637 | |
| 638 | However, we need to manually triggers it by sending an ARP or ND packet if |
| 639 | the host is configured to use static IP. |
| 640 | |
| 641 | .. code-block:: console |
| 642 | |
| 643 | # arping -c 1 ${GATEWAY_IP} |
| 644 | |
| 645 | .. code-block:: console |
| 646 | |
| 647 | # ndsend ${HOST_IP} ${INTF} |
| 648 | |
| 649 | Reference |
| 650 | --------- |
| 651 | - https://www.cisco.com/c/en/us/support/docs/security/adaptive-security-appliance-asa-software/116265-configure-product-00.html |