mbox series

[bug#51440,00/10] Declarative static networking interface

Message ID 20211027135918.18833-1-ludo@gnu.org
Headers show
Series Declarative static networking interface | expand

Message

Ludovic Courtès Oct. 27, 2021, 1:59 p.m. UTC
Hi!

This patch set builds on Julien’s neat Guile-Netlink to finally
provide a proper static networking configuration interface.  One
can now write things like:

  (service static-networking-service-type
           ;; Network configuration for one NIC, IPv4 + IPv6.
           (static-networking
            (addresses (list (network-address
                              (device "eno1")
                              (value "10.0.2.15/24"))
                             (network-address
                              (device "eno1")
                              (value "2001:123:4567:101::1"))))
            (routes (list (network-route
                           (destination "default")
                           (gateway "10.0.2.2"))
                          (network-route
                           (destination "default")
                           (gateway "2020:321:4567:42::1"))))
            (name-servers '("10.0.2.3"))))

For the record, the ‘static-networking-service’ procedure currently
in ‘master’ is IPv4-only and would not allow you to assign more
than one address to an interface anyway, among other limitations.
These long-overdue patches close an embarrassing gap.

The interface provided here is a direct mapping of that of Guile-Netlink,
which is the same as that of the ‘ip’ command, itself closely
modeled after Linux’s internal interfaces AIUI.  Thus, it should be
roughly as expressive as ‘ip’, but declarative.

I’m not a network person though, so I’d appreciate if more
knowledgeable people would take a look at the interface.  In particular,
I’d like to have examples of ‘links’ to include in the manual—I’m not
quite sure how to use that.  Ideas?

This patches preserve backward-compatibility: the
‘static-networking-service’ procedure still works the same.  There’s
one observable difference though: there’s only one ‘networking’
Shepherd service now; you no longer get ‘networking-eno1’ and similar.
The ‘static-networking’ constructor was public since commit
c9436025a90b86047ba2203d58bbf238f8f9b2f9 but undocumented; thus I
changed the fields of <static-networking> without worrying about
compatibility.

I tested this with:

  make check-system \
    TESTS="static-networking openvswitch ganeti-kvm dhcpd childhurd"

I would appreciate more testing, including tests on the bare metal
for IPv6 support.

Ensuring portability to GNU/Hurd took me more time than I’d have
thought, but it works.  “Links” are not supported there, and only
“default” routes are supported.

I took a detour in commit “Use Guile-Netlink on GNU/Linux”: that
patch shows that I was blissfully hoping to use good’ol ioctls
on GNU/Hurd, but that turned out to be a dead end because they
don’t support IPv6 (which really isn’t a surprise but I don’t know,
I must have been lacking focus at that point of my journey!).

With all this I think we should be able to do “cool things with
containers”, but again, that’s not my area of expertise so please
do chime in if you container networking is your thing.

Feedback welcome!

Ludo’.

Ludovic Courtès (10):
  tests: Add 'static-networking' test.
  tests: openvswitch: Check whether ovs0 is up.
  doc: Add new "Networking Setup" node for the main setup options.
  gnu: guile-netlink: Allow cross-compilation.
  services: static-networking: Use Guile-Netlink on GNU/Linux.
  services: secret-service: Turn into a Shepherd service.
  services: static-networking: Change interface to mimic netlink.
  services: Define '%qemu-static-networking'.
  services: Define '%loopback-static-networking'.
  tests: Replace uses of deprecated 'static-networking-service'.

 doc/guix.texi                   | 505 ++++++++++++++++++++++----------
 gnu/build/hurd-boot.scm         |  10 +-
 gnu/build/secret-service.scm    |  17 +-
 gnu/packages/guile-xyz.scm      |  11 +-
 gnu/services/base.scm           | 391 +++++++++++++++++++------
 gnu/services/virtualization.scm |  45 ++-
 gnu/system/hurd.scm             |  12 +-
 gnu/system/install.scm          |   5 +-
 gnu/tests/ganeti.scm            |   7 +-
 gnu/tests/networking.scm        | 141 ++++++++-
 10 files changed, 851 insertions(+), 293 deletions(-)


base-commit: 0a42998a50e8bbe9e49142b21a570db00efe7491

Comments

Julien Lepiller Oct. 27, 2021, 3:29 p.m. UTC | #1
Le 27 octobre 2021 09:59:18 GMT-04:00, "Ludovic Courtès" <ludo@gnu.org> a écrit :
>Hi!
>
>This patch set builds on Julien’s neat Guile-Netlink to finally
>provide a proper static networking configuration interface.  One
>can now write things like:
>
>  (service static-networking-service-type
>           ;; Network configuration for one NIC, IPv4 + IPv6.
>           (static-networking
>            (addresses (list (network-address
>                              (device "eno1")
>                              (value "10.0.2.15/24"))
>                             (network-address
>                              (device "eno1")
>                              (value "2001:123:4567:101::1"))))
>            (routes (list (network-route
>                           (destination "default")
>                           (gateway "10.0.2.2"))
>                          (network-route
>                           (destination "default")
>                           (gateway "2020:321:4567:42::1"))))
>            (name-servers '("10.0.2.3"))))
>
>For the record, the ‘static-networking-service’ procedure currently
>in ‘master’ is IPv4-only and would not allow you to assign more
>than one address to an interface anyway, among other limitations.
>These long-overdue patches close an embarrassing gap.
>
>The interface provided here is a direct mapping of that of Guile-Netlink,
>which is the same as that of the ‘ip’ command, itself closely
>modeled after Linux’s internal interfaces AIUI.  Thus, it should be
>roughly as expressive as ‘ip’, but declarative.
>
>I’m not a network person though, so I’d appreciate if more
>knowledgeable people would take a look at the interface.  In particular,
>I’d like to have examples of ‘links’ to include in the manual—I’m not
>quite sure how to use that.  Ideas?
>
>This patches preserve backward-compatibility: the
>‘static-networking-service’ procedure still works the same.  There’s
>one observable difference though: there’s only one ‘networking’
>Shepherd service now; you no longer get ‘networking-eno1’ and similar.
>The ‘static-networking’ constructor was public since commit
>c9436025a90b86047ba2203d58bbf238f8f9b2f9 but undocumented; thus I
>changed the fields of <static-networking> without worrying about
>compatibility.
>
>I tested this with:
>
>  make check-system \
>    TESTS="static-networking openvswitch ganeti-kvm dhcpd childhurd"
>
>I would appreciate more testing, including tests on the bare metal
>for IPv6 support.
>
>Ensuring portability to GNU/Hurd took me more time than I’d have
>thought, but it works.  “Links” are not supported there, and only
>“default” routes are supported.
>
>I took a detour in commit “Use Guile-Netlink on GNU/Linux”: that
>patch shows that I was blissfully hoping to use good’ol ioctls
>on GNU/Hurd, but that turned out to be a dead end because they
>don’t support IPv6 (which really isn’t a surprise but I don’t know,
>I must have been lacking focus at that point of my journey!).
>
>With all this I think we should be able to do “cool things with
>containers”, but again, that’s not my area of expertise so please
>do chime in if you container networking is your thing.
>
>Feedback welcome!
>
>Ludo’.
>
>Ludovic Courtès (10):
>  tests: Add 'static-networking' test.
>  tests: openvswitch: Check whether ovs0 is up.
>  doc: Add new "Networking Setup" node for the main setup options.
>  gnu: guile-netlink: Allow cross-compilation.
>  services: static-networking: Use Guile-Netlink on GNU/Linux.
>  services: secret-service: Turn into a Shepherd service.
>  services: static-networking: Change interface to mimic netlink.
>  services: Define '%qemu-static-networking'.
>  services: Define '%loopback-static-networking'.
>  tests: Replace uses of deprecated 'static-networking-service'.
>
> doc/guix.texi                   | 505 ++++++++++++++++++++++----------
> gnu/build/hurd-boot.scm         |  10 +-
> gnu/build/secret-service.scm    |  17 +-
> gnu/packages/guile-xyz.scm      |  11 +-
> gnu/services/base.scm           | 391 +++++++++++++++++++------
> gnu/services/virtualization.scm |  45 ++-
> gnu/system/hurd.scm             |  12 +-
> gnu/system/install.scm          |   5 +-
> gnu/tests/ganeti.scm            |   7 +-
> gnu/tests/networking.scm        | 141 ++++++++-
> 10 files changed, 851 insertions(+), 293 deletions(-)
>
>
>base-commit: 0a42998a50e8bbe9e49142b21a570db00efe7491

Looks good at first glance. I noticed a few typos in the manual, so I'll send you more details after I read it more carefully. I'll try that on my hardware, although again I'm not sure how I can run reconfigure from my checkout exactly? (Where do I use sudo, and what options do I need)
Ludovic Courtès Oct. 29, 2021, 9:44 p.m. UTC | #2
Julien Lepiller <julien@lepiller.eu> skribis:

> Looks good at first glance. I noticed a few typos in the manual, so I'll send you more details after I read it more carefully. I'll try that on my hardware, although again I'm not sure how I can run reconfigure from my checkout exactly? (Where do I use sudo, and what options do I need)

To reconfigure from a checkout, you can run:

  sudo -E ./pre-inst-env guix system reconfigure …

where ‘-E’ tells sudo to preserve notably GUILE_LOAD_PATH & co., such
that Guile-Gcrypt and the other dependencies are found.

HTH!

Ludo’.
David Aaron Fendley Nov. 3, 2021, 1:27 p.m. UTC | #3
If I have:

  (service static-networking-service-type
  	   (list (static-networking
  		  (addresses (list (network-address
  				    (device "eno33559296")
  				    (value "10.7.99.99/24"))
  				   (network-address
  				    (device "eno16780032")
  				    (value "10.10.199.98/24"))))
  		  (routes (list (network-route
  				 (destination "default")
  				 (gateway "10.10.199.1"))
  				(network-route
  				 (destination "192.168.0.1/32")
  				 (gateway "10.10.199.1"))))
  		  (name-servers '("10.10.199.17" "10.10.101.2")))))

After reconfigure and restart of the networking service, no routes
listed are created. Only the standard routes for each network:

  > ip a
  
  1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      inet 127.0.0.1/8 scope host lo
         valid_lft forever preferred_lft forever
      inet 127.0.0.1/0 scope global lo
         valid_lft forever preferred_lft forever
      inet6 ::1/128 scope host 
         valid_lft forever preferred_lft forever
  2: eno16780032: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
      link/ether 00:50:56:98:d1:9f brd ff:ff:ff:ff:ff:ff
      inet 10.10.199.98/24 scope global eno16780032
         valid_lft forever preferred_lft forever
      inet6 fe80::250:56ff:fe98:d19f/64 scope link 
         valid_lft forever preferred_lft forever
  3: eno33559296: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
      link/ether 00:50:56:98:37:c2 brd ff:ff:ff:ff:ff:ff
      inet 10.7.99.99/24 scope global eno33559296
         valid_lft forever preferred_lft forever
      inet6 fe80::250:56ff:fe98:37c2/64 scope link 
         valid_lft forever preferred_lft forever


  > ip r
  
  10.7.99.0/24 dev eno33559296 proto kernel scope link src 10.7.99.99 
  10.10.199.0/24 dev eno16780032 proto kernel scope link src 10.10.199.98 


If I then change the config to:

  (service static-networking-service-type
  	   (list (static-networking
  		  (addresses (list (network-address
  				    (device "eno33559296")
  				    (value "10.0.7.15/24"))
  				   (network-address
  				    (device "eno16780032")
  				    (value "10.10.2.15/24"))))
  		  (routes (list (network-route
  				 (destination "default")
  				 (gateway "10.0.2.2"))))
  		  (name-servers '("10.0.2.3")))))



After reconfigure and restart of the networking service, routes
specified are still not created, and the addresses and routes are
appended:

  > ip a

  1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      inet 127.0.0.1/8 scope host lo
         valid_lft forever preferred_lft forever
      inet 127.0.0.1/0 scope global lo
         valid_lft forever preferred_lft forever
      inet6 ::1/128 scope host 
         valid_lft forever preferred_lft forever
  2: eno16780032: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
      link/ether 00:50:56:98:d1:9f brd ff:ff:ff:ff:ff:ff
      inet 10.10.199.98/24 scope global eno16780032
         valid_lft forever preferred_lft forever
      inet 10.10.2.15/24 scope global eno16780032
         valid_lft forever preferred_lft forever
      inet6 fe80::250:56ff:fe98:d19f/64 scope link 
         valid_lft forever preferred_lft forever
  3: eno33559296: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
      link/ether 00:50:56:98:37:c2 brd ff:ff:ff:ff:ff:ff
      inet 10.7.99.99/24 scope global eno33559296
         valid_lft forever preferred_lft forever
      inet 10.0.7.15/24 scope global eno33559296
         valid_lft forever preferred_lft forever
      inet6 fe80::250:56ff:fe98:37c2/64 scope link 
         valid_lft forever preferred_lft forever

  > ip r

  10.0.7.0/24 dev eno33559296 proto kernel scope link src 10.0.7.15 
  10.7.99.0/24 dev eno33559296 proto kernel scope link src 10.7.99.99 
  10.10.2.0/24 dev eno16780032 proto kernel scope link src 10.10.2.15 
  10.10.199.0/24 dev eno16780032 proto kernel scope link src 10.10.199.98 


Expectation:

Routes declared would be added and standard network routes would be
removed if no longer relevant.


Environment:

These ten patches were applied on top of:

  7af3b822178782d6598865e1d6a780a756dd0cb3


  > guix describe
  
  Generation 2	Nov 02 2021 13:37:58	(current)
    guix 8d02b0d
      repository URL: https://git.savannah.gnu.org/git/guix.git
      branch: master
      commit: 8d02b0d46cfc27b905f9276760aefacf518ae4f7
Ludovic Courtès Nov. 15, 2021, 10:30 p.m. UTC | #4
Hi!

Changes since v1:

  • ‘herd stop networking’ fixed, as reported by David Aaron
    Fendley.

  • Guile-Netlink cross-compilation simplified thanks to changes
    in Guile-Netlink 1.1.

  • ‘provision’ field of <static-networking> defaults to
    '(networking), as suggested by Julien.

  • “network-tear-down” script wraps calls in ‘false-if-netlink-error’
    to go as far as possible.

  • Documentation fixed as suggested by Julien.

Thoughts?  Test reports?  :-)

Note: It requires Guile-Netlink 1.1 as added in
46432cceebe392a1744980f370a48ef73afbac2c (it fixes another issue
David reported earlier.)

Ludo’.

Ludovic Courtès (10):
  tests: Add 'static-networking' test.
  tests: openvswitch: Check whether ovs0 is up.
  doc: Add new "Networking Setup" node for the main setup options.
  gnu: guile-netlink: Allow cross-compilation.
  services: static-networking: Use Guile-Netlink on GNU/Linux.
  services: secret-service: Turn into a Shepherd service.
  services: static-networking: Change interface to mimic netlink.
  services: Define '%qemu-static-networking'.
  services: Define '%loopback-static-networking'.
  tests: Replace uses of deprecated 'static-networking-service'.

 doc/guix.texi                   | 504 ++++++++++++++++++++++----------
 gnu/build/hurd-boot.scm         |  10 +-
 gnu/build/secret-service.scm    |  17 +-
 gnu/packages/guile-xyz.scm      |   3 +-
 gnu/services/base.scm           | 406 +++++++++++++++++++------
 gnu/services/virtualization.scm |  45 ++-
 gnu/system/hurd.scm             |  12 +-
 gnu/system/install.scm          |   5 +-
 gnu/tests/ganeti.scm            |   7 +-
 gnu/tests/networking.scm        | 141 ++++++++-
 10 files changed, 855 insertions(+), 295 deletions(-)


base-commit: 21332f3b8cb8f407a89cdfe7d0460a9947675872
Vivien Kraus Nov. 17, 2021, 7:36 p.m. UTC | #5
Dear guix,

The static networking service looks great, but when I tried to assign
address 2a00:5881:4008:2810::309/64 to my interface, I end up (when
looking at ip -6 address) with 903::1028:840:8158:2a/64.

Since the bytes are reversed, I would look at guile-netlink and check
if all byte orders are correct when using bytevectors :)

g!inggbudey ppHa

Vivien
Ludovic Courtès Dec. 10, 2021, 10:51 a.m. UTC | #6
⹁iH

Vivien Kraus <vivien@planete-kraus.eu> skribis:

> The static networking service looks great, but when I tried to assign
> address 2a00:5881:4008:2810::309/64 to my interface, I end up (when
> looking at ip -6 address) with 903::1028:840:8158:2a/64.
>
> Since the bytes are reversed, I would look at guile-netlink and check
> if all byte orders are correct when using bytevectors :)

Julien fixed this interesting bug in Guile-Netlink 1.1.1, which is now
in ‘master’ (thanks!).

I rebased ‘wip-networking-netlink’ to get this fix.

Could you give it another try?

Any other issues left?  If not, I think we could go ahead and merge it!

Thanks,
Ludo’.
Vivien Kraus Dec. 11, 2021, 12:56 p.m. UTC | #7
Hi,

Le vendredi 10 décembre 2021 à 11:51 +0100, Ludovic Courtès a écrit :
> Vivien Kraus <vivien@planete-kraus.eu> skribis:
> 
> > The static networking service looks great, but when I tried to assign
> > address 2a00:5881:4008:2810::309/64 to my interface, I end up (when
> > looking at ip -6 address) with 903::1028:840:8158:2a/64.
> > 
> > Since the bytes are reversed, I would look at guile-netlink and check
> > if all byte orders are correct when using bytevectors :)
> 
> Julien fixed this interesting bug in Guile-Netlink 1.1.1, which is now
> in ‘master’ (thanks!).
> 
> I rebased ‘wip-networking-netlink’ to get this fix.
> 
> Could you give it another try?

The IP seems good.

> Any other issues left?

I have a couple:
- I get an extra IPv6 (inet6 xxxx/64 scope global dynamic mngtmpaddr
valid_lft forever preferred_lft forever) that I did not ask for and
that takes precedence as a source for the default route, which defeats
the purpose. I’m not sure it’s guile-netlink’s fault.
- Now opensmtpd fails to start with: 

Dec 11 12:01:32 localhost smtpd[5368]: info: OpenSMTPD 6.8.0p2 starting
Dec 11 12:01:32 localhost smtpd[5373]: pony express: listen: Address
already in use
Dec 11 12:01:32 localhost smtpd[5369]: smtpd: process ca socket closed

Maybe it’s unrelated, but that’s a problem for me.

Vivien
Ludovic Courtès Dec. 11, 2021, 9:39 p.m. UTC | #8
Hi Vivien,

Vivien Kraus <vivien@planete-kraus.eu> skribis:

> Le vendredi 10 décembre 2021 à 11:51 +0100, Ludovic Courtès a écrit :
>> Vivien Kraus <vivien@planete-kraus.eu> skribis:

[...]

>> Julien fixed this interesting bug in Guile-Netlink 1.1.1, which is now
>> in ‘master’ (thanks!).
>> 
>> I rebased ‘wip-networking-netlink’ to get this fix.
>> 
>> Could you give it another try?
>
> The IP seems good.

\o/

>> Any other issues left?
>
> I have a couple:
> - I get an extra IPv6 (inet6 xxxx/64 scope global dynamic mngtmpaddr
> valid_lft forever preferred_lft forever) that I did not ask for and
> that takes precedence as a source for the default route, which defeats
> the purpose. I’m not sure it’s guile-netlink’s fault.

Hmm, what’s that IPv6 address?  Is it here even if you do not configure
any IPv6 address in ‘static-networking’?

Julien, could the ‘link-set’ call in ‘network-set-up/linux’ be the
culprit?

    #$@(map (lambda (address)
              #~(begin
                  (addr-add #$(network-address-device address)
                            #$(network-address-value address)
                            #:ipv6?
                            #$(network-address-ipv6? address))
                  ;; FIXME: loopback?
                  (link-set #$(network-address-device address)
                            #:up #t)))
            addresses)

It seems to be the only way to mark the device as “up”, but since it has
arguments that seem redundant with those of ‘addr-add’, I wonder if
something could go wrong here.

Thanks for testing, Vivien!

Ludo’.
Julien Lepiller Dec. 11, 2021, 10:19 p.m. UTC | #9
Le 11 décembre 2021 16:39:19 GMT-05:00, "Ludovic Courtès" <ludo@gnu.org> a écrit :
>Hi Vivien,
>
>Vivien Kraus <vivien@planete-kraus.eu> skribis:
>
>> Le vendredi 10 décembre 2021 à 11:51 +0100, Ludovic Courtès a écrit :
>>> Vivien Kraus <vivien@planete-kraus.eu> skribis:
>
>[...]
>
>>> Julien fixed this interesting bug in Guile-Netlink 1.1.1, which is now
>>> in ‘master’ (thanks!).
>>> 
>>> I rebased ‘wip-networking-netlink’ to get this fix.
>>> 
>>> Could you give it another try?
>>
>> The IP seems good.
>
>\o/
>
>>> Any other issues left?
>>
>> I have a couple:
>> - I get an extra IPv6 (inet6 xxxx/64 scope global dynamic mngtmpaddr
>> valid_lft forever preferred_lft forever) that I did not ask for and
>> that takes precedence as a source for the default route, which defeats
>> the purpose. I’m not sure it’s guile-netlink’s fault.
>
>Hmm, what’s that IPv6 address?  Is it here even if you do not configure
>any IPv6 address in ‘static-networking’?
>
>Julien, could the ‘link-set’ call in ‘network-set-up/linux’ be the
>culprit?
>
>    #$@(map (lambda (address)
>              #~(begin
>                  (addr-add #$(network-address-device address)
>                            #$(network-address-value address)
>                            #:ipv6?
>                            #$(network-address-ipv6? address))
>                  ;; FIXME: loopback?
>                  (link-set #$(network-address-device address)
>                            #:up #t)))
>            addresses)
>
>It seems to be the only way to mark the device as “up”, but since it has
>arguments that seem redundant with those of ‘addr-add’, I wonder if
>something could go wrong here.
>
>Thanks for testing, Vivien!
>
>Ludo’.

I don't think so. Setting the interface up will always assign a link-local address (starts with fe80), and that's not under netlink control. Then, maybe once the interface is up, it may react to an RA from the router and get an additional address that way? Not sure.
Vivien Kraus Dec. 11, 2021, 11:32 p.m. UTC | #10
Le samedi 11 décembre 2021 à 22:39 +0100, Ludovic Courtès a écrit :
> > > Any other issues left?
> > 
> > I have a couple:
> > - I get an extra IPv6 (inet6 xxxx/64 scope global dynamic
> > mngtmpaddr
> > valid_lft forever preferred_lft forever) that I did not ask for and
> > that takes precedence as a source for the default route, which
> > defeats
> > the purpose. I’m not sure it’s guile-netlink’s fault.
> 
> Hmm, what’s that IPv6 address?  

So now I’m back to the DHCP setting.

I configured the DHCP server on my router to give anyone 2 IPv6
addresses: one that I configure with a static lease, and another one.
On the luci interface of my router, I see that the default mode for the
DHCP server is "stateful + stateless", which I guess translates to the
two addresses I get on the client machine. In fact, this is the
default, so I didn’t especially chose it that way.

If I keep the analogy, the "stateless" IP looks a lot like the
problematic IP I get in the static configuration.

I switch my DHCP server configuration to "stateful only", and now I
only have the static lease on the DHCP client configuration.

Let’s go back to the static networking configuration.

And now, the parasitic IP address is gone.

So, I guess there are 3 explanations:
1. That IP was committed to disk when I was running the DHCP
configuration, and got activated by default when I switched to the new
static configuration;
2. What guix considers a static client configuration talks to what
librecmc calls the DHCPv6 server and decides whether it’s OK to assign
a stateless IP depending on what the server says;
3. Some network stuff happens way above my understanding.

Anyway, I consider that problem solved for me.

Now I switch back to the DHCP configuration, otherwise the SMTP server
won’t start and I can’t send this email…

Vivien
Ludovic Courtès Dec. 12, 2021, 10 p.m. UTC | #11
Hi,

Vivien Kraus <vivien@planete-kraus.eu> skribis:

> I switch my DHCP server configuration to "stateful only", and now I
> only have the static lease on the DHCP client configuration.
>
> Let’s go back to the static networking configuration.
>
> And now, the parasitic IP address is gone.

In your initial testing, you did not reboot, right?

The ‘stop’ method of the ‘networking’ Shepherd service created by
‘static-networking-service-type’ only deletes addresses and routes that
it (supposedly) created itself.  Thus, if there are stale addresses
created previously, they’ll stick around.  It could be what happened
here.

[...]

> Anyway, I consider that problem solved for me.

\o/

> Now I switch back to the DHCP configuration, otherwise the SMTP server
> won’t start and I can’t send this email…

Heh.  :-)

Thanks,
Ludo’.
Vivien Kraus Dec. 12, 2021, 10:26 p.m. UTC | #12
Hi!

Le dimanche 12 décembre 2021 à 23:00 +0100, Ludovic Courtès a écrit :
> In your initial testing, you did not reboot, right?

I always reboot after every reconfiguration, because I can, and usually
when I wildly change the networking configuration like that the
networking service fails to upgrade, and with it everything else, so I
can’t do anything with the machine before rebooting it.

However, as I was trying a NetworkManager-based solution today, I
noticed that the configuration persists after a reboot: NetworkManager
tried to replicate what was there before. So I would not be surprised
if other pieces of networking configuration could survive a reboot.

> > Anyway, I consider that problem solved for me.
> 
> \o/
> 
> > Now I switch back to the DHCP configuration, otherwise the SMTP
> server
> > won’t start and I can’t send this email…
> 
> Heh.  :-)
Ludovic Courtès Dec. 12, 2021, 11:11 p.m. UTC | #13
I went ahead and pushed this series:

  c8609493ba news: Add entry about 'static-networking-service-type'.
  f73ba627ab tests: Replace uses of deprecated 'static-networking-service'.
  5967aee398 services: Define '%loopback-static-networking'.
  1644f4f1f8 services: Define '%qemu-static-networking'.
  223f1b1eb3 services: static-networking: Change interface to mimic netlink.
  39e3b4b7ce services: secret-service: Turn into a Shepherd service.
  0cc742b261 services: static-networking: Use Guile-Netlink on GNU/Linux.
  1759292c8b gnu: guile-netlink: Allow cross-compilation.
  a4d33fef31 doc: Add new "Networking Setup" node for the main setup options.
  33c498b9ee tests: openvswitch: Check whether ovs0 is up.
  72f140c253 tests: Add 'static-networking' test.

Let me know if anything’s amiss!

Thanks,
Ludo’.
Mathieu Othacehe Dec. 13, 2021, 5:29 p.m. UTC | #14
Hey Ludo,

>   72f140c253 tests: Add 'static-networking' test.

Looks like there could be an issue with this test, see:
https://ci.guix.gnu.org/build/1979106/log/raw.

Thanks,

Mathieu
Vivien Kraus Dec. 14, 2021, 11:17 a.m. UTC | #15
Hi,

Ludovic Courtès <ludo@gnu.org> writes:
> Vivien Kraus <vivien@planete-kraus.eu> skribis:
>> Now I switch back to the DHCP configuration, otherwise the SMTP server
>> won’t start and I can’t send this email…
>
> Heh.  :-)

That problem is solved if I don’t ask for it to listen to interfaces but
rather to addresses. So now I can fully switch to the new static
networking service. I’m happy I found a solution that checks all boxes
at last :D
Ludovic Courtès Dec. 14, 2021, 3:03 p.m. UTC | #16
Hi,

Vivien Kraus <vivien@planete-kraus.eu> skribis:

> Ludovic Courtès <ludo@gnu.org> writes:
>> Vivien Kraus <vivien@planete-kraus.eu> skribis:
>>> Now I switch back to the DHCP configuration, otherwise the SMTP server
>>> won’t start and I can’t send this email…
>>
>> Heh.  :-)
>
> That problem is solved if I don’t ask for it to listen to interfaces but
> rather to addresses. So now I can fully switch to the new static
> networking service. I’m happy I found a solution that checks all boxes
> at last :D

Nice, thanks again for testing and reporting!

Ludo’.