[ale] Redirect a port

Joe Steele joe at madewell.com
Sat Jan 21 14:02:12 EST 2006


Christopher Fowler wrote:
> On Sat, 2006-01-21 at 13:19 -0500, James P. Kinney III wrote:
>   
>> On Sat, 2006-01-21 at 10:01 -0500, Christopher Fowler wrote:
>>     
>>> I have a service that runs on port 5000 on a server.  I have devices in
>>> the field that are configured for 5000 or 5001.  Is it possible to use
>>> iptables to redirect requests coming into 5001 to 5000?  I've done this
>>> with DNAT but the server that is running the software is not behind a
>>> NAT.  It is on a public IP.  So I want to do something like this:
>>>
>>>
>>> 0.0.0.0/0 -> 209.168.X.X:5001 -> 5000
>>>       
>> iptables -A nat -m tcp -p tcp  --dport 5001 -j REDIRECT --to-ports 5000
>>     
>
> I get an error that no chain exists by that name 'nat'.  I did try
> 'INPUT' but got an invalid argument error.
>   
That should be:

iptables -t nat -A PREROUTING -p tcp --dport 5001 -j REDIRECT --to-ports 
5000

--Joe



More information about the Ale mailing list