You are not logged in.
Pages: 1
I'm in the process of migrating to systemd following the most excellent wiki articles. I've gotten most of it migrated to systemd native however I can't seem to figure out how to get systemd to start my network. The wiki makes special note of the network daemon in rc.conf and says to look at networking configuration. That article goes on to explain setting it up in rc.conf. The network is static and I have no need for a network manager. Am I just overlooking something?
-DarkSotM
Last edited by DarkSotM (2012-10-27 23:11:21)
Offline
there is no direct replacement for the network functionality in rc.conf. If you just need a static IP, netcfg is recommended.
Offline
I think you are looking for something like netcfg. See the wiki.
Offline
Ahh... excellent, thanks to you both.
Offline
And what if our colleague wouldn't have taken you advice to use netcfg?
It is a static address, Why use any additional software?
How about setting the IP, gateway,... addresses in /etc/conf.d/network, e.g
interface=eth0
address=192.168.1.10 # your actual IP
netmask=24
broadcast=192.168.1.255
gateway=192.168.1.1and something like this in your network.service?
[Unit]
Description=Network Connectivity
Wants=network.target
Before=network.target
[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=/etc/conf.d/network
ExecStart=/sbin/ip link set dev ${interface} up
ExecStart=/sbin/ip addr add ${address}/${netmask} broadcast ${broadcast} dev ${interface}
ExecStart=/sbin/ip route add default via ${gateway}
ExecStop=/sbin/ip addr flush dev ${interface}
ExecStop=/sbin/ip link set dev ${interface} down
[Install]
WantedBy=multi-user.targetOffline
Sure that would work. But I just figured netcfg was easiest since it is now included with a new install and it's abilities are pretty robust.
Offline
@dif
Interesting, I like that. It looks very clean. I'll try that one. Thank you!
Offline
Pages: 1