Skip to main content
Share Your Experience: Take the 2024 Developer Survey
45 votes
Accepted

use dhcp on eth0 using command line

If your dhcp is properly configured to give you an IP address, the command: dhclient eth0 -v should work. The option -v enable verbose log messages, it can be useful. If your eth0 is already up, ...
andreatsh's user avatar
  • 2,035
36 votes

Why are my cloned linux VMs fighting for the same IP

systemd-networkd uses a different method to generate the DUID than dhclient. dhclient by default uses the link-layer address while systemd-networkd uses the contents of /etc/machine-id. Since the VMs ...
wickedchicken's user avatar
22 votes
Accepted

How to get Pi-Hole to work with IPv6?

I got it working. Here's what I did: When I initially set up my Pi-Hole, I only had IPv4 on my system. Thus Pi-Hole only downloaded IPv4-capable blacklists. So I turned IPv6 on on my home router, and ...
Mike S's user avatar
  • 2,552
20 votes
Accepted

Why are my cloned linux VMs fighting for the same IP

What about netplan configuration? There is an option dhcp-configuration that can be used as follows (excerpt from netplan examples): network: version: 2 ethernets: enp3s0: dhcp4: yes ...
brian's user avatar
  • 316
17 votes
Accepted

how do you set up a linux client to use ntp information provided through dhcp?

If the dhcp server you are using is configured to provide the ntp-servers option, you can configure your dhclient to request ntp-servers by adding ntp-servers to the default request line in dhclient....
Tim Kennedy's user avatar
  • 19.7k
17 votes
Accepted

UFW/IPTABLES not blocking DHCP UDP port 67?

I was too dump to open up the proper ports on my firewall before I started testing out my shiny new DHCP server, and it took a moment to dawn on me that it shouldn't work yet. I never opened port 67 ...
sourcejedi's user avatar
  • 50.6k
16 votes

Why are my two virtual machines getting the same IP address?

In VirtualBox control panel go to File -> Preferences -> Network Select NAT Networks tab, create a new "NatNetwork" by clicking + button at side and press OK. Now select each VM go to Settings -> ...
Suman Bhowmik's user avatar
16 votes
Accepted

"aborting authentication by local choice (Reason: 3=DEAUTH_LEAVING)" when trying to connect to wifi

Somehow, my firmware got trouble with long interface name. So I ran this command to prevent it: ln -s /dev/null /etc/systemd/network/99-default.link and it worked.
GPraz's user avatar
  • 459
14 votes
Accepted

How do I check DHCP lease time in systemd-networkd?

Depending on the OS; Enabling debug isn't always necessary. systemd-networkd should store the lease info under /run/systemd/netif/leases/ i.e. cat /run/systemd/netif/leases/2
Joseph Tingiris's user avatar
12 votes
Accepted

Theoretical: TAP interface w/ WIFI parent interface

This Network Engineering SE link Four layer-2 addresses in 802.11 frame header explains quite well the difference between Ethernet and Wifi. Wifi requires additional MAC addresses for communication: ...
A.B's user avatar
  • 36.9k
11 votes

Check my DHCP lease?

I'm not aware of a way to query this information on the client. If you are on the server you can see information on the client leases in /var/lib/dhcp/dhclient.leases. From the client the only way i ...
user1794469's user avatar
  • 4,097
11 votes

Check my DHCP lease?

With NetworkManager use nmcli to query the DHCP status for your active connection (assuming one) with nmcli -f ipv4.method con show "`nmcli -t -f NAME connection `" For full DHCP information use -f ...
jnas's user avatar
  • 211
11 votes

nmap to awk to sed. is there a better way?

You can accomplish this with the following awk command: nmap -sP 192.168.3.0/24 \ | awk '/192.168.3/ && !/192.168.3.1$/{print $NF}' This is telling awk to print the last field of the ...
jesse_b's user avatar
  • 37.3k
10 votes

How to allow guest OS to access Internet in qemu?

My second question is - is there an easier way to configure all of this to allow simple internet access to guest os? You don't (or, at least, shouldn't) need to manually configure anything for simple ...
Crestwave's user avatar
  • 178
10 votes
Accepted

Dhclient not updating /etc/resolv.conf

Mint and other modern distros ship with mdns by default, which wraps the regular public DNS with a local "decentralized" wrapper which enables zeroconf support for your local network. Basically, a ...
tripleee's user avatar
  • 7,743
