Re: need help using ng_patch to modify src/dst packets or alternative way

From: Eugene Grosbein <eugen_at_grosbein.net>
Date: Mon, 18 Dec 2017 01:42:24 +0700
17.12.2017 17:59, Sami Halabi wrote:

> Hi Eugene,
> I'm looking for a solution for IP traffic. in linux iptables its possible but I couldn't find freebsd way yet.
> bkuncr soulution works for tcp only.

Then, you need to realize that for every packet, you need to change (translate)
both of source IP address from 10.1.1.2 to 1.1.1.1 and destination IP address
from 10.1.1.1 to X.X.X.X. This is called network address translation and,
in fact, you need NAT. But not ordinary "simple" NAT that translates
only source address in outgoing packets (and destination in incoming replies)
but double or "binat" to translate destination address in outgoing packets too
(and source address in corresponding replies).

This is possible to do with two instances of "ipfw nat" (or natd) for single external destination
but not for arbitrary number of external destinations.

They say, "pf(4)" packet filter can perform "binat" properly.
I have not tried that. You should start reading its documentation.
Received on Sun Dec 17 2017 - 17:42:49 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:14 UTC