From mboxrd@z Thu Jan 1 00:00:00 1970 From: Efraim Flashner Subject: Re: how can I add a static IPv4 route? Date: Thu, 13 Feb 2020 10:42:46 +0200 Message-ID: <20200213084246.GC26473@E5400> References: <87blq3brv5.fsf@roquette.mug.biscuolo.net> <874kvuc2w9.fsf@roquette.mug.biscuolo.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="DqhR8hV3EnoxUkKN" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:37939) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2A5g-0005UD-6M for help-guix@gnu.org; Thu, 13 Feb 2020 03:43:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2A5f-000239-1g for help-guix@gnu.org; Thu, 13 Feb 2020 03:43:20 -0500 Received: from flashner.co.il ([178.62.234.194]:34208) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j2A5e-00022r-PA for help-guix@gnu.org; Thu, 13 Feb 2020 03:43:18 -0500 Content-Disposition: inline In-Reply-To: <874kvuc2w9.fsf@roquette.mug.biscuolo.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane-mx.org@gnu.org Sender: "Help-Guix" To: Giovanni Biscuolo Cc: help-guix@gnu.org --DqhR8hV3EnoxUkKN Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 13, 2020 at 09:22:46AM +0100, Giovanni Biscuolo wrote: > Hi Julien >=20 > thanks for your support! >=20 > Julien Lepiller writes: >=20 > > Le 12 f=C3=A9vrier 2020 13:08:46 GMT-05:00, Giovanni Biscuolo a =C3=A9crit : > >>Hello, > >> > >>I have a very simple networking configuration: > >> > >>--8<---------------cut here---------------start------------->8--- > >>(service dhcp-client-service-type) > >>--8<---------------cut here---------------end--------------->8--- > >> > >>Please how can I add a static route? (I know there is wip-netlink, but > >>AFAIU it's still not in master) >=20 > [...] >=20 > > However, if you don't need IPv6, I'd like to encourage you to use the > > static-networking-service that's described in the manual: > > https://guix.gnu.org/manual/devel/en/html_node/Networking-Services.html= #Networking-Services >=20 > Thanks for your suggestion but I don't understand how to use it just to > add a static route to the interface set up by dhcp-client-service-type. >=20 > I'm trying to have something similar to this debian interfaces config: >=20 > --8<---------------cut here---------------start------------->8--- > auto eth0 > iface eth0 inet dhcp > ### static routing for eth0 ### > post-up route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.9.38.65 > pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 10.9.38.65 > --8<---------------cut here---------------end--------------->8--- >=20 > I'd like to stay whith a dhcp client config, but please provide an > example on how to add a static route to a configuration like this: >=20 > --8<---------------cut here---------------start------------->8--- > (static-networking-service "eno1" "192.168.1.82" > #:gateway "192.168.1.2" > #:name-servers '("192.168.1.2")) > --8<---------------cut here---------------end--------------->8--- >=20 I'm going to take a shot at this. There's another example in the guix-maintenance repo for berlin and some other machines ;; Connection to the DMZ for public access ;; This is a 1G port only (static-networking-service "eno1" "141.80.181.41" #:netmask "255.255.255.0" #:gateway "141.80.181.1") ;; This is a 10G port. (static-networking-service "enp129s0f0" "141.80.181.40" #:netmask "255.255.255.0") ;; Connection to build nodes (static-networking-service "eno3" "141.80.167.131" #:netmask "255.255.255.192") So for what you've posted I would guess the following: (It doesn't look like the static-networking-service allows you to use DHCP to receive an IP address) (static-networking-service "eth0" "10.x.y.z" #:netmask "255.0.0.0" #:gateway "10.9.38.65") --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --DqhR8hV3EnoxUkKN Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAl5FDAQACgkQQarn3Mo9 g1HtuQ/+OQ6zY5/dO1t/UQIdJ9GvYwmfHdx4eLveyPeT3kRWjZD/7dbySxu6C9h1 RPId7KK5DwcSzEoPS+AsqjXRuOq6dJf5iriFf6BXscrlrg27B+0JnxtKfxZytcqa kpkLNcDOevUkJzU8T/RDgZTNJ91sMhc2aBFXBGw0nNBGAntLiwcWfR1kqG7IEJbE sKSo8GjAFymW6v0hiKjIkzzrcv+bcPQ63DpWKCRc8Noy9VyEYWoFLJt7DWtA85jf g5B8bRmgJdeqKfW7HMLT3JhIkJH2tvqV60/RW1phuHclDSVHgjLELI/F7H9gaYBe Wc3ePSfGaDXtWPpG9u9DpLaM0FnCd9wsvEB9TJTAMfPxTsoa1ozrKnyIA7kxrdon RK4V8tqEbKubxDgPFFI7TzAxEv0SVV8OU0F5P6LG9bXLkHRQM2jAJzUGkm0UBAgA itf45WGOuiZkZhLbHGvy/Mfu9UxNcCoU0LhHSPUwyxGQB2JaNAc/uoHDE6awB/gJ kjV+AUBkAeu3z+qyWqO8YC3lyhSXC+v2u3+LLVO7bgEcfnZ2jgl9jXHvDmFs+7Zx hKXs8xaLcOLFh6PxpIan7KOTudPakFTa8RpAqKUWSLIXCoXpGkmSCVkNLNUtMmoO dWTleHOp5m+ySE4KnjASzw6ok1oT4wWyj3RvsUJ66N0dc3862DI= =m0St -----END PGP SIGNATURE----- --DqhR8hV3EnoxUkKN--