From: Michael Hampicke <mh@hadt.biz>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Systemd and static network
Date: Fri, 26 Jul 2013 13:35:26 +0200 [thread overview]
Message-ID: <a0da705d0bb63ddde7af14b4e7d47ec1@hadt.biz> (raw)
In-Reply-To: <51F240DC.4080907@xunil.at>
Am 2013-07-26 11:26, schrieb Stefan G. Weichinger:
> 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
Good idea, I already had forgotten that you could parse variables from
another file in a systemd unit.
prev parent reply other threads:[~2013-07-26 11:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-25 10:46 [gentoo-user] Systemd and static network Michael Hampicke
2013-07-25 12:18 ` Douglas J Hunley
2013-07-25 13:23 ` Pavel Volkov
2013-07-25 13:26 ` Pavel Volkov
2013-07-25 13:28 ` Pavel Volkov
2013-07-25 15:05 ` Michael Hampicke
2013-07-25 15:42 ` Canek Peláez Valdés
[not found] ` <51F1D5D2.6030200@gentoo.org>
2013-07-26 2:13 ` [gentoo-user] " Canek Peláez Valdés
2013-07-26 4:46 ` [gentoo-user] " Michael Hampicke
2013-07-26 5:34 ` Keith Dart
2013-07-26 9:26 ` Stefan G. Weichinger
2013-07-26 11:35 ` Michael Hampicke [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a0da705d0bb63ddde7af14b4e7d47ec1@hadt.biz \
--to=mh@hadt.biz \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox