Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Nov 2008 09:06:43 -0800 (PST)
From:      Luke Dean <LukeD@pobox.com>
To:        Jakub T <jakub.tlck@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Port forwarding behind two routers
Message-ID:  <alpine.BSF.2.00.0811190850030.82534@border.lukas.is-a-geek.org>
In-Reply-To: <42b840be0811181746w13c33badj99854a188d0dd00f@mail.gmail.com>
References:  <42b840be0811150949i1a8e0251tea94d8824cf4458f@mail.gmail.com> <alpine.BSF.2.00.0811151022020.63525@border.lukas.is-a-geek.org> <42b840be0811181746w13c33badj99854a188d0dd00f@mail.gmail.com>

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


On Wed, 19 Nov 2008, Jakub T wrote:

> 2008/11/15 Luke Dean <LukeD@pobox.com>
>
>>
>> Port-forwarding through two NATs is something I've never had any success
>> with.  I have a few suggestions that have worked for me and my friends with
>> this setup.
>>
>> A) Disable NAT on the ADSL router.  I think the term is "bridged mode".
>> Turn it into a dumb box and shift all the NAT/firewall/routing
>> responsibilities over to your wireless router.  Depending on your ISP, the
>> hardware, and the protocols involved, this may not be an option for you.
>>
>> B) Disable NAT on the wireless router.  This allows it to be a simple
>> switch and wireless access point.  The price is that you're probably relying
>> on the DHCP server in the wireless router for your wireless devices and
>> you'll have to disable the DHCP when you disable NAT.  This creates new
>> problems to be solved.
>>
>> C) Plug the FreeBSD box into the ADSL router, skipping the wireless router.
>>  Your wireless devices will still be double-NATted, but if you're not
>> running servers on them, you might be able to live with that.
>>
>>
> Luke,
>
> Thank you very much, your advices were very helpful and I now have a working
> port forwarding through two routers. Sorry for the delay in the answering,
> it took me some time to test various options...
>
> Actually your (A) advice is what did the job. I turned off DHCP server on
> ADSL router and enabled "NAT - DMZ Host" option on it (for which I realized
> that it was the closest to your description of "bridged mode").
>
> Then I configured the wireless router to use static IP config instead of
> expecting DHCP server. The situation is now this:
>
>    INTERNET
>        |
> telephone/adsl-wire
>        |
>        |
>    ADSL router
> wan : xx.xx.xx.xx                          FreeBSD box (wired)
> lan : 192.168.1.1                          ip: 192.168.0.102
>        |                 laptop            gateway: 192.168.0.1
>        |                 (wireless)                |
>   [internet plug]        ip: 192.168.0.101         |
>  Wireless router         gateway: 192.168.0.1      |
>  wan : 192.168.1.2            :                    |
>  lan : 192.168.0.1  . . . . . :                    |
>   [ethernet plug]                                  |
>        |                                           |
>        +-------------------------------------------+
>
> DMZ host for ADSL router is 192.168.1.2 -- and it works!
>
> I have one question more (forgive my ignorance): now the wireless router is
> configured to use static IP config and I must provide one or more "Static
> DNS servers" to it. Is it ok to type just "192.168.1.1" as DNS (which works
> for now) or to copy DNS servers which are automatically provided to the ADSL
> router by the ISP?

Your solution is a little different from what I was suggesting, but it
might be a better solution in some ways.

If 192.168.1.1 really works as a source of DNS, I would take that to
mean that your ADSL router is passing your name requests along to the
nameservers that the ISP provided it.  That's good.
If your ISP ever moves its nameservers, it will tell your ADSL box
about it, and the changes should propogate.
If you hardcoded your DNS addresses into your wireless router, you would
have to change them by hand if a change was ever required.

I believe your wireless router is now responsible for being the
firewall for your network, so make sure you've set that up.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.0811190850030.82534>