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.
my questions/issues:
1, sometimes, when I just edit MAC address somewhere (physical machine is replaced by a new one and the old one is thrown out) and restart the server daemon with
Code:
/etc/init.d/isc-dhcp-server restart
it says on the new machine that there is an IP address conflict. I have to assign a new IP to a new MAC, I can't re-use them, so I'll run out of IP's in my subnet quickly
2, just today, suddenly, 5 computers on my network stopped to work, their networking was in the state "acquiring IP address". It doesn't matter if this or that PC was with mapped MAC-IP in config file, or without (IP was assigned to it dynamically). They were not able to get IP address at all, they were effectively stuck, all of them at once. Only way to work around that was to set-up static IP address/subnet/gateway to them temporarily.
3, don't know how to set-up logging of dhcp server itself (not just leases). I've seen some guides around but they don't seem to apply to my ubuntu version.
I'm new to dhcp server, this is my first, I don't know how to fix these issues, I've tried to set-up DHCP leases to more aggressive value, no help.
edit: dhcp server is at 192.168.1.9 (ubuntu 11.04 64bit), router is at 192.168.1.1 (including DNS). I've tried to set up my own DNS server but I find it complicated and not necessary for such a small network.
The best way to resolve your problems may be to change tools.
DHCPD is a very versital and capable tool, with a few very real complexities. IF you are running pure DHCP you do not need MAC addresses and the dynamic space should have NO FIXED or LONG TERM leases.
Here is an idea: I would ONLY use this for a SMALL lan with no complex requirements.
Instead of DHCPD try using DNSMASQ as your DHCP server. It is small, fast, much easier to configure, and runs well on all versions of Luminx where I have tested it. Being a less complex package, it has documentation that is easier to read and follow.
Manually configure your FIXED IP stations (network services, servers, network devices such as routers, etc) and put them into the /etc/hosts files (DNSMASQ will read and use that information). Configure DNSMASQ to serve dynamic address from a different part of your internal subnet. (For example, 10.7.7.0/24 for your full subnet, fixed devices in 10.7.7.0 - 10.7.7.127, dynamic addresses that DNSMASQ will serve from 10.7.7.128 - 10.7.7.254)
I use this kind of solution on my home network with only 31 nodes and it works great.
DNSMASQ also reads its parent DNS servers from your /etc/resolv.conf file and does automatic DNS caching to speed up lookups and reduce external resolver traffic. This, all without you needing to configure this part. Bonus!
...
Instead of DHCPD try using DNSMASQ as your DHCP server.
thanks wpeckham for an advice, I've browsed the documentation briefly and it looks like it will fit all my needs, I'm gonna configure it this weekend in my LAN. It's just 20-30 network devices and it won't be growing very fast anytime soon.
You are very welcome, ans I hope it resolves your problem nicely.
Let me know.
you were right, dnsmasq was quite easy to set-up, I've read a few docs and came up with this configuration, which is results in the same mac-ip mappings as the original isc-dhcp-server:
Code:
# Uncomment this to enable the integrated DHCP server, you need
# to supply the range of addresses available for lease and optionally
# a lease time. If you have more than one network, you will need to
# repeat this for each network on which you want to supply DHCP
# service.
#dhcp-range=192.168.0.50,192.168.0.150,12h
dhcp-range=192.168.1.10,192.168.1.90,12h
# hp-server 00:1C:C4:96:5C:38; fixed-address 192.168.1.9
# ZD
dhcp-host=00:1B:EB:20:2D:38,zber1,192.168.1.121
dhcp-host=00:1B:EB:21:18:1F,zber2,192.168.1.122
dhcp-host=00:1B:EB:35:12:6A,zber3,192.168.1.123
dhcp-host=00:1B:EB:21:18:1A,zber4,192.168.1.124
# users cal
dhcp-host=00:19:DB:D2:7D:93,user1,192.168.1.140
dhcp-host=F4:CE:46:F0:E8:7D,user2,192.168.1.141
# Do the same thing, but using the option name
#dhcp-option=option:router,1.2.3.4
dhcp-option=option:router,192.168.1.1
#subnet mask
dhcp-option=1,255.255.255.0
#broadcast address
dhcp-option=28,192.168.1.255
# Set the DHCP server to authoritative mode. In this mode it will barge in
# and take over the lease for any client which broadcasts on the network,
# whether it has a record of the lease or not. This avoids long timeouts
# when a machine wakes up on a new network. DO NOT enable this if there's
# the slightest chance that you might end up accidentally configuring a DHCP
# server for your campus/company accidentally. The ISC server uses
# the same option, and this URL provides more information:
# http://www.isc.org/files/auth.html
#dhcp-authoritative
dhcp-authoritative
only thing that troubles me is, that now I can't ping my PCs by their host name specified in this dnsmasq.conf file,
I've seen some threads about this, I'll try to figure it out when I have time, its a low priority task.
I can only ping network PCs by the hostname they have specified, not those in dnsmasq.conf
I have not run into the problem, but why would I put a different hostname in the DNSMASQ config than the client machines would request?
alright, so imagine this situation:
I have 40 devices on LAN, all of them defined is dnsmasq with MAC->IP mapping and host name.
Imagine I have 10 devices called barebone1, barebone2... barebone10 and they're all mapped and named like this in dnsmasq.conf.
Now barebone3 and barebone4 got broken, I'll quickly replace them with new devices, check the MAC's and update records in dnsmasq.conf and everything should continue working. But I don't want to go inside the configuration of these new devices to set up their host name (they're just plug-and-play linux boxes), they can have different host name defined inside. In network, I want to reach those boxes by the names as they are defined in dnsmasq.conf.
Similar with Windows client PCs, users can accidentally change the "name" of the PC, but I want to be 100% sure that I can reach the PC with that MAC address with it's hostname defined in dnsmasq.conf, I don't want to rely on the local settings of these PCs.
# Always give the host with ethernet address 11:22:33:44:55:66
# the name fred and IP address 192.168.0.60 and lease time 45 minutes
#dhcp-host=11:22:33:44:55:66,fred,192.168.0.60,45m
On the machine running DNSMASQ try loading up the /etc/hosts file with those ip addresses and hostnames.
It will use this in loading its tables on startup for serving names on the local domain.
On the machine running DNSMASQ try loading up the /etc/hosts file with those ip addresses and hostnames.
It will use this in loading its tables on startup for serving names on the local domain.
yes, this is the first thing that came to my mind, I've tried to add to /etc/hosts:
then I've restarted the network interface on the client PC and I still wasn't able to ping it
see:
Code:
C:\Users\admin>ping deb
Ping request could not find host deb. Please check the name and try again.
C:\Users\admin>ping 192.168.1.102
Pinging 192.168.1.102 with 32 bytes of data:
Reply from 192.168.1.102: bytes=32 time<1ms TTL=64
Reply from 192.168.1.102: bytes=32 time<1ms TTL=64
With the entry in the HOSTS file you should be able to resolve deb to it's IP address even if your /etc/resolv.conf file were messed up and DNSMASQ were not running! It may be that there is something very different blocking your ability to resolve DEB that has nothing to do with BIND, Resolv+, or DNSMASQ.
Try using the 'host' command or nslookup. (Host is the more correct and current.)
Make sure that your /ect/resolv.conf file contains
nameserver (IP of the machine running dnsmasq, even if it is THIS machine)
as the first nameserver line.
Make sure that /etc/hosts contains the line for deb (and only ONE line for deb) as you documented earlier.
type
host deb
and see what returns: it should include 192.168.1.102.
They try
host 192.168.1.102
and see what returns, it should include 'deb' (actually the FQDN for deb).
With the entry in the HOSTS file you should be able to resolve deb to it's IP address ...
another observation:
With entries only in dnsmasq.conf, I was able reach "deb" machine under it's name correctly from another linux client PC on the same LAN. I've tried to reach other windows machines by their name in dnsmasq.conf (they have a different computer name in their local settings) and I was able to reach them correctly. So I assume the problem is in the windows client PC settings, when I simply type \\%dnsmasq_name%, I can't reach that machine, only by it's IP.
and all (win and linux) clients will pick-up my dnsmasq server's IP as their first dns server.
I didn't touch hosts file, I've tried to add entries there, it did no harm and didn't make windows PC able to reach other machines in the LAN either.
To sum it up:
1, I can reach anything entered in dnsmasq.conf from a linux machine (not only from server machine, from other linux machines on the LAN as well), ex:
Code:
root@itcraft4:~# host deb
deb has address 192.168.1.102
root@itcraft4:~# host qi-win7
qi-win7 has address 192.168.1.111
root@itcraft4:~# host xp-uni2
xp-uni2 has address 192.168.1.105
2, I can't reach anything from a windows machine by it's hostname in dnsmasq. I can only reach other machines by their IP or by their locally set hostname.
That might seem to indicate to me that the Windows networking is either not configured completely or properly, or is not picking up all of the information it should during DHCP transactions.
Are you very sure that your DNSMASQ server is defined as the first nameserver for your windows machines?
Have you configured the search path to expand local short names to the local FQDN for the hosts?
Have you tried using host or ping against the FQDN (long) hostname of the machines?
That might seem to indicate to me that the Windows networking is either not configured completely or properly, or is not picking up all of the information it should during DHCP transactions.
Are you very sure that your DNSMASQ server is defined as the first nameserver for your windows machines?
Have you configured the search path to expand local short names to the local FQDN for the hosts?
Have you tried using host or ping against the FQDN (long) hostname of the machines?
all my windows clients have default 'windows' settings and are getting network parameters from dhcp correctly (I guess). Running "ipconfig /all" on any machine results in:
Have you configured the search path to expand local short names to the local FQDN for the hosts?
Have you tried using host or ping against the FQDN (long) hostname of the machines?
I don't think I fully understand, I don't have a domain set-up in my network, this is probably what you're referring to. I've just filled in the hostnames to dnsmasq.conf on dns/dhcp server and wasn't able to reach machines under those names from windows machines. So I guess answer is no, but I can try to play with it this weekend.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.