From: Julien Lepiller <julien@lepiller.eu>
To: Efraim Flashner <efraim@flashner.co.il>, Giovanni Biscuolo <g@xelera.eu>
Cc: help-guix@gnu.org
Subject: Re: how can I add a static IPv4 route?
Date: Thu, 13 Feb 2020 07:12:59 -0500 [thread overview]
Message-ID: <0D41CE3A-EFE0-437B-9CF6-0AD1BCE056B4@lepiller.eu> (raw)
In-Reply-To: <20200213084246.GC26473@E5400>
Le 13 février 2020 03:42:46 GMT-05:00, Efraim Flashner <efraim@flashner.co.il> a écrit :
>On Thu, Feb 13, 2020 at 09:22:46AM +0100, Giovanni Biscuolo wrote:
>> Hi Julien
>>
>> thanks for your support!
>>
>> Julien Lepiller <julien@lepiller.eu> writes:
>>
>> > Le 12 février 2020 13:08:46 GMT-05:00, Giovanni Biscuolo
><g@xelera.eu> a écrit :
>> >>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)
>>
>> [...]
>>
>> > 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
>>
>> 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.
>>
>> I'm trying to have something similar to this debian interfaces
>config:
>>
>> --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---
>>
>> 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:
>>
>> --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---
>>
>
>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")
Ah you're right, I didn't understand. You'll need a new service that runs after the dhcp service and adds the route, with iproute2 for instance.
prev parent reply other threads:[~2020-02-13 16:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-12 18:08 how can I add a static IPv4 route? Giovanni Biscuolo
2020-02-12 18:34 ` Julien Lepiller
2020-02-13 8:22 ` Giovanni Biscuolo
2020-02-13 8:42 ` Efraim Flashner
2020-02-13 12:12 ` Julien Lepiller [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=0D41CE3A-EFE0-437B-9CF6-0AD1BCE056B4@lepiller.eu \
--to=julien@lepiller.eu \
--cc=efraim@flashner.co.il \
--cc=g@xelera.eu \
--cc=help-guix@gnu.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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.