Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Mar 2011 10:53:03 +0200
From:      Kaya Saman <kayasaman@gmail.com>
To:        freebsd-questions@freebsd.org
Subject:   Setting up a a route in FreeBSD with NAT issues
Message-ID:  <AANLkTikFs0J_d9_BDYoXecb9JmcxX2e5PkBcuua1fNVq@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi all,

I'm trying to setup a gateway between an internal network using Vbox test
machines of which one is a FreeBSD router/gateway. Being familiar with Cisco
I know how easy this is to do but I think that I'm struggling a bit with the
syntax.

My setup is as so:


Damn Small Linux (virtual machine) -> (em1) FreeBSD 8.2 (virtual gateway)
(em0) ->    internal network
10.100.100.2
10.100.100.1                              172.16.7.136  172.16.0.0/20


My current configuration within the FreeBSD router looks like so:

/etc/rc.conf:

gateway_enable="YES"
hostname="ROUTER.test.org"
ifconfig_em0="inet 172.16.7.136 netmask 255.255.240.0"
#em0_nat="NO"
ifconfig_em1="inet 10.100.100.1 netmask 255.255.255.192"
#em1_nat="YES"
inetd_enable="YES"
keymap="uk.iso"
sshd_enable="YES"
defaultrouter="172.16.0.1"
ipnat_enable="YES"
ipnat_rules="/etc/ipnat.rules"
named_enable="YES"
static_routes="net1"
route_net1="-net 10.100.100.0/26 0.0.0.0/0"


/etc/ipnat.rules:

map tun0 10.100.100.0/26 -> 0/0 portmap tcp/udp 10000:65000
map tun0 10.100.100.0/26 -> 0/0


The router from DSL is set as 10.100.100.1 and it hits it without any
problem... running a traceroute however gives this:

ROUTER# ipnat -l
List of active MAP/Redirect filters:
map tun0 10.100.100.0/26 -> 0.0.0.0/0 portmap tcp/udp 10000:65000
map tun0 10.100.100.0/26 -> 0.0.0.0/0

List of active sessions:


Something here isn't working and I'm not sure quite what it is :-(


Can anyone help???


Thanks


Kaya



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