Score:0

Unable to set dhcp server on Ubuntu 20 desktop

br flag

On my Ubuntu 20 desktop machine, I am using Wifi for internet and hence my LAN interface is free. So I want to use it as a DHCP server interface.

eno1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether b4:2e:19:c6:73:57  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 449  bytes 37227 (37.2 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 449  bytes 37227 (37.2 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp5s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.99  netmask 255.255.255.255  broadcast 0.0.0.0
        inet6 fe80::c148:f87a:baf:8027  prefixlen 64  scopeid 0x20<link>
        ether 90:cc:df:93:d7:08  txqueuelen 1000  (Ethernet)
        RX packets 2324  bytes 222866 (222.8 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1903  bytes 348600 (348.6 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Following is my /etc/default/isc-dhcp-server :

INTERFACESv4="eno1"
INTERFACESv6=""

Following is my /etc/dhcp/dhcpd.conf :

ddns-update-style none;
default-lease-time 600;

allow bootp;
allow booting;
subnet 10.0.0.0 netmask 255.255.255.0 {
range 10.0.0.100 10.0.0.200;
option subnet-mask 255.255.255.0;
option routers 10.0.0.1;
default-lease-time 600;
max-lease-time 7200;
#option root-path "/home/naveen/rootfs-arm64/“; #provided by boot.scr.img
}

host hikey {
hardware ethernet 34:29:8f:70:06:d0;
fixed-address 10.0.0.225;
#option root-path "/home/naveen/rootfs-arm64/“; #provided by boot.scr.img
}

Following is my /etc/network/interfaces :

auto lo
iface lo inet loopback

auto eno1
iface eno1 inet static
address 10.0.0.1
netmask 255.255.255.0

But I still get the error :

● isc-dhcp-server.service - ISC DHCP IPv4 server
     Loaded: loaded (/lib/systemd/system/isc-dhcp-server.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sun 2022-01-30 23:28:03 IST; 13s ago
       Docs: man:dhcpd(8)
    Process: 1606 ExecStart=/bin/sh -ec      CONFIG_FILE=/etc/dhcp/dhcpd.conf;      if [ -f /etc/ltsp/dhcpd.conf ]; then CONFIG_FILE=/etc/ltsp/dhcpd.conf; fi;      [ -e /var/lib/dhcp/dhcpd.leases ] || touc>
   Main PID: 1606 (code=exited, status=1/FAILURE)

Jan 30 23:28:03 lab dhcpd[1606]:
Jan 30 23:28:03 lab dhcpd[1606]: Not configured to listen on any interfaces!
Jan 30 23:28:03 lab dhcpd[1606]:
Jan 30 23:28:03 lab dhcpd[1606]: If you think you have received this message due to a bug rather
Jan 30 23:28:03 lab dhcpd[1606]: than a configuration issue please read the section on submitting
Jan 30 23:28:03 lab dhcpd[1606]: bugs on either our web page at www.isc.org or in the README file
Jan 30 23:28:03 lab dhcpd[1606]: before submitting a bug.  These pages explain the proper
Jan 30 23:28:03 lab dhcpd[1606]: process and the information we find helpful for debugging.
Jan 30 23:28:03 lab dhcpd[1606]:
Jan 30 23:28:03 lab dhcpd[1606]: exiting.
John Ronald avatar
ca flag
The interface eno1 has not any IP. Could you restart the network service to see if the interface will get an IP with accordance to /etc/network/interfaces ?
Naveen avatar
br flag
@JohnRonald : Yeah that's a wierd thing that I also observed. I have restarted Ubuntu multiple times. When `/etc/network/interfaces/` is present, the `eno1` interface is not listed in the `ifconfig`. There seems some problem with the interface file.
Score:0
cn flag

You need to configure your eno1 interface. Since Ubuntu 20 uses netplan you find your config in /etc/netplan. There you should add something like:

    eno1:
        addresses:
        - 10.0.0.1/24
        dhcp4: false
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.