Re: Custom static route not applied at reboot

From: Jon Radel <jon_at_radel.com>
Date: Fri, 26 Nov 2021 22:01:22 UTC
On 11/26/21 13:45, Scott Gasch wrote:
> Hi,
>
> I have a FreeBSD 13.0-RELEASE-p4 system that runs openvpn in a vnet jail to
> create a site-to-site VPN.  This works great except for one detail: I want
> the host system to add a static route to send traffic for the other side of
> the VPN to the IP address of the vnet jail to use it as a gateway.  I tried
> this in rc.conf:
>
> static_routes="vpn"
> route_vpn="-net 192.168.0.0/24 10.0.0.225"
>
The man page for rc.conf on my 13.0-whatever system seems to say that

static_routes="vpn"
route_vpn="-net 192.168.0.0/24 -gateway 10.0.0.225"

might work better.  While the details blur after this many versions of 
FreeBSD (and OpenBSD) I vaguely recall learning long ago that even when 
the man page says something like "whose contents will later be passed to 
a 'route add' operation," sometimes it doesn't actually mean that the 
literal string will be passed as is to the mentioned command, but rather 
that the appropriate values will be picked out of the string in rc.conf 
and something useful done with them.


-- 
--Jon Radel
jon@radel.com