all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Richard Sent <richard@freakingpenguin.com>
To: help-guix@gnu.org
Subject: dhcp-client default gateway with multiple interfaces, race condition?
Date: Fri, 14 Jun 2024 12:34:14 -0400	[thread overview]
Message-ID: <87sexfpjp5.fsf@freakingpenguin.com> (raw)

Hi Guix!

I'm having trouble where my virtual private server (VPS) [1] has
incorrect routing information configured. From a recovery console:

--8<---------------cut here---------------start------------->8---
root@droplet-base ~# ip route
default dev eth1
10.108.0.0/20 dev eth1 proto kernel scope link src 10.108.0.2
157.245.0.0/20 dev eth0 proto kernel scope link src <public_ip_address>
--8<---------------cut here---------------end--------------->8---

From above, the default gateway isn't pointing towards the
internet-routable gateway (157.245.0.1). If I were to manually run $ ip
route replace default default via 157.245.0.1, I can reach public
addresses again (e.g. $ ping 8.8.8.8).

This error seems to occur randomly on reboot, maybe 4/5 times. My guess
is there is some sort of race condition in the DHCP configuration that
causes eth1 to be set as the default gateway.

I believe I could resolve this by changing dhcp-client-service-type to

--8<---------------cut here---------------start------------->8---
(service dhcp-client-service-type ;make droplet know its own ip
         (dhcp-client-configuration
         (interfaces '("eth0"))))
--8<---------------cut here---------------end--------------->8---

i.e. only listen on eth0 and give up on configuring the private IP range
on eth1 entirely. I haven't tested this to confirm yet, but will
shortly.

However, I don't want to remove the private IP range entirely. From what
I read, it may be possible to configure isc-dhcp to set "nogateway" for
a specific interface. However, it looks like this isn't possible in Guix
at present. Is there another method to resolve my issue? Or is my fancy
theory about race-conditions in dhcp configuration inaccurate and
something else is to blame?

Thanks.

[1]: https://git.sr.ht/~freakingpenguin/rsent/tree/edde39fbb0585db243ac5369548867bbdc765fe8/item/rsent/system/digitalocean.scm
[2]: https://unix.stackexchange.com/a/333610
-- 
Take it easy,
Richard Sent
Making my computer weirder one commit at a time.


             reply	other threads:[~2024-06-14 16:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-14 16:34 Richard Sent [this message]
2024-06-14 18:10 ` dhcp-client default gateway with multiple interfaces, race condition? Felix Lechner via
2024-06-14 18:55   ` Richard Sent
2024-06-14 20:14     ` Richard Sent

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=87sexfpjp5.fsf@freakingpenguin.com \
    --to=richard@freakingpenguin.com \
    --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.