Tag Info

Hot answers tagged

11

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 ...


10

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 ...


10

The best way to guarantee the same IP at all times for a given host is to set up a MAC Address IP reservation in the DHCP server. Get the MAC address if your laptop, then go to your DHCP server, and assign a specific IP address to be issued to a host requesting from that MAC address.


9

The dhclient that NetworkManager calls should be the same irregardless. On my Fedora 19 system I'm getting the following command run via NetworkManager when I allow it to connect: /sbin/dhclient -d -sf /usr/libexec/nm-dhcp-client.action \ -pf /var/run/dhclient-wlp3s0.pid \ -lf ...


8

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 ...


7

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. ...


6

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 ...


6

isc-dhcp-server is the new name for the dhcp3-server package, so this is behaving as expected. Debian sarge is fairly old, so you can expect that tutorial to be outdated.


6

The subnet mask that you have specify in dhcpd.conf must match your interface subnet mask. Run: /sbin/ifconfig eth0 You specified the subnet mask as 255.255.255.0, this is most likely wrong. Change your dhcpd.conf to match your interface. The interface where the DHCP server is listening must have an Static IP of the same subnet you are using in your ...


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

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 ...


5

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 ...


5

If you are using isc-dhcp-client, provisions are made for "hook scripts" which will run at various stages of the DHCP process, including when an address is acquired. /etc/dhcp/dhclient-enter-hooks.d or similar.


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 = ...


5

No, you can only get this information server side from the DHCP server. This information is contained in the DHCP server's .lease file: /var/lib/dhcpd/dhcpd.leases, if you're using ISC's DHCP server. Example $ more /var/lib/dhcpd/dhcpd.leases # All times in this file are in UTC (GMT), not your local timezone. This is # not a bug, so please don't ask ...


5

An option for you is counting number of lease declaration in dhcpd.leases: dhcpd.leases(5) - Linux man page Name dhcpd.leases - DHCP client lease database .... the Lease Declaration lease ip-address { statements... } Each lease declaration includes the single IP address that has been leased to the client. The statements within the braces define the ...


5

This is not a direct solution but it would seem you could make use of the on commit facility within your DHCP configuration file. Here's an example from this articled titled: Execute a script when ISC DHCP hands out a new lease. In the dhcpd.conf file you can create actions on various events such as when a lease is given out. subnet 192.168.1.0 netmask ...


5

You can add the following line to /etc/dhcp/dhclient.conf: prepend domain-name-servers <working DNS IP(s) here>; This adds the DNS IP address(es) you specify before that/those provided by the DHCP. If you would like to add it/them after the address(es) provided by the DHCP, just use append domain-name-servers <working DNS IP(s) here>; If, ...


5

1) You shouldn't manually update your resolv.conf, because all changes will be overwritten by data that your local DHCP server provides. If you want it to be static, run sudo dpkg-reconfigure resolvconf and answer "no" to dynamic updates. If you want to add new entries there, edit /etc/resolvconf/resolv.conf.d/base and run sudo resolvconf -u, it will append ...


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

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 ...


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

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, ...


4

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. ...


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

Bonsi Scott mentioned wireshark, which will allow you to observe ethernet packets, and all the protocol headers going up. It has a nice GUI interface too (the console version is 'tshark'). Wireshark is build on libpcap, which is fairly well documented and easy to use if you are into programming. Libpcap is also the basis of tcpdump which is similiar in ...


4

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 ...


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 ...



Only top voted, non community-wiki answers of a minimum length are eligible