public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Stefan G. Weichinger" <lists@xunil.at>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Systemd and static network
Date: Fri, 26 Jul 2013 11:26:52 +0200	[thread overview]
Message-ID: <51F240DC.4080907@xunil.at> (raw)
In-Reply-To: <CADPrc803kq_c76b1oqp3PksvDgyP5MD+zqLGqcsxk=eCT2iYRA@mail.gmail.com>

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



  parent reply	other threads:[~2013-07-26  9:27 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 [this message]
2013-07-26 11:35     ` Michael Hampicke

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=51F240DC.4080907@xunil.at \
    --to=lists@xunil.at \
    --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