You are not logged in.

#1 2023-07-03 19:07:49

phibroptix
Member
Registered: 2023-01-15
Posts: 15

Prevent new default route, keep nameserver, dhcpcd issues

Hey all,

My network is somewhat interesting where I have a Juniper SRX as the LAN gw, and it's respective WAN is also an internal LAN from a centurylink modem. It's not double-NATing since I have NAT turned off on the Calix and only the SRX is doing NAT, so network traffic more or less functions normally.

However, for some reason my arch desktop keeps getting a default route to the centurylink modem (192.168.0/24) that goes above my actual LAN (call it 192.168.1/24 for now) route and keeps breaking my desktop's internet connection.

I have updated dhcpcd.conf to have:

static domain_name_server=8.8.8.8
static routers=192.168.1.1 [srx]
nogateway

I've read that nogateway should prevent new routes from being created but it doesn't. Also the dns server doesn't propagate to resolv.conf. Would love some help or for someone to point me to the correct pages for how to prevent new default routes being automatically created and how to ensure my DNS stays static, thanks!

Last edited by phibroptix (2023-07-04 06:28:51)

Offline

#2 2023-07-03 21:17:21

seth
Member
Registered: 2012-09-03
Posts: 60,792

Re: Prevent new default route, keep nameserver, dhcpcd issues

-G, --nogateway
             Don't set any default routes.

that goes above my actual LAN

Maybe post the actual routing table. Did you try to control the metrics (and pass a lower one to the desired NIC)?

Also you should post the entire dhcpcd.conf - depending on what the snippet actually looks like in context it may not do a lot (you still use dhcp for the NIC? And that's probably also where the route comes from?)
Also run "dhcpcd -dB" for some debug output.

And perhaps reference dhcpcd in the subject to garner rsmarples attention.

Offline

#3 2023-07-04 06:35:04

phibroptix
Member
Registered: 2023-01-15
Posts: 15

Re: Prevent new default route, keep nameserver, dhcpcd issues

Here is my dhcpcd.conf:

# conf
interface enp6s0
static domain_name_server=8.8.8.8
static ip_address=192.168.1.10/24
static routers=192.168.1.1
nogateway

So normally ip r shows:

default via 192.168.1.1 dev enp6s0 proto dhcp src 192.168.1.2 metric 1002 
192.168.1.0/24 dev enp6s0 proto dhcp scope link src 192.168.1.2 metric 1002 

But for some reason every few hours (sometimes it reoccurs in the span of 5 minutes) the default route gets added and my routing table then shows:

default via 192.168.0.1 dev enp6s0 proto static metric 20100 
default via 192.168.1.1 dev enp6s0 proto dhcp src 192.168.1.2 metric 1002 
192.168.0.1 dev enp6s0 proto static scope link metric 20100 
192.168.1.0/24 dev enp6s0 proto dhcp scope link src 192.168.1.2 metric 1002 

Which breaks my internet.

Also my resolv.conf keeps losing it's nameserver every time its generated. hmm

dhcpcd -dB just says:

default via 192.168.1.1 dev enp6s0 proto dhcp src 192.168.1.2 metric 1002 
default via 192.168.0.1 dev enp6s0 proto static metric 20100 
192.168.0.1 dev enp6s0 proto static scope link metric 20100 
192.168.1.0/24 dev enp6s0 proto dhcp scope link src 192.168.1.2 metric 1002

Offline

#4 2023-07-04 07:12:42

seth
Member
Registered: 2012-09-03
Posts: 60,792

Re: Prevent new default route, keep nameserver, dhcpcd issues

every few hours (sometimes it reoccurs in the span of 5 minutes)

Sanity check:
Please post the output of

find /etc/systemd -type l -exec test -f {} \; -print | awk -F'/' '{ printf ("%-40s | %s\n", $(NF-0), $(NF-1)) }' | sort -f

Offline

#5 2023-07-04 15:43:59

phibroptix
Member
Registered: 2023-01-15
Posts: 15

Re: Prevent new default route, keep nameserver, dhcpcd issues

Output:

bluetooth.service                        | bluetooth.target.wants
dbus-org.bluez.service                   | system
dbus-org.freedesktop.nm-dispatcher.service | system
dhcpcd.service                           | multi-user.target.wants
display-manager.service                  | system
expressvpn.service                       | multi-user.target.wants
gcr-ssh-agent.socket                     | sockets.target.wants
getty@tty1.service                       | getty.target.wants
lxd.service                              | multi-user.target.wants
NetworkManager.service                   | multi-user.target.wants
NetworkManager-wait-online.service       | network-online.target.wants
p11-kit-server.socket                    | sockets.target.wants
pipewire-media-session.service           | pipewire.service.wants
pipewire-session-manager.service         | user
pipewire.socket                          | sockets.target.wants
pulseaudio.socket                        | sockets.target.wants
remote-fs.target                         | multi-user.target.wants
xdg-user-dirs-update.service             | default.target.wants

Offline

#6 2023-07-04 16:12:17

seth
Member
Registered: 2012-09-03
Posts: 60,792

Re: Prevent new default route, keep nameserver, dhcpcd issues

You've dhcpcd and NetworkManager enabled in parallel, you probably want to disable dhcpcd.
This /does/ explain the symptoms (but isn't necessarily the cause, so you'll have to observe the impact)

Offline

#7 2023-07-05 11:16:28

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 13,237

Re: Prevent new default route, keep nameserver, dhcpcd issues

seth wrote:

You've dhcpcd and NetworkManager enabled in parallel, you probably want to disable dhcpcd.

Givien OP has explicitly configured dhcpcd.conf they probably should disable NetworkManager, not dhcpcd .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Online

Board footer

Powered by FluxBB