Score:0

Ubuntu server 20.04: set ip isc-dhcp-server: network failed

cn flag

I have set up isc-dhcp-server over Ubuntu server 20.04. Isc-dhcp-server starts well.

To set up my local network, I used:

  • a pc to host isc-dhcp-server
  • a pc as a client
  • a switch to interconnect server and client

Below is the isc-dhcp-server status:

sudo systemctl restart isc-dhcp-server sudo systemctl status isc-dhcp-server.service

isc-dhcp-server.service - ISC DHCP IPv4 server
   Loaded: loaded (/lib/systemd/system/isc-dhcp-server.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2021-06-10 21:44:03 GMT; 3s ago
     Docs: man:dhcpd(8)
 Main PID: 6526 (dhcpd)
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/isc-dhcp-server.service
           └─6526 dhcpd -user dhcpd -group dhcpd -f -4 -pf /run/dhcp-server/dhcpd.pid -cf /etc/dhcp/dhcpd.conf br-6bc01dce843b

juin 10 21:44:03 tt-TECRA-R700 dhcpd[6526]: PID file: /run/dhcp-server/dhcpd.pid
juin 10 21:44:03 tt-TECRA-R700 dhcpd[6526]: Wrote 0 leases to leases file.
juin 10 21:44:03 tt-TECRA-R700 sh[6526]: Wrote 0 leases to leases file.
juin 10 21:44:04 tt-TECRA-R700 dhcpd[6526]: Listening on LPF/br-6bc01dce843b/02:42:f0:1e:4f:21/172.18.0.0/16
juin 10 21:44:04 tt-TECRA-R700 sh[6526]: Listening on LPF/br-6bc01dce843b/02:42:f0:1e:4f:21/172.18.0.0/16
juin 10 21:44:04 tt-TECRA-R700 sh[6526]: Sending on   LPF/br-6bc01dce843b/02:42:f0:1e:4f:21/172.18.0.0/16
juin 10 21:44:04 tt-TECRA-R700 sh[6526]: Sending on   Socket/fallback/fallback-net
juin 10 21:44:04 tt-TECRA-R700 dhcpd[6526]: Sending on   LPF/br-6bc01dce843b/02:42:f0:1e:4f:21/172.18.0.0/16
juin 10 21:44:04 tt-TECRA-R700 dhcpd[6526]: Sending on   Socket/fallback/fallback-net
juin 10 21:44:04 tt-TECRA-R700 dhcpd[6526]: Server starting service.

But when I plug a network cable to link the server to the switch, I get the following message:

network failed - Connection activation failed

I tried to connect a client to the switch so that it could get an address from the dhcp server, but client doesn't take any address at all.

$ ifconfig

br-6bc01dce843b: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.18.0.1  netmask 255.255.0.0  broadcast 172.18.255.255
        ether 02:42:f0:1e:4f:21  txqueuelen 0  (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

docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        ether 02:42:0e:7d:a0:2a  txqueuelen 0  (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

enp0s25: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 00:23:18:41:b2:fb  txqueuelen 1000  (Ethernet)
        RX packets 1538  bytes 272584 (272.5 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 8126  bytes 1449096 (1.4 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 20  memory 0xd4700000-d4720000  

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  (Boucle locale)
        RX packets 465692  bytes 44635267 (44.6 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 465692  bytes 44635267 (44.6 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp2s0b1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.101  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::de66:bfea:9ee9:d266  prefixlen 64  scopeid 0x20<link>
        ether 4c:ed:de:54:ae:7d  txqueuelen 1000  (Ethernet)
        RX packets 3915334  bytes 3388537159 (3.3 GB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 3286057  bytes 606308993 (606.3 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

$ sudo gedit /etc/default/isc-dhcp-server

#INTERFACESv4="wlp2s0b1"
INTERFACESv4="br-6bc01dce843b"
INTERFACESv6=""

sudo gedit /etc/dhcp/dhcpd.conf

# dhcpd.conf

option domain-name "example.org";
option domain-name-servers ns1.example.org, ns2.example.org;

default-lease-time 600;
max-lease-time 7200;

ddns-update-style none;

authoritative;

subnet 172.18.0.0 netmask 255.255.0.0 
{
   range 172.18.0.10 172.18.0.50;
#  option routers 172.18.0.1;
   option subnet-mask 255.255.0.0;
#  option broadcast-address 172.18.255.255;
}
Terrance avatar
id flag
Does it fail as soon as you plug it into the switch? If so, you might want to check if there are any bent or crossing pins inside the ethernet jacks.
cn flag
Before installing a dhcp server on Ubuntu server 20.04, a dhcp server was installed on Ms Windows server using the same switch. The switch worked perfectly.
Terrance avatar
id flag
Are you using the same port that the other DHCP server was in? Normally plugging in a cable will not deactivate the network. You can try plugging in a computer directly without the switch in between and see. Most Ethernet jacks are now auto-sensing for crossover.
cn flag
DHCP server over Ms Windows server was installed on another computer.
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.