How do I stop DHCP to request address for a static interface?

181 views Asked by At

I have a Raspberry PI 4 running Ubuntu 21.10 with a static ip-address on eth0. Despite that, I keep getting a secondary 'dynamic' DHCP address on on it.

netplan

  network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: no
      addresses:
        - 192.168.0.10/24
      routes:
        - to: default
          via: 192.168.0.1
      nameservers:
          search: [lan]
          addresses: [192.168.0.12]

ip addr show

eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether dc:a6:32:da:df:55 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.10/23 brd 192.168.1.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet 192.168.0.225/23 brd 192.168.1.255 scope global secondary dynamic eth0
       valid_lft 68727sec preferred_lft 68727sec
    inet6 fe80::dea6:32ff:feda:df55/64 scope link 
       valid_lft forever preferred_lft forever

Even if I delete that interface, it keeps coming back after a few minutes. I have another PI with the "same" configuration and it doesn't have this problem. I also have the /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg per instructions.

1

There are 1 answers

3
Ronald Coe Jr. On

Have you tried using the word false instead of no on your dhcp4 entry to netplan?