10 votes

"aborting authentication by local choice (Reason: 3=DEAUTH_LEAVING)" when trying to connect to wifi

As others said the issue is caused by non-standard name the device gets (i.e. not wlan*). Linking /dev/null did not work for me, so I had to create a udev rule to rename the interface: In /etc/udev/...
Maciek's user avatar
  • 101
10 votes

How to avoid dhclient default gateway on an interface

Short answer nmcli connection modify id 'My eth1 connection' ipv4.never-default yes Read on for the longer answer and some alternatives. In all cases you have to restart connections to get the change....
A.B's user avatar
  • 36.9k
10 votes

What would be a regex to capture DHCP host registration records?

With parse_dhcp.awk as #!/usr/bin/env awk -f function output() { printf "%s, %s, %s\n", hw, fa, opt } $1 == "host" { if (NR > 1) output() hw = fa = opt = "&...
glenn jackman's user avatar
9 votes

avahi-daemon withdraws IP address from my network interface

The message "Withdrawing address record" doesn't mean avahi is removing the IP address, it just means that avahi detected that the IP address has been removed, and is changing its internal state in ...
Wouter Verhelst's user avatar
9 votes
Accepted

File /etc/resolv.conf deleted on every reboot, why or what?

In my experience, /etc/resolv.conf gets regenerated on boot, so any manual changes to it get reset. To work around this, you can create /etc/resolv.conf.head (or .tail depending on which end of the ...
Mio Rin's user avatar
  • 3,040
8 votes

What overwrites /etc/resolv.conf on every boot?

Ubuntu 16.04 If the network interfaces for your server instance is controlled by DHCP, the dhclient program will overwrite your /etc/resolv.conf file whenever the networking service is restarted. You ...
Sandjaie Ravi's user avatar
8 votes

Check my DHCP lease?

depending on your distro, it should be located in /var/lib/dhcp under dhclient.{interface}.leases or /var/lib/dhclient.leases. you can also specify the path of your dhclient.leases file by passing -lf ...
RDCortez's user avatar
8 votes

Check my DHCP lease?

There is one other aspect to this answer to consider to show your DHCP lease time and other DHCP information in the offer. If using Linux systemd-networkd, none of the options above work as they ...
Jeremy Hajek's user avatar
8 votes
Accepted

Set hostname on first boot before network.service

Nothing ensures that your firstboot.service runs before systemd-networkd is started. You have to use Wants=network-pre.target Before=network-pre.target instead of Before=network.target to achieve ...
Ferenc Wágner's user avatar
8 votes
Accepted

nmap to awk to sed. is there a better way?

There's no need to scan the entire subnet if you know that you're not interested in part of it. (Avoiding the computer means you don't need to discard its result.) nmap -oG - -sn 192.168.3.2-254 | ...
Chris Davies's user avatar
8 votes
Accepted

NetworkManager interferes with hostname configuration

Ivanivan's answer (tuning dhcpcd.con), though plausible, didn't work in my case. So I suspect it is not about DHCP. I stumbled upon this post which told me that the problem is not about DHCP but about ...
LaTechneuse's user avatar
7 votes
Accepted

How to release and renew IP address from DHCP on Linux systems?

I have found there is the following program listening on the network on both of them: dhclient Quoting the man page: -r Release the current lease and stop the running DHCP client as previously ...
Vlastimil Burián's user avatar
7 votes
Accepted

Is it possible to use a single DHCP server to push completely different ranges of ip to different network interfaces in different LANs?

Yes, you can do this. What you need to do is run a DHCP relay agent on server B, which listens for DHCP requests on UDP/67 (UDP/547 for DHCPv6) on its LAN B interface and forwards them to LAN A (the ...
ErikF's user avatar
  • 4,087
7 votes
Accepted

Debian workaround 838871: dhcp network configuration without blocking boot process

Before network-manager, the well-known way to "automatically ifup the network interface when a cable is plugged in" was ifplugd. (Note the original author :-P). ifplugd is still available in Debian. ...
sourcejedi's user avatar
  • 50.6k
7 votes
Accepted

Why do we need to have an ip6tables rule for DHCP6 to work? (by contrast, IPv4 does not require any)

In DHCPv4, the initial discover/offer/request/ack exchange happens using broadcast addresses, and is initiated by the client, so iptables connection tracking has no problems following it on the client....
telcoM's user avatar
  • 98.1k

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