From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id EE0B61381F3 for ; Fri, 26 Jul 2013 04:46:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 86F0BE09EF; Fri, 26 Jul 2013 04:46:16 +0000 (UTC) Received: from mx1.hadt.biz (sil.hadt.biz [5.9.16.100]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4C568E09E2 for ; Fri, 26 Jul 2013 04:46:15 +0000 (UTC) Received: from [192.168.255.100] (p5DCC70A1.dip0.t-ipconnect.de [93.204.112.161]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.hadt.biz (Postfix) with ESMTPSA id 526114006B for ; Fri, 26 Jul 2013 06:46:10 +0200 (CEST) Message-ID: <51F1FF10.8010406@hadt.biz> Date: Fri, 26 Jul 2013 06:46:08 +0200 From: Michael Hampicke Organization: Hampicke Datentechnik User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Systemd and static network References: <51F10221.1080807@hadt.biz> In-Reply-To: X-Enigmail-Version: 1.5.2 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="JRsMl55UMQsaIaig6NbOMRBWI8QrqBm1c" X-Archives-Salt: a0811fdf-8190-4802-8d7a-15d1312aa39b X-Archives-Hash: 26d6ee70aa35043919d36127500d7244 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --JRsMl55UMQsaIaig6NbOMRBWI8QrqBm1c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am 25.07.2013 17:42, schrieb Canek Pel=C3=A1ez Vald=C3=A9s: > On Thu, Jul 25, 2013 at 5:46 AM, Michael Hampicke wrote: >> Howdy folks, >> >> currently I am migrating some servers to systemd, and I am wondering >> what's the best way to set up static networking. Until now, I always >> used dhcp + networkmanager (workstations, laptops). >> >> Some suggested creating your own network unit and manually start >> ifconfig/route or ip via ExecStart, some suggested Arch's netctl which= >> seems to support static addresses and brings a systemd unit file. >> >> At the moment, following the KISS principle, I tend to a customized un= it >> file. >> >> What do you use - and what are the benefits of your method? >=20 > I use the following unit in one of my servers: >=20 > # ---------------------------------------------------------------------= ---------------------- > [Unit] > Description=3DStatic network service > After=3Dlocal-fs.target > Documentation=3Dman:ifconfig(8) > Documentation=3Dman:route(8) >=20 > [Service] > Type=3Doneshot > RemainAfterExit=3Dyes > ExecStart=3D/bin/ifconfig broadcast netmask up > ExecStart=3D/bin/route add default gw > # ---------------------------------------------------------------------= ---------------------- >=20 > Obviously, change the necessary parameters. >=20 > The benefit is that it doesn't get any more simple, I believe. If DHCP > is available and I don't want to use NetworkManager, I use the > following unit: >=20 > # ---------------------------------------------------------------------= ---------------------- > [Unit] > Description=3DDHCP on %I > After=3Dbasic.target >=20 > [Service] > ExecStartPre=3D/bin/ifconfig %I up > ExecStart=3D/sbin/dhcpcd -B %I >=20 > [Install] > WantedBy=3Dmulti-user.target > # ---------------------------------------------------------------------= ---------------------- >=20 > You can then enable the unit with: >=20 > systemctl enable dhcpcd@DEV.service >=20 > where DEV is enp0s0, or whatever funny name udev gives to your network > card. I think I got the unit from Arch, or maybe I wrote; I honestly > don't remember. >=20 > Regards. >=20 Tanks. I will give netctl a try in a VM. For now, on real machines, I am going with the unit you suggested. --JRsMl55UMQsaIaig6NbOMRBWI8QrqBm1c Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (GNU/Linux) iQEcBAEBAgAGBQJR8f8QAAoJEK7HowNX6Bk+EPQIALZFu0C4O2s1g7K+TgYu2Hlr lC2HD5tImRqZo8IiuAZ9fkEu2C2S18vbfBBGOQaEW71EQ7jCKwZ5PjAqsTtnJmsw +xi4yn/wBJIAak+dnFfTdVM3HgZWF1vv0KNX5xBbG5sbEnuz0JXy4NDd5w8ZLc1e xQEA9u/46tb7446ebaGt2EJTnVZ7BT62GOrO+/pBelVqDEkLE8+JbBoDp5g8FcJI +5sv27Hho2b+Ik1Yc/PQ2JgQxlK7HgMLNXCGUhkWAsaeoPJOm92KY6S6aK0NQKI6 w5XTbSykl85XxsCa592NunBAm4qFyDw0iuJRh/ZoFpWUyT0Wz69nizMnoL0RP+w= =xkg7 -----END PGP SIGNATURE----- --JRsMl55UMQsaIaig6NbOMRBWI8QrqBm1c--