You are not logged in.

#1 2012-10-27 22:45:35

DarkSotM
Member
From: Washington
Registered: 2011-10-02
Posts: 7

[Solved] Migrating to systemd

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

#2 2012-10-27 22:50:52

65kid
Member
From: Germany
Registered: 2011-01-26
Posts: 663

Re: [Solved] Migrating to systemd

there is no direct replacement for the network functionality in rc.conf. If you just need a static IP, netcfg is recommended.

Offline

#3 2012-10-27 22:51:00

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] Migrating to systemd

I think you are looking for something like netcfg.  See the wiki.

Offline

#4 2012-10-27 22:53:03

DarkSotM
Member
From: Washington
Registered: 2011-10-02
Posts: 7

Re: [Solved] Migrating to systemd

Ahh... excellent, thanks to you both.

Offline

#5 2012-10-27 23:34:40

dif
Member
From: Stalowa Wola, Poland
Registered: 2009-12-22
Posts: 137

Re: [Solved] Migrating to systemd

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.1

and  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.target

Offline

#6 2012-10-27 23:43:17

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] Migrating to systemd

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

#7 2012-10-28 21:17:06

DarkSotM
Member
From: Washington
Registered: 2011-10-02
Posts: 7

Re: [Solved] Migrating to systemd

@dif

Interesting, I like that.  It looks very clean.  I'll try that one.  Thank you!

Offline

Board footer

Powered by FluxBB