Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Dec 2000 22:30:42 -0500 (EST)
From:      Chris Hill <chris@monochrome.org>
To:        Sean Peck <speck@newsindex.com>
Cc:        David Raistrick <keen@damoe.wireless-isp.net>, freebsd-questions@FreeBSD.ORG
Subject:   Re: Configuring Gateway/NAT on Freebsd
Message-ID:  <Pine.BSF.3.96.1001210221648.44937E-100000@localhost>
In-Reply-To: <Pine.BSF.4.10.10012101903150.14499-100000@www.newsindex.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 10 Dec 2000, Sean Peck wrote:

> Here is the layout in detail:
> 
> I have a Public addresses and a DSL conneciton, the DSL line comes into
> my house, which I then place into a HUB.  This hub is where all my
> machines are attached.

As David pointed out, this may or may not be kosher.

> I have one machine, that has 1 NIC card, this card is configured with the
> ifconfig commands to be listening to both 1 public IP address, and to
> 172.16.0.1 
> 
> The configuration for the public IP is to forward requests to the ISP
> routers up stream, with appropriate netmask etc.
> 
> THe 172 entry is simply an alias to 172.16.0.1
> 
> The machine is configured as a gateway, it has Natd turned on, etc.
> 
> However I cannot get an answer to 172.16.0.1 when I attempt, even from
> this box itself, even though the ifconfig alias command executes without
> problem.

Are you able to connect outside from the console of this box? For
example, ping, traceroute, etc.?

> I have configured tun0 to be 172.16.0.1 to public IP (or at least I
> believe I have)
> 
> (excerps from rc.conf)
> 
> ifconfig_tun0="inet 172.16.0.1 64.2.61.236 netmask 255.255.255.0"

I think this stuff gets passed to ifconfig; if that's the case, then you
are stating that tun0's IP is 172.16.0.1, and the other end of the link
has an IP of 64.2.61.236, which may not be what you want. You might be
looking for something like

ifconfig_tun0="inet YOURPUBLICIP netmask YOUR PUBLIC IP'S NETMASK"
ifconfig_tun0_alias0="inet 172.16.0.1 netmask 0xffff0000"

> natd_enabled="YES"
> natd_interface="tun0"
> gateway_enabled="YES"
> network_interfaces="xl0 tun0 lo0"
                      ^^^
xl0 is a 3Com Etherlink XL 10/100 ethernet card. Do you have such a card
in the system? This looks good otherwise.

> I have no problem putting a second NIC into the box, if that is what it
> takes... I am configuring my 172.16.x.x boxes to have 172.16.0.1 as their
> defaultrout... which if I understand it should be picked up by this box,
> who will then through tun0, tunnel it to the public IP and then forward it
> out to the world?

Sounds correct. The only real issue I can see is that you may not be
connecting through tun0 (see previous chatter). And according to your
rc.conf excerpts, you already have an ethernet card in the box. Againm
tun0 is not an ethernet card; it's the "interface" used when you use
dial-up PPP.

> I know I am missing something... the FreeBSD manual is great book, but in
> this area, it is pretty weak...


--
Chris Hill               chris@monochrome.org
[1]    Bus error                     netscape




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.1001210221648.44937E-100000>