From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Lepiller Subject: Re: how can I add a static IPv4 route? Date: Thu, 13 Feb 2020 07:12:59 -0500 Message-ID: <0D41CE3A-EFE0-437B-9CF6-0AD1BCE056B4@lepiller.eu> References: <87blq3brv5.fsf@roquette.mug.biscuolo.net> <874kvuc2w9.fsf@roquette.mug.biscuolo.net> <20200213084246.GC26473@E5400> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:57303) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2Hn1-0002Qn-Dh for help-guix@gnu.org; Thu, 13 Feb 2020 11:56:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2Hn0-0002tU-22 for help-guix@gnu.org; Thu, 13 Feb 2020 11:56:35 -0500 Received: from lepiller.eu ([2a00:5884:8208::1]:59048) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j2Hmz-0002ol-IA for help-guix@gnu.org; Thu, 13 Feb 2020 11:56:34 -0500 In-Reply-To: <20200213084246.GC26473@E5400> 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: Efraim Flashner , Giovanni Biscuolo Cc: help-guix@gnu.org Le 13 f=C3=A9vrier 2020 03:42:46 GMT-05:00, Efraim Flashner a =C3=A9crit : >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 >> [=2E=2E=2E] >>=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=2Egnu=2Eorg/manual/devel/en/html_node/Networking-Services=2E= 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=2E >>=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=2E0=2E0=2E0 netmask 255=2E0=2E0=2E0 g= w >10=2E9=2E38=2E65 >> pre-down route del -net 10=2E0=2E0=2E0 netmask 255=2E0=2E0=2E0 = gw >10=2E9=2E38=2E65 >> --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=2E168=2E1=2E82" >> #:gateway "192=2E168=2E1=2E2" >> #:name-servers '("192=2E168=2E1=2E2")) >> --8<---------------cut here---------------end--------------->8--- >>=20 > >I'm going to take a shot at this=2E 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=2E80=2E181=2E41" > #:netmask "255=2E255=2E255=2E0" > #:gateway "141=2E80=2E181=2E1") > ;; This is a 10G port=2E > (static-networking-service "enp129s0f0" > "141=2E80=2E181=2E40" > #:netmask "255=2E255=2E255=2E0") > ;; Connection to build nodes > (static-networking-service "eno3" > "141=2E80=2E167=2E131" > #:netmask "255=2E255=2E255=2E192"= ) > > >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=2Ex=2Ey=2Ez" > #:netmask "255=2E0=2E0=2E0" > #:gateway "10=2E9=2E38=2E65") Ah you're right, I didn't understand=2E You'll need a new service that run= s after the dhcp service and adds the route, with iproute2 for instance=2E