You are not logged in.
I followed a guide to set up a network connection. The steps were to create a network config (/etc/config.d/network)
interface=eth0
address=192.168.1.2
netmask=24
broadcast=192.168.1.255
gateway=192.168.1.1
then a service description (/etc/systemd/system/network.service)
[Unit]
Description=Network startup
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
and then enable the service using systemctl enable network.
After the rebooting calling systemctl states the service as failed. If I start it manually using systemctl start network everything works fine.
How do I get it to work with autostart? Thanks in advance.
Last edited by devrandom (2013-08-03 12:22:55)
Offline
With 'a guide' I presume you referred to this guide
The guide states
To set static IP on enp3s0 interface you will need to create /etc/conf.d/network@enp3s0 config file and run:
# systemctl enable network@enp3s0.service
where enp3s0 has to be changed into your own interface name.
Note that the EnvironmentFile has to change to /etc/conf.d/network@<interface>.
Offline