Page MenuHomeVyOS Platform

DHCP-received nameserver not added to vyos-hostsd
Closed, ResolvedPublicBUG

Description

This is all I see on boot:

May 15 22:47:34 vyos dhclient-script-vyos[2143]: Current dhclient PID: 2039, Parent PID: 1, IP version: -4, All dhclients for interface eth1: 2039
May 15 22:47:34 vyos dhclient-script-vyos[2143]: Passing command to /usr/sbin/ip: "-4 addr add 10.10.0.199/255.255.255.0 broadcast 10.10.0.255 valid_lft 43200 preferred_lft 43200 dev eth1 label eth1"
May 15 22:47:34 vyos dhclient-script-vyos[2143]: FRR status: running
May 15 22:47:34 vyos dhclient-script-vyos[2143]: Checking if the route presented in kernel: default via 10.10.0.1 dev eth1
May 15 22:47:34 vyos dhclient-script-vyos[2143]: Converted vtysh command: "ip route 0.0.0.0/0 10.10.0.1 eth1 tag 210 210"
May 15 22:47:34 vyos dhclient-script-vyos[2143]: Sending command to vtysh
May 15 22:47:35 vyos dhclient-script-vyos[2143]: Adding search-domain "home" via vyos-hostsd-client
May 15 22:47:35 vyos vyos-hostsd[525]: Received a configuration change request
May 15 22:47:35 vyos vyos-hostsd[525]: Request data: {"type": "host_name", "op": "set", "data": {"host_name": null, "domain_name": null, "search_domains": ["home"]}}
May 15 22:47:35 vyos vyos-hostsd[525]: Writing /etc/resolv.conf
May 15 22:47:35 vyos vyos-hostsd[525]: Writing /etc/hosts
May 15 22:47:35 vyos vyos-hostsd[525]: Saving state to /var/lib/vyos/hostsd.state
May 15 22:47:35 vyos vyos-hostsd[525]: Sent response: {'data': None}
May 15 22:47:35 vyos dhclient[2039]: bound to 10.10.0.199 -- renewal in 16500 seconds.
May 15 22:48:00 vyos vyos-hostsd[525]: Received a configuration change request
May 15 22:48:00 vyos vyos-hostsd[525]: Request data: {"type": "name_servers", "op": "get", "tag": "dhcp-eth1"}
May 15 22:48:00 vyos vyos-hostsd[525]: Sent response: {'data': []}
May 15 22:48:00 vyos vyos-hostsd[525]: Received a configuration change request
May 15 22:48:00 vyos vyos-hostsd[525]: Request data: {"type": "name_servers", "op": "get", "tag": "dhcpv6-eth1"}
May 15 22:48:00 vyos vyos-hostsd[525]: Sent response: {'data': []}

resolv.conf has no nameserver:

# cat /etc/resolv.conf 

### Autogenerated by VyOS ###
### Do not edit, your changes will get overwritten ###

# name server from static configuration

search home

Even if I try to renew or release the dhcp lease, the result is the same.

Edited: removed reference to T2409 as it's unlikely the cause and has been merged to current.

Details

Difficulty level
Unknown (require assessment)
Version
self-built 202005121147
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

jjakob triaged this task as High priority.May 15 2020, 9:09 PM
jjakob created this task.
jjakob created this object in space S1 VyOS Public.

After 2 release dhcp interface eth1 and one renew dhcp interface eth1, I now have 2 dhclients running, so there is a bug in the op-mode release/renew code.

4079 ?        Ss     0:00 /sbin/dhclient -4 -nw -cf /var/lib/dhcp/dhclient_eth1.conf -pf /var/lib/dhcp/dhclient_eth1.pid -lf /var/lib/dhcp/dhclient_eth1.leases eth1
4305 ?        Ss     0:00 /sbin/dhclient -q -nw -cf /var/lib/dhcp/dhclient_eth1.conf -pf /var/lib/dhcp/dhclient_eth1.pid -lf /var/lib/dhcp/dhclient_eth1.leases eth1

Hooks report wrong IP version:

dhclient-script-vyos[4306]: Current dhclient PID: 4305, Parent PID: 4304, IP version: -q, All dhclients for interface eth1: 4304 4305

I'm suspecting nameservers are not applied during boot due to use of cli-shell-api existsEffective in /etc/dhcp/dhclient-enter-hooks.d/04-vyos-resolvconf . Other hooks have suspect code too, like 05-vyos-mtureplace.

After a new reboot, the DHCP nameservers were correctly added to resolv.conf and powerdns recursor.conf. I had system name-server and service dns forwarding name-server set to a static IP. But after deleting these two static nameserver nodes, the DHCP nameservers are missing from both resolv.conf and recursor.conf.

jjakob renamed this task from DHCP-received nameserver not added to vyos-hostsd (with T2409 patch) to DHCP-received nameserver not added to vyos-hostsd.May 21 2020, 9:26 AM
jjakob updated the task description. (Show Details)
jjakob changed the task status from Open to In progress.Jun 2 2020, 4:39 PM
jjakob claimed this task.
syncer changed the subtype of this task from "Task" to "Bug".Jun 7 2020, 11:50 AM
jjakob moved this task from Need Triage to Finished on the VyOS 1.3 Equuleus board.

Fixed as part of T2486

erkin set Issue type to Bug (incorrect behavior).Aug 30 2021, 6:12 AM
erkin removed a subscriber: Active contributors.