« Forward web port » : différence entre les versions

De wiki-fabmstic
Aller à la navigation Aller à la recherche
Aucun résumé des modifications
Aucun résumé des modifications
 
Ligne 1 : Ligne 1 :


=Iptables Rules=
Code to execute as root:
<pre>
<pre>
iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT
Ligne 7 : Ligne 7 :
</pre>
</pre>


To keep the rules at boot
=Keep the rules at boot=


[https://askubuntu.com/a/270696 From this forum ]
[https://askubuntu.com/a/270696 From this forum ]

Dernière version du 19 mai 2017 à 11:16

Iptables Rules

iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport 9000 -j ACCEPT
iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 9000

Keep the rules at boot

From this forum

Run sudo apt-get install iptables-persistent, and follow the prompts.

If you change your rules after this, you will need to do the following command(s) after the changes:

  • To save your IPv4 iptables rules: sudo su -c 'iptables-save > /etc/iptables/rules.v4'
  • To save your IPv6 ip6tables rules: sudo su -c 'ip6tables-save > /etc/iptables/rules.v6'