* Re: [gentoo-user] Systemd and static network
@ 2013-07-26 9:26 99% ` Stefan G. Weichinger
0 siblings, 0 replies; 1+ results
From: Stefan G. Weichinger @ 2013-07-26 9:26 UTC (permalink / raw
To: gentoo-user
Am 25.07.2013 17:42, schrieb Canek Peláez Valdés:
>> What do you use - and what are the benefits of your method?
>
> I use the following unit in one of my servers:
>
> # -------------------------------------------------------------------------------------------
> [Unit]
My current version, using "ip" :
# cat network.service
[Unit]
Description=Network Connectivity
[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=/etc/conf.d/network_systemd
ExecStart=/bin/ip link set dev ${interface} up
ExecStart=/bin/ip addr add ${address}/${netmask} broadcast ${broadcast}
dev ${interface}
ExecStart=/bin/ip route add default via ${gateway}
ExecStop=/bin/ip addr flush dev ${interface}
ExecStop=/bin/ip link set dev ${interface} down
[Install]
WantedBy=network.target
----- so that unitfile does not have to be touched again and you only
edit /etc/conf.d/network_systemd ->
# cat /etc/conf.d/network_systemd
PATH=/sbin:/usr/sbin
interface=p4p1
address=192.x.y.z
netmask=255.255.255.0
broadcast=192.x.y.zz
gateway=192.x.y.zzz
-----
I have a second unitfile with a more complicated setup for bridging
(with KVM).
Stefan
^ permalink raw reply [relevance 99%]
Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2013-07-25 10:46 [gentoo-user] Systemd and static network Michael Hampicke
2013-07-25 15:42 ` Canek Peláez Valdés
2013-07-26 9:26 99% ` Stefan G. Weichinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox