View previous topic :: View next topic |
Author |
Message |
IamtheOne Apprentice
Joined: 27 Sep 2002 Posts: 158 Location: Iowa
|
Posted: Fri Mar 21, 2003 2:07 am Post subject: Send port 80 -> 8080 |
|
|
Could someone please point me in the direction where I could figure out how to send traffic coming in to my computer on port 80 to port 8080 on my machine?
Thanks. |
|
Back to top |
|
|
Liathus Apprentice
Joined: 21 Mar 2003 Posts: 163 Location: Fargo, ND
|
Posted: Fri Mar 21, 2003 6:47 am Post subject: |
|
|
Ok I just want to make sure that we are on the same page here. When you say that you want to redirect traffic from port 80 to port 8080 are you talking about one machine? If that is the case you could most likely tell the program that is listening on port 8080 to use port 80 instead (perhaps both ports). If you are talking about forwarding traffic to another machine, you could use iptables.
A command like this in your iptables config should do the trick.
iptables -t nat -A PREROUTING -p tcp --dport 80 -i eth0 -d 24.116.189.179 -j DNAT --to 192.168.1.1:8080
Of course you will need to make sure that iptables and full nat are enabled in your kernal. You would also need to change that IP address to match your setup.
I hope this helps |
|
Back to top |
|
|
IamtheOne Apprentice
Joined: 27 Sep 2002 Posts: 158 Location: Iowa
|
Posted: Fri Mar 21, 2003 6:59 am Post subject: |
|
|
Yeah, one machine...
The main problem is I have the server running non-root, so it can't bind below 1000.
Can't iptables redirect locally? |
|
Back to top |
|
|
Liathus Apprentice
Joined: 21 Mar 2003 Posts: 163 Location: Fargo, ND
|
Posted: Fri Mar 21, 2003 7:15 am Post subject: |
|
|
I'm not quite sure. I have never attempted it. I guess you could give it a shot.
BTW, what application are you running? apache I assume? |
|
Back to top |
|
|
|