LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Redirect port 80 to 8080 for One NIC(eth0) (https://www.linuxquestions.org/questions/linux-newbie-8/redirect-port-80-to-8080-for-one-nic-eth0-611923/)

shipon_97 01-08-2008 02:20 AM

Redirect port 80 to 8080 for One NIC(eth0)
 
Dear Friends ,

I know that, in the case of transparent proxy (to redirect "80" port to "8080") iptables has a rule and that is :

"/sbin/iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to -port 8080 "
my server contains two NIC ('eth0' & 'eth1') and in the above rule lan card use as 'eth1' .

But If I have a One Lan Card(eth0), then can I redirect port 80 to 8080 ?

I am trying it using follwoing command , but cannot success .

"/sbin/iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to -port 8080"

Can u plz tell me where is the problem and How can I redirect port '80' to '8080' if my server has a one NIC (eth0) .

Waiting for ur reply .. ..

Emerson 01-09-2008 10:49 AM

Why don't you run that HTTP server on port 8080 instead?


All times are GMT -5. The time now is 12:10 PM.