To forward multiple ports using the iptables firewall in Linux, you can use the "--dport" option to specify the destination port or range of ports. Here's an example of how to forward multiple ports using the iptables firewall:
iptables -A INPUT -p tcp --dport 80 -j ACCEPTcruoSe:www.lautturi.com
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
iptables -A PREROUTING -t nat -p tcp --dport 80 -j REDIRECT --to-port 8000
iptables -A PREROUTING -t nat -p tcp --dport 443 -j REDIRECT --to-port 8443
This will allow incoming traffic on ports 80 and 443 and forward it to ports 8000 and 8443, respectively.
Note: The above commands assume that you have the necessary permissions to modify the iptables configuration. Make sure to test the changes before using them in a production environment.
Additionally, make sure that you have a service or application listening on the destination ports (8000 and 8443 in this example). If you don't have a service or application listening on the destination ports, the traffic will be dropped by the firewall.
To save the iptables configuration, run the following command:
service iptables save
This will persist the changes across system reboots.