From: "Darren Reed" <[EMAIL PROTECTED]>
> In some email I received from Jason Ish, sie wrote:
> > Is a dup-to rule with an optional IP address actually supposed to
> > rewrite the destination IP of the packet?  From reading ipf(5) it sounds
> > like it should, but doing a quick test this does not happen.
> >
> > My question is, if a rule contains 'dup-to rtk0:w.x.y.z' is the IP
> > destination supposed to be rewritten or does that just specify the
> > next hop as in a 'to rtk0:w.x.y.z' rule?
>
> No, the IP address is never rewritten.
>
> Darren

After reading this post I decided to make some new tests with ipf.
I replaced my actual rules :
pass out quick on fxp0 to fxp1:195.205.159.2 proto tcp from 195.205.159.14
to any
pass out quick on fxp0 to fxp1:195.205.159.2 proto udp from 195.205.159.14
to any
pass out quick on fxp0 to fxp1:195.205.159.2 proto icmp from 195.205.159.14
to any
when 195.205.159.14 is an IP address of the fxp1 interface and 195.205.159.2
is a router IP to something like this:
block out quick on fxp0 proto tcp from 195.205.159.14/32 to any
block out quick on fxp0 proto udp from 195.205.159.14/32 to any
block out quick on fxp0 proto icmp from 195.205.159.14/32 to any
pass out quick on fxp0 dup-to fxp1:195.205.159.2 proto tcp from
195.205.159.14/32 to any
pass out quick on fxp0 dup-to fxp1:195.205.159.2 proto udp from
195.205.159.14/32 to any
pass out quick on fxp0 dup-to fxp1:195.205.159.2 proto icmp from
195.205.159.14/32 to any
and this doesn't work too but then I deleted the optional IP address from
'fxp1:195.205.159.2' to just 'fxp1'.
And guess what ? Now outgoing packets/datagrams/whatever with source IP
195.205.159.14 are really going back thru the fxp1 interface which is not
the default gateway device. And on the other machine I see:
07:07:36.213529 212.33.84.150 > 195.205.159.14: icmp: echo request
07:07:36.213714 195.205.159.14 > 212.33.84.150: icmp: echo reply

--
Karol Daniszewski
http://net.art.pl/ Net Art




Reply via email to