Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Jul 2013 13:05:25 +0300
From:      Sami Halabi <sodynet1@gmail.com>
To:        Eugene Grosbein <eugen@grosbein.net>
Cc:        "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>, "Paul A. Procacci" <pprocacci@datapipe.com>, freebsd-ipfw <freebsd-ipfw@freebsd.org>
Subject:   Re: DNAT in freebsd
Message-ID:  <CAEW%2BogYW9YWZr6TnzqZ%2BHv_e_fFo-MKW1hTdWfw7w=qaCFw3Yg@mail.gmail.com>
In-Reply-To: <51D14930.1060502@grosbein.net>
References:  <CAEW%2BogYp61U2zjicksYekSdfmLLZh5g9QM3GUg4n16ZbudVZtg@mail.gmail.com> <20130629002959.GB20376@nat.myhome> <CAEW%2BogZ=a6LZavOtcb_egNWFQ8bJP0gzP6pc90tu1dcWC9K80A@mail.gmail.com> <51D006F6.6060809@grosbein.net> <CAEW%2Bogbx15KiayBHFJ7T1YVGQ2pwm1ArQaSrjUk6XUOBgVPggA@mail.gmail.com> <51D04FA8.8080900@grosbein.net> <CAEW%2BogZQ1bHOBNvxkLqnFRrR_b4=e%2BYx9wUjWC8YYr__QsBe3w@mail.gmail.com> <CAEW%2BogZmd4Rz7OgTKV-k=tnSLgG0Y0-4XO%2BxuELznsgVo0XZ%2BA@mail.gmail.com> <51D14930.1060502@grosbein.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,
forgot to mention that but this sysctl is already set to 0.
i see in the logs packets pass 1000 rule.

Sami


On Mon, Jul 1, 2013 at 12:17 PM, Eugene Grosbein <eugen@grosbein.net> wrote:

> On 01.07.2013 14:30, Sami Halabi wrote:
> > Hi,
> >
> > I've tried the following:
> >
> > em1 - ip 10.0.1.1/24 <http://10.0.1.1/24>;
> > em2 - ip 11.0.3.1/24 <http://11.0.3.1/24>;
> > route add 11.0.4.0/24 <http://11.0.4.0/24>; 11.0.3.2
> >
> > ipfw flush
> > ipfw add 1000 nat 1 all from 10.0.1.2 to 10.0.1.1
> > ipfw add 2000 nat 2 all from 11.0.3.1 to 10.0.1.1
> >
> > ipfw add 3000 nat 2 all from 11.0.4.2 to 11.0.3.1
> > ipfw add 4000 nat 1 all from 10.0.1.1 to 11.0.3.1
> >
> >
> > ipfw nat 1 config same_ports ureg_only ip 11.0.3.1
> > ipfw nat 1 config reverse same_ports ureg_only ip 11.0.4.2
> >
> > what i see in tcpdump and logs is that the rule 1000 converts the ip
> correctly
> > 10.0.1.2->10.0.1.1  ==>  11.0.3.1->10.0.1.1
> > while the 2000 rule does nothing...
>
> man ipfw says:
>
>      To let the packet continue after being (de)aliased, set the sysctl
> vari-
>      able net.inet.ip.fw.one_pass to 0.
>
> By default, rule 1000 "consumes" aliased packets and they do not hit rule
> 2000 at all.
> So, you need to set sysctl net.inet.ip.fw.one_pass=0
>



-- 
Sami Halabi
Information Systems Engineer
NMS Projects Expert
FreeBSD SysAdmin Expert



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAEW%2BogYW9YWZr6TnzqZ%2BHv_e_fFo-MKW1hTdWfw7w=qaCFw3Yg>