Score:0

Having trouble deleting old DHCP configuration from interface

lc flag

I switched my router and my new one is setup with different IP ranges for the dhcp clients. Old one was 192.168.0.0/24, new one 192.168.88.0/24. My ubuntu server that is in my network won't loose that old configuration for some reason, the welcome message already shows both IPs bound for the enp3s0 interface.

IPv4 address for enp3s0:          192.168.88.248
IPv4 address for enp3s0:          192.168.0.101

ip a output:

2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 68:1d:ef:22:7a:40 brd ff:ff:ff:ff:ff:ff
    inet 192.168.88.248/24 brd 192.168.88.255 scope global dynamic noprefixroute enp3s0
       valid_lft 389sec preferred_lft 389sec
    inet 192.168.0.101/24 brd 192.168.0.255 scope global noprefixroute enp3s0
       valid_lft forever preferred_lft forever
    inet6 fe80::2b75:b1cd:3e2f:ca2b/64 scope link
       valid_lft forever preferred_lft forever
    inet6 fe80::6a1d:efff:fe22:7a40/64 scope link
       valid_lft forever preferred_lft forever

ifconfig interestingly only shows the new config:

enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.88.248  netmask 255.255.255.0  broadcast 192.168.88.255
        inet6 fe80::2b75:b1cd:3e2f:ca2b  prefixlen 64  scopeid 0x20<link>
        inet6 fe80::6a1d:efff:fe22:7a40  prefixlen 64  scopeid 0x20<link>
        ether 68:1d:ef:22:7a:40  txqueuelen 1000  (Ethernet)
        RX packets 266491  bytes 258276943 (258.2 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 137081  bytes 11888532 (11.8 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

route -n also shows the old route that I want to delete:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.88.1    0.0.0.0         UG    100    0        0 enp3s0
0.0.0.0         192.168.0.1     0.0.0.0         UG    202    0        0 enp3s0

This also includes the old DNS server that I configured (8.8.8.8), it always comes back in the file /etc/resolv.conf

What I tried:

  • adjusted my netplan and applied new netplan:
network:
  version: 2
  renderer: NetworkManager
  ethernets:
    enp3s0:
      dhcp4: true
      dhcp4-overrides:
        use-dns: false
      nameservers:
        addresses: [192.168.88.1, 1.1.1.1]
  • flushed all IPs for enp3s0
  • deleted the bound IP via "ip addr del", but it gets reset after reboot
  • /var/lib/dhcp/dhclient.leases only has the new leases

Question:

How can I find out which program resets my IP config and DNS?

Ubuntu Server 22.04.2 LTS (GNU/Linux 5.15.0-75-generic x86_64)

masterchief4240 avatar
lc flag
Ubuntu Server 22.04.2 LTS (GNU/Linux 5.15.0-75-generic x86_64), no desktop has been added. Changed renderer to networkd now
ru flag
How did you configure it *before* networkd was your renderer?
Score:0
lc flag

Found the issue, it was in /etc/dhcpcd.conf

At the bottom was a static IP entered that was re-applied after every reboot. This entry was not deleted by applying the netplan. I have now commented it out.

#interface enp3s0
#        static ip_address=192.168.0.101/24
#        static routers=192.168.0.1
#        static domain_name_servers=8.8.8.8 8.8.4.4
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.