redirect local port to another local port

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

 



Hi!

I want to redirect packets incoming on eth0 on port 12345 to port
12346 on the same machine.
Already got it working with this command:
iptables -t nat -A PREROUTING -i eth0 -p tcp --src 1.2.3.4 --dport
12345 -j REDIRECT --to-ports 12346
Client 1.2.3.4 can connect to 12345, but is logical connected to
service on 12346.

But I want this for all sources, so I omitted the src-param.
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 12345 -j REDIRECT
--to-ports 12346
This way the client can't connect to the service.
Could someone explain me this behavior, please?

I am forwarding both ports with my home-router (Fritz!Box) to the
machine, I also tried to forward the external port 12345 to the local
machine:12346, but this also does not work.
Could the service causing the problem?

Greets
--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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