Click to See Complete Forum and Search --> : my iptables question of the week


mychl
07-03-2002, 09:30 AM
I have a linux box at work running apache. I'm using rsa encryption to encrypt the data being tranferred, so I have to put a link on the main page to https... what I want to do is have a line in iptables that will redirect any request on port 80 to port 443.

There is only one NIC in the machine, eth0 of course.

I did a google search and all that, and I can only find commands that deal with 2 nics....

I've also tried

iptables -t nat -A PREROUTING -p -tcp -i eth0 --sport 80 -j REDIRECT --to-ports 443

No workie....

Anyone have some help for me???

Thanks

slacker_x
07-03-2002, 11:23 AM
iptables -t nat -A PREROUTING -p -tcp -i eth0 --sport 80 -j REDIRECT --to-ports 443

The problem with that is that 80 is the destination port, not the source port.