Skip to content

Instantly share code, notes, and snippets.

@mrladeia
Created September 16, 2018 18:12
Show Gist options
  • Save mrladeia/a656379a1a2809291c9d759047436740 to your computer and use it in GitHub Desktop.
Save mrladeia/a656379a1a2809291c9d759047436740 to your computer and use it in GitHub Desktop.
Lista de excessão Iptables
iptables -A INPUT -p TCP --dport (port) -s A,B -j ACCEPT
iptables -A INPUT -p TCP --dport (port) -j DROP
After any days....... I add IP C
iptables -I INPUT -p tcp --dport (port) -s C -j ACCEPT
Or add in line 1
iptables -I 1 INPUT -p tcp --dport (port) -s C -j ACCEPT
CentOS
service iptables save
Debian
iptables-save > /etc/iptables.rules
nano /etc/network/if-pre-up.d/firewall
#!/bin/bash
/sbin/iptables-restore < /etc/iptables.rules
chmod +x /etc/network/if-pre-up.d/firewall
reboot
iptables -L
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment