Score:0

Ubuntu Router Not Restoring After Network Disconnect

br flag

I am using a Ubuntu 22.04 machine as my router. I run this script at startup which sets static IP addresses, forwards packets and serves DHCP requests.

sleep 4

sudo ip addr add 192.168.0.1/24 dev enp4s0
sudo ip addr add 192.168.1.1/24 dev enp5s0
sudo ip addr add 192.168.2.1/24 dev enp7s0
sudo ip addr add 192.168.3.1/24 dev enp8s0
sudo ip addr add 192.168.4.1/24 dev wlp12s0

#sudo iptables -t nat -A POSTROUTING -o enp11s0 -j MASQUERADE
sudo iptables-restore < iptables.txt

sudo systemctl restart isc-dhcp-server

However if I physically unplug the ethernet cable and plug it back in the client does not obtain an IP via DHCP even after I re-run the script or just sudo systemctl restart isc-dhcp-server

After I reboot the router, clients can obtain an IP address and access the internet.

How do I restore my DHCP and ability to route packets after a physical disconnect without needing to reboot?

I sit in a Tesla and translated this thread with Ai:

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.