0

I have the following files in /etc/systemd/network (filename followed by content) on a Ubuntu 20.04 server:

        File: /etc/systemd/network/10-debug.conf
        [Service]
        Environment=SYSTEMD_LOG_LEVEL=debug

        File: /etc/systemd/network/20-static.network
        [Match]
        MACAddress=00:1e:67:d6:33:25

        [Network]
        Address=192.168.1.73/24
        Gateway=192.168.1.91
        DNS=8.8.8.8
        DNS=8.8.4.4

I ran the following commands:

 systemctl daemon-reload
 systemctl status systemd-networkd
 systemctl enable systemd-networkd   
 systemctl restart systemd-networkd

However, it always sets to IP address of 192.168.1.98. I read man systemd.networkd and found some other .network files in /lib/systemd/network. I renamed them to end with .nt instead of .network and rebooted. Yet, I do not get the desired IP address. Yes there were also files in /run/systemd/network. I removed them but as I understand they are created after boot.

WHat options do I have to set static IP? I absolutely do not need dhcp on the system.

Sunny
  • 381
  • 1
  • 6
  • 16
  • 1
    Why are you messing with the systemd units? On Ubuntu 20.04 and newer the network is configured with netplan in /etc/netplan. – Gerald Schneider Jul 02 '22 at 17:59
  • @GeraldSchneider I just do not like netplan. I find systemd units are much easier to manage. – Sunny Jul 02 '22 at 18:03
  • @GeraldSchneider I think I did some mistake during installation this time. I have done this earlier and it was a breeze. – Sunny Jul 02 '22 at 18:15

0 Answers0