💾 Archived View for darknesscode.xyz › notes › iptables.gmi captured on 2024-02-05 at 09:40:54. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2021-12-05)
-=-=-=-=-=-=-
iptables -S iptables --list iptables -L iptables -S TABLE_NAME iptables --table NameHere --list iptables -t NameHere -L -n -v --line-numbers
Type the following command as root user:
iptables -L INPUT iptables -L FORWARD iptables -L OUTPUT iptables -L
iptables -I INPUT -p tcp --dport xxxx -j ACCEPT iptables -I INPUT -p udp --dport xxxx -j ACCEPT
ip6tables -I INPUT -p tcp --dport xxxx -j ACCEPT ip6tables -I INPUT -p udp --dport xxxx -j ACCEPT
iptables -A OUTPUT -p tcp --dport xxxx -j ACCEPT iptables -A OUTPUT -p udp --dport xxxx -j ACCEPT
ip6tables -I OUTPUT -p tcp --dport xxxx -j ACCEPT ip6tables -I OUTPUT -p udp --dport xxxx -j ACCEPT
iptables -A INPUT -p tcp -m multiport --dports 22,80,443 -j ACCEPT iptables -A OUTPUT -p tcp -m multiport --sports 22,80,443 -j ACCEPT
iptables -A OUTPUT -p tcp -dport xxxx -j DROP
iptables-save -f /etc/iptables/iptables.rules
If you edit the iptables configuration file manually
iptables-restore /etc/iptables/iptables.rules
For more info, man iptables
----------
----------
© DarknessCode