Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Aug 2021 09:40:47 +0200
From:      Joost Bekkers <joost@jodocus.org>
To:        freebsd-questions@freebsd.org
Subject:   Fwd: Re: Static route and arp problem in FreeBSD 13.0
Message-ID:  <4271ced7.AVoAAAo8Ek4AAAAAAAAAAHAkGMAAAAAA0PMAAAAAABYlygBhHgsB@mailjet.com>
In-Reply-To: <810095e7a8006dbe1b5c966d3525e43f@jodocus.org>
References:  <7fab4cb0-8045-fc8d-7bfd-887495dc00ff@pp.dyndns.biz> <810095e7a8006dbe1b5c966d3525e43f@jodocus.org>

next in thread | previous in thread | raw e-mail | index | archive | help

(forgot to include the list)

On 2021-08-19 00:50, Morgan Wesström wrote:
> I've been using FreeBSD as my router/firewall for 15 years and it's a
> simple and straight setup:
> 
>                +--------------+                       +-------------+
>                |              |                       |             |
> LAN         em1| FreeBSD 12.2 |em0                    | Cable modem | 
> Internet
> ---------------+              +-----------------------+             
> +---------
> 192.168.69.0/24|    router    |DHCP        192.168.0.1| bridge mode |
>                |              |public ip              |             |
>                +--------------+                       +-------------+
> 
> To access the cable modem's web interface, which has a private ip on
> the public facing side of the router, I add the following static route
> and arp entry in the router's /etc/rc.conf:
> 
> route_cable="-host 192.168.0.1 -link em0:d8:d7:75:f3:9b:14 -iface 
> -static"
> static_routes="cable"
> static_arp_cable="192.168.0.1 d8:d7:75:f3:9b:14 pub only"
> static_arp_pairs="cable"
> 
> The MAC address is the router facing interface on the cable modem. I
> can now access 192.168.0.1 from my LAN and this has worked perfectly
> for many years until I try it on FreeBSD 13.0.
> 
> The route/arp is not registered at startup and trying to add the route
> manually results in the following message:
> 
> # route add -host 192.168.0.1 -link em0:d8:d7:75:f3:9b:14 -iface 
> -static
> route: writing to routing socket: Network is unreachable
> add host 192.168.0.1: gateway em0:d8:d7:75:f3:9b:14 fib 0: Network is
> unreachable
> 
> Adding the arp record doesn't work either but that was expected since
> it requires the route to be added first. The most likely scenario is
> that I missed something fundamental in my 13.0 setup but I can't
> figure out what and the error message isn't really helpful.
> The less likely reason is that something changed between FreeBSD 12.2
> and 13.0 but I can't spot any changes in the man pages. Any pointers
> would be greatly appreciated.
> 

I have a similar setup at home and I can access the modem without any 
special routes/arps.
I'm assuming you've tried accessing the modem without any special 
config.

Can you try changing the route statement to "192.168.0.1/32 -iface em0"?
This tells the system the address is directly connected and it will send 
arp requests out em0.

In my case the modem doesn't reply to those arp requests, static arp 
entries might still be needed.

Alternatively you could have dhclient add a second ip address (eg 
192.168.0.2) to em0. See the alias keyword in dhclient.conf(5)


Best regards,

Joost Bekkers



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4271ced7.AVoAAAo8Ek4AAAAAAAAAAHAkGMAAAAAA0PMAAAAAABYlygBhHgsB>