Forward traffic from 80 to 8080

Stop worrying about your server.

cPanel/Plesk Server Management for just $59/mo with Unlimited tickets, Unlimited admin hours, Security audits, 24×7 monitoring and lot more 

cPanel Server Management  $59/mo Click here

Plesk Server Management $59/mo Click here

Its very simple to Forward traffic from 80 to 8080 using iptabled

First make find the entry from if config

 

[[email protected] httpdocs]# ifconfig 
em1 Link encap:Ethernet HWaddr F8:B1:56:AF:77:09 
 inet addr:85.25.211.175 Bcast:85.25.211.191 Mask:255.255.255.192
 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
 RX packets:15624634 errors:0 dropped:0 overruns:0 frame:0
 TX packets:7522042 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:1000 
 RX bytes:21012361670 (19.5 GiB) TX bytes:625245756 (596.2 MiB)
 Interrupt:20 Memory:f7c00000-f7c20000
lo Link encap:Local Loopback 
 inet addr:127.0.0.1 Mask:255.0.0.0
 UP LOOPBACK RUNNING MTU:16436 Metric:1
 RX packets:82731 errors:0 dropped:0 overruns:0 frame:0
 TX packets:82731 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:0 
 RX bytes:74317559 (70.8 MiB) TX bytes:74317559 (70.8 MiB)

 

Here its em1 so add the entry

iptables -A PREROUTING -t nat -i em1 -p tcp --dport 80 -j REDIRECT --to-port 8080

Now traffic to 80 will be forwarded to 8080

Monthly server support with Unlimited tickets, 24×7 monitoring, Security Audit and lot more for just $59 

Server Management at just $59

Leave a Reply

Your email address will not be published. Required fields are marked *