Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Nov 2002 14:20:48 -0800
From:      "Derrick Ryalls" <ryallsd@datasphereweb.com>
To:        <freebsd-questions@freebsd.org>
Subject:   RE: NAT Help
Message-ID:  <000901c290e3$1417b870$0200a8c0@bartxp>
In-Reply-To: <20021120191159.5699.qmail@web13806.mail.yahoo.com>

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

> Hi,
> 
> I'm trying to get NAT up and running on my FreeBSD
> 4.7R gateway machine and have hit a bit of a wall. 
> Have looked around online for FAQs and other help and
> haven't really been able to isolate the problem this
> way.  If anyone can offer advice, I would be most
> appreciative.
> 
> I have a FreeBSD machine configured as a gateway for a
> LAN.  The BSD machine has two NICs (fxp0 and vr0). 
> fxp0 is connected to a router via ethernet, which in
> turn is connected to the Net via ADSL.  The router is
> very basic and doesn't have all of the functions we
> require, hence the BSD box being the gateway.
> 
> vr0 is connected to a hub for the LAN, which all uses
> internal 10.0.0.x IP addressing.  The FreeBSD box
> provides DHCP for this range.  All of this is working 
> correctly.  We also have a couple of external IPs which I 
> would like to map onto a couple of servers on the private 
> LAN, and herein lies the problem.  I just can't seem to get 
> NAT working to redirect these IPs from the BSD machine to the 
> relevant internal IP.
> 
> On the BSD machine, I've compiled a kernel with the
> following options:
> 
> options IPFIREWALL
> options IPDIVERT
> options IPFIREWALL_DEFAULT_TO_ACCEPT
> options IPFIREWALL_VERBOSE
> 
> The following options exist in rc.conf:
> 
> gateway_enable="YES" 
> firewall_enable="YES" 
> firewall_type="OPEN" 
> natd_enable="YES" 
> natd_interface="fxp0" 
> natd_flags="-redirect_address 10.0.0.2 x.x.x.x 
> -redirect_address 10.0.0.3 x.x.x.x" 
> 
> (where x.x.x.x is of course the external IP).
> 
> rc.conf also contains the following ipconfig settings
> for the external IP addresses (of which there are 5).
> 
> ifconfig_fxp0_alias0="inet x.x.x.x netmask
> 255.255.255.248"
> ifconfig_fxp0_alias1="inet x.x.x.x netmask
> 255.255.255.248"
> ifconfig_fxp0_alias2="inet x.x.x.x netmask
> 255.255.255.248"
> ifconfig_fxp0_alias3="inet x.x.x.x netmask
> 255.255.255.248"
> ifconfig_fxp0_alias4="inet x.x.x.x netmask
> 255.255.255.248"

I am no expert and have never aliased before, but I think you need to
use the netmask of 255.255.255.255 (0xffffffff) for aliases.

> 
> alias0 is used as the IP address for the gateway
> machine and my intention is to redirect traffic on the 
> remaining four addresses to other machines on the LAN.  This 
> is where it falls down and I'm stumped.
> 
> Regards,
> 
> Ben Craig.
> 
> =====
> --
> Benjamin Craig
> Executive Producer
> Cinemagine Limited
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts http://uk.my.yahoo.com
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
> 



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



help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000901c290e3$1417b870$0200a8c0>