Question

DHCP Relay not logging properly in CL 3.7

  • 8 October 2018
  • 5 replies
  • 498 views

Hello,

Troubleshooting DHCP Relay today was very difficult because logging has not been as described in 3.7.

The troubleshooting section of this document:
https://docs.cumulusnetworks.com/display/DOCS/DHCP+Relays

Indicates that DHCP forwarding should log information similar to this:

code:
cumulus@leaf01:~$ sudo journalctl -l -n 20 | grep dhcrelay

Dec 05 20:58:55 leaf01 dhcrelay[6152]: sending upstream swp52

Dec 05 20:58:55 leaf01 dhcrelay[6152]: sending upstream swp51

Dec 05 20:58:55 leaf01 dhcrelay[6152]: Relaying Reply to fe80::4638:39ff:fe00:3 port 546 down.

Dec 05 20:58:55 leaf01 dhcrelay[6152]: Relaying Reply to fe80::4638:39ff:fe00:3 port 546 down.

Dec 05 21:03:55 leaf01 dhcrelay[6152]: Relaying Renew from fe80::4638:39ff:fe00:3 port 546 going up.

Dec 05 21:03:55 leaf01 dhcrelay[6152]: sending upstream swp52

Dec 05 21:03:55 leaf01 dhcrelay[6152]: sending upstream swp51

Dec 05 21:03:55 leaf01 dhcrelay[6152]: Relaying Reply to fe80::4638:39ff:fe00:3 port 546 down.

Dec 05 21:03:55 leaf01 dhcrelay[6152]: Relaying Reply to fe80::4638:39ff:fe00:3 port 546 down.



But it does not. Nothing at all is logged other than service startup messages. Please let me know how to configure dhcrelay so that it will log properly.

5 replies

Userlevel 4
Thanks for letting us know @polysulfide. Could you please post your DHCP relay config so we can see what you did originally please?
code:
cat /etc/default/isc-dhcp-relay
# Defaults for isc-dhcp-relay initscript
# sourced by /etc/init.d/isc-dhcp-relay
# installed at /etc/default/isc-dhcp-relay by the maintainer scripts
#
# This is a POSIX shell fragment
#
# What servers should the DHCP relay forward requests to?
SERVERS="dhcp_ip"
# On what interfaces should the DHCP relay (dhrelay) serve DHCP requests?
# Always include the interface towards the DHCP server.
# This variable requires a -i for each interface configured above.
# This will be used in the actual dhcrelay command
# For example, "-i eth0 -i eth1"
INTF_CMD="-i vlanX -i vlanY -i vlanZ -U vlanZ_vrr_ip%vlanZ-v0"
# Additional options that are passed to the DHCP relay daemon?
OPTIONS=""



Just defaults and basic configuration. This works fine. Logging has not happened no matter what the config was.

Details have been sanitized.
Userlevel 4
Great, thanks for sharing that @polysulfide. I talked with engineering and got some more information that should help:

Cumulus Linux by default shows the dhcrelay packets happening in IPv6, but you have IPv4 relay enabled. Cumulus Linux shows those logs in DEBUG mode, so to see the IPv4 logs, you would need to set the following and restart the service:

OPTIONS = --loglevel-debug

Then you should see something like this in the syslog:

"Enabling loglevel DEBUG"

Let me know if that works for you. And I'll update the documentation since I didn't realize this was how it worked in reality.
Hi,

to see DHCP Relay logs would really help beside TCPDump to debug DHCP.

OPTIONS = --loglevel-debug

This did not work for us.

The option was added:
code:
vagrant@metal-leaf1:~$ sudo cat /etc/default/isc-dhcp-relay
# Defaults for isc-dhcp-relay initscript
# sourced by /etc/init.d/isc-dhcp-relay
# installed at /etc/default/isc-dhcp-relay by the maintainer scripts

#
# This is a POSIX shell fragment
#

# What servers should the DHCP relay forward requests to?
SERVERS="10.0.0.71"

