Following code redirect all incoming traffic to port
7001 to 80
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 7001 -j REDIRECT --to-port 80
Following code redirect all incoming traffic to port
7001 to 8080
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 7002 -j REDIRECT --to-port 8080