In <ae043c69-3a66-42b7-a745-(E-Mail Removed)>,
(E-Mail Removed) wrote:
>I am trying to direct traffic going to port 2222 to port 443.
>
>Basically, i would like inbound traffic to come into 2222 or 443 and
>always be directed to 443. I am doing this because the 3rd party
>application I am using only allows it to be listen on one port. So I
>am using port 443 for that and want to use iptables as a workaround to
>this limitation of the application using only one port.
>
>
>Server is CentOS 5.1.
>
>What i did:
>1. downloaded and installed webmin (because i couldnt get it to work
>manually configuring IPTABLES file)
>2. allowed inbound traffic to tcp port 2222
>3. set up PREROUTING policy to route 2222 to 443
>4. service iptables restart
>5. tested it by "telnet localhost 2222" fails. "telnet (ip of server)
>2222" fails
I'm not sure but I think PREROUTING chain is not consulted for locally generated
packets. So test your rule from some other box or add that rule to OUTPUT chain
also.
HTH
--
·-- ·- ···· ·--- ·- ···- ·- ·--·-· --· -- ·- ·· ·-·· ·-·-·- -·-· --- --
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
iEYEARECAAYFAkiDsxYACgkQHy+EEHYuXnQnXACeNa5HfEf5Yw j59k2FRi01MyzV
w78An2uw3YqIiW6kEqzF9cidLbqgLb4k
=JcY+
-----END PGP SIGNATURE-----