dhclient.lease file is empty on first boot
-
- Posts: 86
- Joined: 2016/10/14 12:07:18
dhclient.lease file is empty on first boot
Hi,
After installing the CentOS 7 ISO, and configuring dhclient, I restarted "network" service. But my resolv.conf is empty, however, I got IP from DHCP server. After digging I find out that dhclient. lease file was also empty. when I ran dhclient eth0 command, dhclient. lease file got updated with proper info and also my resolv.conf got updated with DNS entries.
So my question is, why it is not getting updated on network restart, as suggested in all configuration documentation. How could I automate this process for first boot? The same kind of setup I had with CentOS 6, but there I never had to run dhclient command to make it work. What has been changed in 7 which could be possibly doing it? Please help.
After installing the CentOS 7 ISO, and configuring dhclient, I restarted "network" service. But my resolv.conf is empty, however, I got IP from DHCP server. After digging I find out that dhclient. lease file was also empty. when I ran dhclient eth0 command, dhclient. lease file got updated with proper info and also my resolv.conf got updated with DNS entries.
So my question is, why it is not getting updated on network restart, as suggested in all configuration documentation. How could I automate this process for first boot? The same kind of setup I had with CentOS 6, but there I never had to run dhclient command to make it work. What has been changed in 7 which could be possibly doing it? Please help.
Re: dhclient.lease file is empty on first boot
The default for CentOS 7 is to install NetworkManager service, with config details set in the Anaconda installer.nupurpriya wrote: ↑2018/09/05 09:07:48After installing the CentOS 7 ISO, and configuring dhclient, I restarted "network" service.
https://wiki.centos.org/FAQ/CentOS7
How did your install differ from the default?
Re: dhclient.lease file is empty on first boot
And NetworkManager keeps its leases file in a different place than a non-NM system.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: dhclient.lease file is empty on first boot
However, /etc/resolv.conf in its usual place should start
If NM is in use and if it does something fishy, then its logs could tell what:
That should be quite verbose about what NM gets from dhcpd.
Other info commands:
Code: Select all
# Generated by NetworkManager
Code: Select all
sudo journalctl -u NetworkManager.service
Other info commands:
Code: Select all
nmcli
nmcli dev
nmcli dev show
nmcli con show
ip ro
systemctl status NetworkManager
systemctl status network
-
- Posts: 86
- Joined: 2016/10/14 12:07:18
Re: dhclient.lease file is empty on first boot
I am using a custom ISO and custom application for touchless installation.How did your install differ from the default?
Re: dhclient.lease file is empty on first boot
Yes, a good kickstart saves a lot of work, but you surely understand that even psychics can have trouble to see how you have customized your network settings.
-
- Posts: 86
- Joined: 2016/10/14 12:07:18
Re: dhclient.lease file is empty on first boot
Hi,
Could you please point me to some documentation, on how to configure anaconda installer for this task
Could you please point me to some documentation, on how to configure anaconda installer for this task
Re: dhclient.lease file is empty on first boot
You can find the documentation for kickstart syntax and options on https://access.redhat.com/documentation ... yntax.html
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
-
- Posts: 86
- Joined: 2016/10/14 12:07:18
Re: dhclient.lease file is empty on first boot
Thanks for the response.
I have one more query, I included all the network information and everything in the interface config file through ks file, It is getting updated as expected, only this is resolv.conf is not getting updated and comes out to be blank after boot up.
Resolv.conf is getting updated in two cases:
1. When I am running "dhclient eth0"
2. After coming up, I need to stop NetworkManager and restart network service.
In both the cases, resolv.conf is getting updated by dhclient-script, unlike on standard systems, where it is created by NetworkManager.
Can anyone point out, what could be possible mistakes I would be doing here? Is there anyway, I can stop NetworkManager by default when the system comes up and restart network automatically.
I have one more query, I included all the network information and everything in the interface config file through ks file, It is getting updated as expected, only this is resolv.conf is not getting updated and comes out to be blank after boot up.
Resolv.conf is getting updated in two cases:
1. When I am running "dhclient eth0"
2. After coming up, I need to stop NetworkManager and restart network service.
In both the cases, resolv.conf is getting updated by dhclient-script, unlike on standard systems, where it is created by NetworkManager.
Can anyone point out, what could be possible mistakes I would be doing here? Is there anyway, I can stop NetworkManager by default when the system comes up and restart network automatically.
Re: dhclient.lease file is empty on first boot
"I don't want foo.service to start on boot"
"I want foo.service to start on boot"
You can run these in the POST section of kickstart.
Code: Select all
systemctl disable foo.service
Code: Select all
systemctl enable foo.service