A web server behind two gateways?
Eugene Grosbein
eugen at grosbein.net
Mon Jul 17 11:34:04 UTC 2017
On 16.07.2017 19:48, Grzegorz Junka wrote:
> Hello,
>
> I have a jail running a web server in LAN. There are two routers/WANs
> that can connect LAN to the internet. I enabled NAT and port forwarding
> to the web server on both routers.
>
> The problem is that the web server responds to requests only from one
> router at a time depending on the default gateway set on the jail's
> host. If the default gateway is set as router 1 then the web page can be
> opened only through WAN1 and vice versa.
>
> Can I configure either router/host/jail so that the web server sends the
> response back to the IP that sent the request packet rather than to the
> default gateway?
This is the job of external NAT box to route translated replys to right WAN
based on external source IP address produced during translation of the reply.
The jail or internal NAT have nothing to do with the problem.
So, the solution depends of kind of NAT you use.
> And a bonus question, how can I configure two jails so that each jail
> sends packets to a different gateway (which may or may not be the same
> as the jails' host's default gateway)?
Read "man jail" for "vnet" feature.
More information about the freebsd-net
mailing list