* How to change source port in MASQUERADE mode?
@ 2005-09-30 4:36 Richard Liu
2005-09-30 11:58 ` Henrik Nordstrom
0 siblings, 1 reply; 3+ messages in thread
From: Richard Liu @ 2005-09-30 4:36 UTC (permalink / raw)
To: netfilter-devel
Hi,
I have a question about change tuple source port.
I have a nat device, and I want this device can change tuple source port
in some special conditions (not always).
I want change tuple source port in MASQUERADE module.
for example:
Destination Gateway Source
DA(Ipaddr):Port GA:Port SA:Port
In Masquerade modules
src:GA:1000 src:SA:1000
dst:DA:23 dst:DA:23
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
I am tracing source few days, but I still don't know which function
allocate tuple source port.
Does anyone can give me some hints, I am very appreciate.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: How to change source port in MASQUERADE mode?
2005-09-30 4:36 How to change source port in MASQUERADE mode? Richard Liu
@ 2005-09-30 11:58 ` Henrik Nordstrom
2005-09-30 17:13 ` Richard Liu
0 siblings, 1 reply; 3+ messages in thread
From: Henrik Nordstrom @ 2005-09-30 11:58 UTC (permalink / raw)
To: Richard Liu; +Cc: netfilter-devel
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
Then you simply need rules matching your conditions.
Regards
Henrik
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How to change source port in MASQUERADE mode?
2005-09-30 11:58 ` Henrik Nordstrom
@ 2005-09-30 17:13 ` Richard Liu
0 siblings, 0 replies; 3+ messages in thread
From: Richard Liu @ 2005-09-30 17:13 UTC (permalink / raw)
To: Henrik Nordstrom; +Cc: netfilter-devel
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
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-09-30 17:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-30 4:36 How to change source port in MASQUERADE mode? Richard Liu
2005-09-30 11:58 ` Henrik Nordstrom
2005-09-30 17:13 ` Richard Liu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.