netfilter.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [DNAT] Port forwarding with Port range
@ 2024-11-26 14:46 Mokhtar BEN MESSAOUD
       [not found] ` <CABMULtJAEe+jv6O5qpzqiP1q9o4gDmkCti2D-Ldp10MEh1O2nA@mail.gmail.com>
  0 siblings, 1 reply; 2+ messages in thread
From: Mokhtar BEN MESSAOUD @ 2024-11-26 14:46 UTC (permalink / raw)
  To: netfilter

is it possible to use iptables to define a rule to make a port
forwarding of a range of ports
For example :
iptables -t nat -A PREROUTING -p tcp --dport 1000:2000 -j DNAT
--to-destination 192.168.1.100:3000-4000

so traffic for port 1000 will be redirected to port 3000
and traffic for port 1000+n ==> 3000+N

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [DNAT] Port forwarding with Port range
       [not found] ` <CABMULtJAEe+jv6O5qpzqiP1q9o4gDmkCti2D-Ldp10MEh1O2nA@mail.gmail.com>
@ 2024-11-27 13:02   ` Mokhtar BEN MESSAOUD
  0 siblings, 0 replies; 2+ messages in thread
From: Mokhtar BEN MESSAOUD @ 2024-11-27 13:02 UTC (permalink / raw)
  To: Alex K; +Cc: netfilter

I tried and it does not work
iptables -t nat -A PREROUTING -p tcp --dport 1000:2000 -j DNAT
--to-destination 192.168.1.100:3000   ==> Ok all traffic received with
destination port in  1000:2000  is redirected to 192.168.1.100:3000

but iptables -t nat -A PREROUTING -p tcp --dport 1000:2000 -j DNAT
--to-destination 192.168.1.100:3000-4000  ==> does not work : no
traffic is redirected

it seem a known issue : https://bugzilla.netfilter.org/show_bug.cgi?id=1501
issue with DNAT port range

Le mar. 26 nov. 2024 à 18:36, Alex K <rightkicktech@gmail.com> a écrit :
>
> Yes, that should be possible.
>
> On Tue, 26 Nov 2024 at 4:46 PM, Mokhtar BEN MESSAOUD <mbmessaoud@gmail.com> wrote:
>>
>> is it possible to use iptables to define a rule to make a port
>> forwarding of a range of ports
>> For example :
>> iptables -t nat -A PREROUTING -p tcp --dport 1000:2000 -j DNAT
>> --to-destination 192.168.1.100:3000-4000
>>
>> so traffic for port 1000 will be redirected to port 3000
>> and traffic for port 1000+n ==> 3000+N
>>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-27 13:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-26 14:46 [DNAT] Port forwarding with Port range Mokhtar BEN MESSAOUD
     [not found] ` <CABMULtJAEe+jv6O5qpzqiP1q9o4gDmkCti2D-Ldp10MEh1O2nA@mail.gmail.com>
2024-11-27 13:02   ` Mokhtar BEN MESSAOUD

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).