# On what interfaces should the DHCP relay (dhrelay) serve DHCP requests?
# Always include the interface towards the DHCP server.
# This variable requires a -i for each interface configured above.
# This will be used in the actual dhcrelay command
# For example, "-i eth0 -i eth1"
INTF_CMD="-i tower"

# Additional options that are passed to the DHCP relay daemon?
OPTIONS="--loglevel-debug"


There was DHCP Relaying going on:

code:
vagrant@metal-leaf1:~$ sudo journalctl -flu dhcrelay
-- Logs begin at Mon 2018-12-03 06:11:03 UTC. --
Dec 03 06:12:25 metal-leaf1 dhcrelay[9591]: All rights reserved.
Dec 03 06:12:25 metal-leaf1 dhcrelay[9591]: For info, please visit https://www.isc.org/software/dhcp/
Dec 03 06:12:25 metal-leaf1 dhcrelay[9591]: Listening on LPF/tower/44:38:39:00:01:01
Dec 03 06:12:25 metal-leaf1 dhcrelay[9591]: Sending on LPF/tower/44:38:39:00:01:01
Dec 03 06:12:25 metal-leaf1 dhcrelay[9591]: Sending on Socket/fallback
Dec 03 06:14:12 metal-leaf1 dhcrelay[9591]: Forwarded BOOTREQUEST for tower 52:54:00:61:82:1b to 10.0.0.71
Dec 03 06:14:31 metal-leaf1 dhcrelay[9591]: Forwarded BOOTREQUEST for tower 52:54:00:61:82:1b to 10.0.0.71
Dec 03 06:14:31 metal-leaf1 dhcrelay[9591]: Forwarded BOOTREPLY for 52:54:00:61:82:1b to 10.0.0.81
Dec 03 06:14:31 metal-leaf1 dhcrelay[9591]: Forwarded BOOTREQUEST for tower 52:54:00:61:82:1b to 10.0.0.71
Dec 03 06:14:31 metal-leaf1 dhcrelay[9591]: Forwarded BOOTREPLY for 52:54:00:61:82:1b to 10.0.0.81


But no log showed up:
code:
vagrant@metal-leaf1:~$ sudo tail -f /var/log/syslog
2018-12-03T06:27:21.521257+00:00 cumulus sudo: pam_unix(sudo:session): session opened for user root by vagrant(uid=0)
2018-12-03T06:27:21.525487+00:00 cumulus sudo: pam_unix(sudo:session): session closed for user root
2018-12-03T06:30:01.829912+00:00 cumulus CRON[10138]: pam_unix(cron:session): session opened for user root by (uid=0)
2018-12-03T06:30:01.849337+00:00 cumulus CRON[10138]: (root) END ( /usr/sbin/logrotate /etc/logrotate.conf)
2018-12-03T06:30:01.851248+00:00 cumulus CRON[10138]: pam_unix(cron:session): session closed for user root
2018-12-03T06:32:27.985885+00:00 cumulus sudo: vagrant : TTY=pts/0 ; PWD=/home/vagrant ; USER=root ; COMMAND=/bin/journalctl -flu dhcrelay
2018-12-03T06:32:27.988068+00:00 cumulus sudo: pam_unix(sudo:session): session opened for user root by vagrant(uid=0)
2018-12-03T06:33:44.442330+00:00 cumulus sudo: pam_unix(sudo:session): session closed for user root
2018-12-03T06:33:50.178671+00:00 cumulus sudo: vagrant : TTY=pts/0 ; PWD=/home/vagrant ; USER=root ; COMMAND=/usr/bin/tail -f /var/log/syslog
2018-12-03T06:33:50.180743+00:00 cumulus sudo: pam_unix(sudo:session): session opened for user root by vagrant(uid=0)


Any other idea?
Userlevel 4
Hi @polysulfide we noticed that journalctl prints dhclient log messages, but for some reason syslog doesn’t show these messages. At this point, it would be faster to diagnose if we have a cl-support file. Please file a support ticket when you get a chance.

Reply