Re: Altering a packet's port

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I saw that in the man page, but I need to do this for ALL hosts to specific subnets, and many hosts. So I'll have to define one rule for EACH host I need a redirect (something like 50 to 75) ?

Nicolas

----- Original Message ----- From: "Sertys" <sertys@xxxxxxxxxxxxxx>
To: "Netfilter list" <netfilter@xxxxxxxxxxxxxxxxxxx>
Sent: Monday, March 21, 2005 5:00 PM
Subject: Re: Altering a packet's port



On Mon, 21 Mar 2005 15:43:44 -0500, Nicolas Ross <rossnick-lists@xxxxxxxxxxx> wrote:

What I want to do, is that if a packet originites from the local net (192.168.7.x) on tcp port 22, that the final destination of the packet would wtill be the same host, but on port 8022...
(...)

Redirect works on local hooks. Just DNAT it, dude. iptables -t nat -A PREROUTING -p tcp -s 192.168.x.x --dport 22 -j DNAT --to-destination f.g.h.i:8022

It's crucial to define dport, not sport, cause your sport is not 22, it's
a client port > 1024 and random.




[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux