0

I have just created this file for my linux machine on my private local network

root@Andromeda:/etc/netplan# cat /etc/netplan/01-netcfg.yml 
network:
    version: 2
    rendered: networkd
    ethernets:
        enp3s0:
            addresses: ["192.168.1.99"]
            gateway4: 192.168.1.1
            nameservers:
                    addresses:
                            - "127.0.0.53"

and then run netplan apply without any issues whatsoever:

root@Andromeda:/etc/netplan# netplan apply
root@Andromeda:/etc/netplan# echo $?
0

Why does my interface retains its old IP that got from DHCP

root@Andromeda:/etc/netplan# ip -4 addr show enp3s0 
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    inet 192.168.1.6/24 brd 192.168.1.255 scope global dynamic noprefixroute enp3s0
       valid_lft 1707070sec preferred_lft 1707070sec

This (the dhcp address) pertains also after a reboot (although this should be irrelevant as netplan apply does not require reboot to make the changes effective)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.