Server occasionally forgetting its default route reddit / freebsd ---------------------------------------------------------------------- jllauser · 2022-11-23 15:39 I have a FreeBSD file server I administer tucked away in the basement of my parents' house that has now seemingly forgotten its default route twice... The last time it happened was maybe 6 to 8 months ago, and now it just happened again this week. Both times this happened, it remains connected to the network, continues refreshing its DHCP lease as normal, and is still accessible to other machines on its subnet, but obviously can't talk to anything else anywhere on the Internet. Both times I've fixed it by bouncing a connection off another machine on their network and just manually re- adding the default route, but I'm confused as to how this could be happening. Searching the logs didn't show anything obvious (to me at least), and given how ridiculously infrequently it's happened, I'm not even sure how I'd test a potential fix. Anyone have any thoughts as to what could be happening? % uname -a FreeBSD 13.1-RELEASE-p2 FreeBSD 13.1-RELEASE-p2 GENERIC amd64 ---------------------------------------------------------------------- timvandijknl · 2022-11-23 18:03 Why are you using DHCP for a server ? 🤦🏻‍♂️ Reserve an IP for the server in the router, set it as a fixed IP in the server and problem solved. ---------------------------------------------------------------------- jllauser · 2022-11-23 18:10 I have a reserved IP for the server on the DHCP server. It’s how I’ve always done it. I guess I could configure it statically on the server as well, but that doesn’t really answer the question of why this happened. ---------------------------------------------------------------------- mss-cyclist · 2022-11-23 18:27 Interesting find. Same happens on my laptop. % uname -a FreeBSD 13.1-RELEASE-p2 FreeBSD 13.1-RELEASE-p2 GENERIC amd64 Edit: fix architecture. ---------------------------------------------------------------------- vermaden · 2022-11-23 19:08 > Server occasionally forgetting its default route. Maybe its old and its memory not that good anymore? :) ---------------------------------------------------------------------- laffer1 · 2022-11-23 20:31 Static assignment from dhcp is fine. I’m not sure why it’s happening, but you could try a different dhcp client from ports to see if that helps. ---------------------------------------------------------------------- rysto32 · 2022-11-23 23:46 This is a real shot in the dark, but try setting icmp_drop_redirect="NO" in rc.conf ---------------------------------------------------------------------- grahamperrin · 2022-11-24 01:14 > … manually re-adding the default route, … How, exactly? Knowing this might help to understand more about what's lost, and how. ---------------------------------------------------------------------- grahamperrin · 2022-11-24 01:16 > `FreeBSD 13.1-RELEASE-p2 FreeBSD 13.1-RELEASE-p2 GENERIC amd6` Is that from your own computer, or copied from the opening post? ~~amd6: no such thing.~~ ---------------------------------------------------------------------- jllauser · 2022-11-24 01:17 route add default xx.xx.xx.xx ---------------------------------------------------------------------- grahamperrin · 2022-11-24 01:18 [rc.conf\(5\)](https://www.freebsd.org/cgi/man.cgi?query=rc.conf&sekti on=5&manpath=FreeBSD), [icmp\(4\)](https://www.freebsd.org/cgi/man.cgi ?query=icmp&sektion=4&manpath=FreeBSD) ---------------------------------------------------------------------- grahamperrin · 2022-11-24 01:20 > `FreeBSD 13.1-RELEASE-p2 FreeBSD 13.1-RELEASE-p2 GENERIC amd64` Side note: before your next restart of the server, update the OS (to patch level 4). ---------------------------------------------------------------------- grahamperrin · 2022-11-24 02:02 [route\(8\)](https://www.freebsd.org/cgi/man.cgi?query=route&sektion=8 &manpath=FreeBSD) I'm confused, partly because [routed\(8\)](https://www.freebsd.org/cgi /man.cgi?query=routed&sektion=8&manpath=FreeBSD) describes route(8) as a *service*. This does not help you, but sometimes I simply can't get what I need with the `routing` service. `/etc/rc.d/routing` | I recently discovered the `defaultroute` service. `/etc/rc.d/defaultroute` | There's something test-related at , I can't guess how it might be used. ---------------------------------------------------------------------- mss-cyclist · 2022-11-24 04:02 No, from my laptop. Coincidentally same version and architecture as OP. ---------------------------------------------------------------------- jllauser · 2022-11-24 06:08 On the punch list for while I’m visiting for Thanksgiving this weekend. ---------------------------------------------------------------------- grahamperrin · 2022-11-24 08:18 Thanks. In which situation does loss of routing become noticeable? A) whilst you actively use the computer B) after sleeping (suspending) the computer in one network environment, then waking (resuming) in a different network environment. ---------------------------------------------------------------------- mss-cyclist · 2022-11-24 08:38 While actively using it. My laptop never goes to sleep or standby. ---------------------------------------------------------------------- ptichko · 2022-11-24 12:54 You can run ‘route -n monitor > logfile.txt’ and check it the next time the issue happens. The log will contain the pid of the program that removed the route. Also maybe worth installing and running atop to get the process history. ---------------------------------------------------------------------- grahamperrin · 2022-11-24 19:06 In all network environments? If not all: can you describe the environments in which loss of routing occurs? What network hardware in the computer? If you like, share the result of a probe: `hw-probe -all -upload` [sysutils/hw-probe](https://www.freshports.org/sysutils/hw-probe/)