Allow an incoming port
Add a rule at the end of INPUT that accepts incoming HTTPS traffic
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
- tool
- iptables10 commands
More iptables commands
-
iptables -I INPUT 1 -s 203.0.113.5 -j DROPInsert a DROP rule for one source IP at position 1, so it runs first
-
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADETurn on IP masquerading for outgoing traffic, as on a router
-
iptables-save > /etc/iptables/rules.v4 iptables-restore < /etc/iptables/rules.v4Save rules to a file and load them back, for example after a reboot
-
iptables -D INPUT 3Remove rule number 3 from the INPUT chain
-
iptables -A INPUT -p tcp --dport 22 -m state --state NEW -m limit --limit 3/min --limit-burst 5 -j ACCEPTAccept no more than 3 new SSH connections per minute with a burst of 5