Hot answers tagged dhcp
9
Put only 127.0.0.1 as a name server in /etc/resolv.conf, and run a DNS cache locally. I recommend Dnsmasq, it's lightweight and easy to setup. On distributions such as Debian and Ubuntu, I also recommend installing the resolvconf package, which takes care of maintaining /etc/resolv.conf when you aren't running a local DNS cache, or of maintaining the DNS ...
7
Right click on the Network Manager icon on Ubuntu top panel and select edit. Go to Wired Network or Wireless Network tab and select the network name. Click on the edit button and go to IPv4 settings tab on the new window. If the method is Automatic (DHCP) you are using dhcp.
Other method is cat /var/log/syslog and check for some thing like below
...
5
As noted by Warren and Shawn, your question seems to imply that preventing address assignment to unregistered machines is intended to keep them off the net.
You cannot increase security this way as an machine can either:
find a "trusted" MAC address and pretend to have that MAC to get an IP address from the DHCP server, or
Just pick its own IP address ...
5
You can provide static IP by editing the file /etc/sysconfig/network-scripts/ifcfg-eth0 as root user in Redhat.
It should look like this:
DEVICE=eth0
BOOTPROTO=STATIC
IPADDR=192.168.0.5
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
ONBOOT=yes
After saving this file. You need to restart the network daemon using following command.
$ sudo /etc/init.d/network ...
5
Install and use sudo. It's the one and most sane way of doing these things. dhclient really needs root privileges, there's no way around it.
Allow specific users to execute a single command with root privileges. This can be configured in a /etc/sudoers file like this (edit using visudo):
Cmnd_Alias DHCP = /usr/sbin/dhclient
User_Alias DCHPUSERS = ...
4
The answer to this depends on how you previously configured the DHCP server.
Normal DHCP behaviour is this:
Lease is given a lease time perhaps 7days.
Client machine starts requesting a new lease half way through the current lease period.
Client machine only stops using the IP address when it either gets a new lease from the same DHCP server or the lease ...
4
If the host sends its name you can retrieve it from DNS. If you know its IP address you just do a reverse lookup on the IP address. One of these commands should work (use the host's IP address in place of 192.0.32.10):
host 192.0.32.10
nslookup 192.0.32.10
You can retrieve a list of all leases including the name provided if any from your dhcp.leases ...
4
Yes, you can do that.
You should look into dnsmasq. It is designed to serve this very need.
The default DHCP server on Linux is usually ISC dhcpd. It's possible to make it work in this role, too, but it's a bit more difficult to configure, and it has to be manually configured to get the DNS server integration you get for free with dnsmasq.
4
In (I believe) /etc/default/dhcp3-server, add the line
INTERFACES="eth0 eth1"
Now in the dhcpd.conf configuration file, you define two different subnet and the respective options.
subnet 192.168.1.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
option routers 192.168.1.1;
range 192.168.1.100 192.168.1.200;
}
subnet 192.168.2.0 ...
4
That's not the way ifconfig works. Your ifconfig invocation is understood as ‘configure device eth1, setting its address to be that of host start’. There's no host named ‘start’, so ifconfig fails.
If you configured the device correctly in /etc/sysconfig/network-scripts/ifcfg-eth1, all you need to do to run DHCP is to bring it up with ifup eth1.
4
On Ubuntu there is the file /var/lib/dhcp/dhcpd.leases, but it is rather verbose and you probably need a little script if you want more high level statistics. I am unaware of existing tools to do this.
There is a separate man page for this file man dhcpd.leases describing the database format.
4
dnsmasq is simpler and because of that has less features. But if you don't need anything fancy and since you were already able to set it up, you probably don't need them.
Dnsmasq is designed for small, local networks. You can read on its site that by small networks, they mean up to 1000 computers so it's not that bad.
So my answer is: there is absolutely ...
4
The best way to do this is to configure your WLAN router correctly, so that is is giving out proper fully qualified domain names (FQDN) to your hosts.
If the WLAN router serves hosts in the myhome.org domain then configure it as wlan-router.myhome.org. It likely uses it's own domain name as the value to hand out to clients.
A full DHCP has an option for ...
4
resolvconf is a program to manage the resolv.conf file so that multiple sources can add and remove entries without tripping over each other. The manager of each network interface feeds it a resolv.conf file for that interface, and it merges them all together.
resolvconf is meant to be run by network scripts or DHCP clients, but you can also run it ...
3
This is how I made Debian use more than 3 nameservers at a time.
Install dnsmasq package
Configure my local DHCP client not to use DNS server addresses provided by DHCP server, but only local server instead. To do so I add in my /etc/dhcp/dhclient.conf file the following line
supersede domain-name-servers 127.0.0.1;
Configure dnsmasq not to use the ...
3
For a small network I would use dnsmasq. It performs well for both DNS and DHCP. It does self registration internally, so the client does not need to register. This is more secure. There are configuration options to specify another server should be consulted for a domain. It will serve static address via DHCP either via configuration or /etc/ethers. ...
3
You need to look into more complex dhclient.conf files. From the man page:
The DHCP client may decide after some period of time (see PROTOCOL TIMING) that it is
not going to succeed in contacting a server. At that time, it consults its own database
of old leases and tests each one that has not yet timed out by pinging the listed
router for ...
3
What is the question here?
Yes, it sounds like you have two addresses assigned.
Yes you can talk to the box using either one of them.
If you talk from that box to other machines, it will use the most relevant address, meaning if there is an IP address in the same subnet, it will use that one to talk.
One of the addresses, probably the one assigned first, ...
3
Both FreeBSD and OpenBSD ship with BIND as the preinstalled name server. There is a good introduction in the FreeBSD handbook. For OpenBSD, there is a lot of information on Kernel Panic.
FreeBSD doesn't include a DHCP server in its default installation, but officially recommends the ISC DHCP server; see the handbook. OpenBSD does include a DHCP server, ...
3
Here's a named.conf that will just work for caching, it's basically the default, but queries the OpenDNS servers for DNS ins the fordwarders section.
//
// /etc/named.conf
//
options {
directory "/var/named";
pid-file "/var/run/named/named.pid";
auth-nxdomain yes;
datasize default;
// Uncomment these to enable IPv6 connections support
// ...
3
VirtualBox DHCP is working properly.
There is nothing wrong with having all of your machines getting the same address in NAT configuration. All VMs are isolated from each other so there is no risk of conflict. They are also not on the same adapter. Each VM has its own virtualized hardware including NICs.
The default gateway also need not to be 10.0.2.1. ...
3
resolv.conf can be modified by your DHCP server, which often times may be the PXE server. You have a pre-configured resolv.conf it can still be modified by DHCP and overwritten or modified.
This link has a good explanation.
nixCraft: How To: Make sure /etc/resolv.conf never gets updated by DHCP client.
3
Seems my question is answered in the libvirt manual. One needs to specifically ensure that the same IP is handed out via DHCP each time. Here's how this can be specified:
<network>
…
<ip address="192.0.2.1" netmask="255.255.255.0">
<dhcp>
<range start="192.0.2.128" end="192.0.2.254">
<host ...
3
Without knowing which method you used, this writeup (a little dated, for Etch) suggests what all it takes is to have the DHCP server listen on the right interface. (Sounds about right, doesn't it?)
The Debian Wiki has an DHCP server entry, the Basic configuration mentioned there should be sufficient for your case.
3
Don't use auto-generated virtual MAC addresses with your ISP.
Whether you are using a completely randomized MAC address or a non-vendor prefix, you are running the risk that your MAC address will confuse your ISP's infrastructure.
The workaround is to spoof the MAC address of an existing network card: preferably an old 10-base card that you never plan to ...
3
Without knowing how to change that in the router, one way is to setup static IP in the VM.
Modify /etc/network/interfaces as follow.
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.0.X
netmask 255.255.255.0
network 192.168.0.0
broadcast ...
2
It depends on what is doing the DHCP?
Most home routers use dnsmasq and you can use that as your local DNS server. You just need to set dnsmasq to return itself as the DNS server. Next, you need to make sure that your PCs broadcast a hostname during the DHCP request.
Then, voila, you should be able to resolve all your local machines through the DNS/DHCP ...
2
You can perhaps use SNMP, provided SNMP is enabled/allowed for DHCP service on Windows server.
Using SNMP queries, one can build a statistics of the lease information from time to time remotely from the DHCP service.
$snmp_address = "1.3.6.1.4.1.311.1.3.2.1.1.1";
$getsubnet = "snmpgetnext -v2c -c public -Oqv win_dhcp_server_ip $snmp_address |";
better ...
2
The dhcp.conf file has the ability to specify group parameters. In this group you can specify specific hardware addresses.
From the man page:
group {
filename "Xncd19r";
next-server ncd-booter;
host ncd1 { hardware ethernet 0:c0:c3:49:2b:57; }
host ncd4 { hardware ethernet 0:c0:c3:80:fc:32; }
host ncd8 { hardware ethernet 0:c0:c3:22:46:81; }
}
...
2
Looks like maybe you're not setting the channel and "mode". I use a simple script that does these shell commands:
ifconfig wlan0 down
iwconfig wlan0 mode managed
ifconfig wlan0 up
iwconfig wlan0 channel 3
iwconfig wlan0 key xxxxxxxxxx
iwconfig wlan0 key restricted
iwconfig wlan0 essid "Blah Blah Foo Bar"
iwconfig wlan0 ap xx:yy:zz:aa:bb:cc
sleep 5
dhcpcd ...
Only top voted, non community-wiki answers of a minimum length are eligible
