Re: Systemd, how to set static IP

It is unit type oneshot so it has done its job and have exited. It is as it should be.You have set RemainAfterExit so it will remain and not stopping unless user responds.I see you have networkmanager running. What do you use it for? Dos it use static ip?I have the same setup myself and it works as it should. Systemd 197 rename interfaces solook at your ip l (shortform for ip link) to find your interface and ip a to see if ip address is assigned to interface.

Re: Systemd, how to set static IP

I've been told that it's better to use netcfg. For a static address, copy /etc/network.d/examples/ethernet-static into /etc/network.d/ (and rename it if you want), and then change the parameters in there. The example file is missing a NETMASK line, so add the lineNETMASK=24(or whatever your netmask is). Lastly, enable the network by typingsystemctl enable netcfg@ethernet-staticThe netcfg wiki explains everything.

The reason that netcfg is better is because it plays nice with other system services, such as network file mounts (NFS or CIFS), while the method above does not.

P.S. As ron9 said above, your ethernet adapter name probably won't be "eth0". Type "ip link" to find out what it is, and then modify your ethernet-static file accordingly.

Re: Systemd, how to set static IP

I can also recommend using Netcfg instead, makes it easier to create multiple profiles aswell if you've got more advanced setups with VLANs etc.

hawaiicharles wrote:

I've been told that it's better to use netcfg. For a static address, copy /etc/network.d/examples/ethernet-static into /etc/network.d/ (and rename it if you want), and then change the parameters in there. The example file is missing a NETMASK line, so add the lineNETMASK=24(or whatever your netmask is). Lastly, enable the network by typingsystemctl enable netcfg@ethernet-staticThe netcfg wiki explains everything.

The reason that netcfg is better is because it plays nice with other system services, such as network file mounts (NFS or CIFS), while the method above does not.

P.S. As ron9 said above, your ethernet adapter name probably won't be "eth0". Type "ip link" to find out what it is, and then modify your ethernet-static file accordingly.

Your netmask would have to be 255.255.0.0, (oops, you have 255.255.248.0), you may have to explicitly set this in the config file.and with systemctl you would just start it with systemctl start/enable netcfg@mynetwork_file when you're sure everything is working.

Last edited by nomorewindows (2013-02-21 01:29:53)

I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...Look ma, no mouse.