How to change source port in MASQUERADE mode?

Richard Liu richardliu at ms1.techarea.org
Fri Sep 30 19:13:35 CEST 2005


Henrik Nordstrom 提到:

Thanks for your mail,

But --to-port parameter cannot get tuple port result like "50000+1000"

I found a way for this situation.

in file ip_MASQUERADE.c
we can change
mr->range[0].min,
mr->range[0].max
and set
mr->range[0].flags = IP_NAT_RANGE_PROTO_SPECIFIED;
for some special purposes.

but I don't know does it have other effects to the netfilter?

> On Fri, 30 Sep 2005, Richard Liu wrote:
>
>> I want change tuple source port in MASQUERADE module.
>
>
> --to-ports option to MASQUERADE (or SNAT if not dynamic IP assignment).
>
>> But I want to the src port be changed in some conditions like this.
>> src:GA:50000+1000 src:SA:1000
>> dst:DA:23 dst:DA:23
>
>




More information about the netfilter-devel mailing list