Hot answers tagged

39 votes
Accepted

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

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 ...
user avatar
  • 2,785
37 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, ...
user avatar
  • 1,915
32 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 ...
user avatar
27 votes

Command to list assigned dhcp addresses

isc-dhcpd package version 4.3.1 has this command to list leases: dhcp-lease-list --lease PATH_TO_LEASE_FILE This is a simple perl script script that also supports older DHCP releases. You can see a ...
user avatar
27 votes
Accepted

what is dhcpv6-client service in firewalld, and can i safely remove it?

This is needed if you are using DHCP v6 due to the slightly different way that DHCP works in v4 and v6. In DHCP v4 the client establishes the connection with the server and because of the default ...
user avatar
  • 31.8k
25 votes

Specifying DNS settings to override those of DHCP

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 ...
user avatar
  • 37.5k
22 votes
Accepted

what is "rfc3442-classless-static-routes" in /etc/dhcp/dhclient.conf

The original DHCP specification (RFC 2131 and 2132) defines an option (33) that allows the administrator of the DHCP service to issue static routes to the client if needed. Unfortunately, that ...
user avatar
  • 31.8k
19 votes
Accepted

Host name changed remotely by wifi?

Some DHCP servers send out host names. Clients can accept or ignore such offers. Have a look at your local /etc/dhcp/dhclient.conf file to inspect your current configuration. There is a list of ...
user avatar
  • 32.1k
19 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 ...
user avatar
  • 2,249
18 votes
Accepted

How to skip DHCP if no cable connected to ethernet in Debian

If you specify allow-hotplug eth0 instead of auto eth0 in /etc/network/interfaces, then the connection will only be initiated by udev when something triggers it, instead of at every boot. That ...
user avatar
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....
user avatar
  • 18.6k
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.
user avatar
  • 459
16 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 ...
user avatar
  • 276
14 votes
Accepted

Append DNS suffixes to /etc/resolv.conf

In your /etc/sysconfig/network file, add: DOMAIN=example.com or DOMAIN="example.com sub.example.com" Settings in the file /etc/sysconfig/network apply to all network interfaces. Since all ...
user avatar
  • 306
13 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 -> ...
user avatar
12 votes

dhcpcd can't startup at boot

systemctl enable dhcpcd.service works for me.
user avatar
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 ...
user avatar
  • 33.3k
10 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 ...
user avatar
  • 3,664
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/...
user avatar
  • 101
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 = "&...
user avatar
9 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 ...
user avatar
  • 168
9 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 ...
user avatar
  • 6,993
9 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
user avatar
8 votes

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 ...
user avatar
  • 2,707
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 ...
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 | ...
user avatar
  • 90.4k
8 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: ...
user avatar
  • 25.1k
7 votes

DHCPv6 prefix delegation server for linux?

This isn't a complete answer, since I'm still working through some of the problems, but here's what I've got so far, trying to deploy a near-identical setup (though for somewhat different reasons). ...
user avatar
  • 348
7 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 ...
user avatar
7 votes
Accepted

How to reinstall dhcpcd without internet connection

If you have an Arch install disk, you can boot off it, mount your install partition and use pacstrap to install dhcpcd, similar to how you installed Arch in the first place. e.g. mount /dev/sda1 /...
user avatar
  • 583

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