1

I have a CentOS 7.4 minimal install, command line only system which I am trying to determine what DHCP server my system received it's IP address from. I have tried:

  • ip address
  • ifconfig
  • cat /etc/resolv.conf <-- shows DNS, not DHCP
  • dhclient ens160 <-- VMware NIC name; dhclient(1348) is already running - exiting
  • ls /var/lib/dhclient <-- directory is empty
  • cat /var/lib/dhcp/dhclient.leases <-- /var/lib/dhcp does not exist
  • dhcpdump <-- command not found

I assigned a long-lease reservation from one of our DHCP servers but later discovered the reservation did not propagate to the other DHCP servers so it began the chase for which one responded.

In the mean time I have searched each DHCP server until I found the lease; I just don't know how to ask the system itself.

Thank you for your time regarding the matter.

0

1 Answer 1

1

Try grep -i dhcp /var/log/messages. I think by default in CentOS the DHCP will log there. Should show DHCPREQUEST and DHCPACK.

Apr 12 05:05:29 dart-dev dhclient[928]: DHCPREQUEST on eth0 to xxx.xxx.219.73 port 67 (xid=0x7d478419)
Apr 12 05:05:29 dart-dev dhclient[928]: DHCPACK from xxx.xxx.219.73 (xid=0x7d478419)
Apr 12 05:05:29 dart-dev NetworkManager[852]: [1523534729.3637] dhcp4 (eth0): address xxx.xxx.15.81

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .