Skip to content

[201811][isc-dhcp-relay] Patch to allow DHCP relay agent to discover interfaces even if they are down#3852

Merged
lguohan merged 1 commit intosonic-net:201811from
jleveque:fix_dhcp_relay_201811
Dec 7, 2019
Merged

[201811][isc-dhcp-relay] Patch to allow DHCP relay agent to discover interfaces even if they are down#3852
lguohan merged 1 commit intosonic-net:201811from
jleveque:fix_dhcp_relay_201811

Conversation

@jleveque
Copy link
Contributor

@jleveque jleveque commented Dec 6, 2019

- What I did

Patch isc-dhcp-relay in order to allow the relay agent to discover configured interfaces even if they are down.

Without this patch, the relay agent will not discover configured interfaces if they are down when the relay agent starts up. If the interface(s) then get brought up after the relay started, the relay will discard packets received on these interfaces and log the message, Discarding packet received on <iface_name> interface that has no IPv4 address assigned. This led to race conditions when starting SONiC (or loading configuration). To resolve this, the relay agent would need to be restarted with all configured interfaces up.

With this patch, the relay agent will discover all configured interfaces, whether or not they are up at the time the relay agent starts. Thus, the state of the configured interfaces can be down when the relay agent starts and brought up during the lifetime of the relay agent process, and the relay agent will relay packets as expected; it will not discard them.

This PR backports #3851 to the 201811 branch.

- How to verify it

  1. Stop DHCP relay service (systemctl stop dhcp_relay.service)
  2. Ensure all configured relay interfaces are up
  3. Start DHCP relay service (systemctl start dhcp_relay.service). Wait for the container to spawn the dhcrelay process(es).
  4. a. Begin DHCP packet capture on each configured interface (tcpdump -ne -i <iface_name> port 67 or 68 or similar command)
    b. Craft and send DHCP Discover or Request packet to the switch on the downlink (the DHCP relay test in the sonic-mgmt repo can be helpful here)
    c. Check packet capture to confirm the packet was relayed to all configured destination IP addresses on each configured uplink interface
    d. Craft and send DHCP Offer or Ack packet in on each uplink (again, the DHCP relay test in the sonic-mgmt repo can be helpful here)
    e. Check packet capture to confirm the packet was relayed to all configured destination IP addresses on each configured uplink interface
    f. Check /var/log/syslog to ensure that no Discarding packet received on <iface_name> interface that has no IPv4 address assigned. messages were logged
  5. Stop DHCP relay service (systemctl stop dhcp_relay.service)
  6. Bring all configured relay interfaces down
  7. Start DHCP relay service (systemctl start dhcp_relay.service). Wait for the container to spawn the dhcrelay process(es).
  8. Bring all configured relay interfaces up
  9. Repeat step 4
  10. Stop DHCP relay service (systemctl stop dhcp_relay.service)
  11. Ensure all configured relay interfaces are up
  12. Start DHCP relay service (systemctl start dhcp_relay.service). Wait for the container to spawn the dhcrelay process(es).
  13. For each uplink interface:
    a. Bring down the interface on the switch, wait for a few seconds, then bring the interface back up
    b. Repeat step 4
  14. For each uplink interface:
    a. Bring down the connected interface on the neighboring switch, wait for a few seconds, then bring the interface on the neighboring switch back up
    b. Repeat step 4

@jleveque jleveque requested a review from lguohan December 6, 2019 07:50
@jleveque jleveque self-assigned this Dec 6, 2019
@jleveque jleveque changed the title [isc-dhcp-relay] Patch to allow DHCP relay to discover interfaces even if they are down [201811][isc-dhcp-relay] Patch to allow DHCP relay to discover interfaces even if they are down Dec 6, 2019
@jleveque jleveque changed the title [201811][isc-dhcp-relay] Patch to allow DHCP relay to discover interfaces even if they are down [201811][isc-dhcp-relay] Patch to allow DHCP relay agent to discover interfaces even if they are down Dec 6, 2019
@lguohan lguohan merged commit 4efaeef into sonic-net:201811 Dec 7, 2019
@jleveque jleveque deleted the fix_dhcp_relay_201811 branch December 7, 2019 19:30
mssonicbld added a commit that referenced this pull request Apr 18, 2025
…atically (#22340)

#### Why I did it
src/sonic-utilities
```
* ed1ab68 - (HEAD -> master, origin/master, origin/HEAD) Add Nokia platforms to GCU validator (#3800) (12 hours ago) [Dylan Godwin]
* 4035df3 - [Mellanox] Support Mellanox Spectrum5 ASIC in generic configuration update (#3852) (12 hours ago) [DavidZagury]
* 36b18ec - [SRv6] add support for SRv6 counters (#3841) (2 days ago) [Yakiv Huryk]
```
#### How I did it
#### How to verify it
#### Description for the changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants