Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I configured a dhcpd, authorized from 192.168.0.22 to 192.168.0.127. Then another Linux client was configured to boot using DHCP by "netconfig", but every time it booted, I found it always request 10.0.0.4 and use this ip automatically at last. Even though I deleted /var/lib/dhcp/dhcpd.leases has no effect.
I can't get the authorized IP address until I run dhclient manually.
Originally posted by Chowroc I found it always request 10.0.0.4 and use this ip automatically at last. Even though I deleted /var/lib/dhcp/dhcpd.leases has no effect.
I can't get the authorized IP address until I run dhclient manually.
i guess the default ip setting is static, not dhcp.
If use Fedora, check /etc/sysconfig/network-scripts/ifcfg-eth*.
For example, my Fedora ifcfg-eth0 using dhcp:
well is 10.0.0.4 listed in dhcp leases? on boot of the client, is there an acknowledged dhcp request for 10.0.0.4 on the dhcp server? if neither of these occurs, then it's still looking like a very static assignment
Dec 29 23:37:05 Chowroc dhcpd: DHCPDISCOVER from 00:0c:29:af:01:2c via eth0
Dec 29 23:37:06 Chowroc dhcpd: DHCPREQUEST for 10.0.0.4 (10.0.0.2) from 00:0c:29:af:01:2c via eth0: ignored (not authoritative).
Dec 29 23:37:06 Chowroc dhcpd: DHCPOFFER on 192.168.0.124 to 00:0c:29:af:01:2c via eth0
Dec 29 23:37:06 Chowroc dhcpd: DHCPREQUEST for 10.0.0.4 (10.0.0.2) from 00:0c:29:af:01:2c via eth0: ignored (not authoritative).
Then, only remove /var/lib/dhcp/dhclient.lease or add "DHCP_PROG" to /etc/sysconfig/network-scripts/ifcfg-eth0 has no effect.
Only when I have done both, I get the right address:
Dec 29 23:42:30 Chowroc dhcpd: DHCPDISCOVER from 00:0c:29:af:01:2c via eth0
Dec 29 23:42:31 Chowroc dhcpd: DHCPOFFER on 192.168.0.124 to 00:0c:29:af:01:2c via eth0
Dec 29 23:42:31 Chowroc dhcpd: DHCPREQUEST for 192.168.0.124 (192.168.0.11) from 00:0c:29:af:01:2c via eth0
Dec 29 23:42:31 Chowroc dhcpd: DHCPACK on 192.168.0.124 to 00:0c:29:af:01:2c via eth0
Dec 29 23:42:31 Chowroc dhcpd: DHCPREQUEST for 192.168.0.124 (192.168.0.11) from 00:0c:29:af:01:2c via eth0
Dec 29 23:42:31 Chowroc dhcpd: DHCPACK on 192.168.0.124 to 00:0c:29:af:01:2c via eth0
Originally posted by Chowroc At fist, the log of the server(/var/log/message):
Dec 29 23:37:05 Chowroc dhcpd: DHCPDISCOVER from 00:0c:29:af:01:2c via eth0
Dec 29 23:37:06 Chowroc dhcpd: DHCPREQUEST for 10.0.0.4 (10.0.0.2) from 00:0c:29:af:01:2c via eth0: ignored (not authoritative).
Dec 29 23:37:06 Chowroc dhcpd: DHCPOFFER on 192.168.0.124 to 00:0c:29:af:01:2c via eth0
Dec 29 23:37:06 Chowroc dhcpd: DHCPREQUEST for 10.0.0.4 (10.0.0.2) from 00:0c:29:af:01:2c via eth0: ignored (not authoritative).
As this log, dhcpd offer correct address to the dhclient, but the client continue sending DHCPREQUEST... i guess this problem is related to dhclient side not dhcpd. Are there dhclient errors on dhclient's /var/log/messages?
Dec 30 00:45:54 LD ifup:
Dec 30 00:45:54 LD ifup: Determining IP information for eth0...
Dec 30 00:46:02 LD dhclient: DHCPNAK from 10.0.0.2 <30>Dec 30 00:46:02 dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7
Dec 30 00:46:02 LD dhclient: DHCPOFFER from 10.0.0.2 <30>Dec 30 00:46:02 dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 67
Dec 30 00:46:02 LD dhclient: dhclient.c(1216): non-null pointer
Dec 30 00:46:03 LD ifup: done.
And I found that the result of the client is not constant, sometimes be 192.168.0.x, but sometimes be 10.0.0.4.
Originally posted by Chowroc The message from the client:
Dec 30 00:46:02 LD dhclient: DHCPNAK from 10.0.0.2 <30>
Dec 30 00:46:02 dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7
Dec 30 00:46:02 LD dhclient: DHCPOFFER from 10.0.0.2 <30>
Dec 30 00:46:02 dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 67
Dec 30 00:46:02 LD dhclient: dhclient.c(1216): non-null pointer
As this dhclient log, dhclient received OFFER from dhcp server addressed 10.0.0.2. Chowroc(last post listed dhcp server) and this dhcp client exist in same network?? How about Chowroc ip address, or existence of another dhcp servers?
This the route table of the client after boot:
10.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 10.0.0.2 0.0.0.0 UG 0 0 0 eth0
and the server:
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
In fact, I build the client on the vmware, so I think physically they must be in same network.
Originally posted by Chowroc In fact, I build the client on the vmware, so I think physically they must be in same network.
i guess the VMware setting is the following. How about u?
---
Host OS: Linux Host(Chowroc dhcp server)
Guest OS: Linux Host(dhcp client)
In this case, Guest OS is in host-only network(vmnet1)
---
i think VMware DHCP Daemon for vmnet1 replied to dhcp client instead of Chowroc dhcp server, but u need to the fact because i dont know ur VMware detail network If my guess is correct, please re-try to reboot dhcp client after stopping VMware DHCP Daemon.
And, i suggest that physically network and host-only(vmnet1) is divided subnet; for example, physically network is 192.168.0.0/24, and host-only(vmnet1) is 192.168.10.0/24. Thats better
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.