Advertisement
Guest User

Iptables

a guest
Dec 1st, 2015
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. iptables -P INPUT ACCEPT
  2. iptables -F
  3. iptables -I INPUT 1 -i lo -j ACCEPT -m comment --comment 'Enable connections on loopback devices.'
  4. iptables -I INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT -m comment --comment 'Always allow established connections to remain connected.'
  5. iptables -A INPUT -p tcp --dport 1:65535 --source 10.0.0.0/8 -j ACCEPT -m comment --comment 'private_network_10.0.0.0/8'
  6. iptables -A INPUT -p udp --dport 1:65535 --source 10.0.0.0/8 -j ACCEPT -m comment --comment 'private_network_10.0.0.0/8'
  7. iptables -A INPUT -p icmp -j ACCEPT -m comment --comment 'private_network_10.0.0.0/8'
  8.  
  9. iptables -A INPUT -p tcp --dport 22 -j ACCEPT -m comment --comment 'default'
  10. iptables -A INPUT -p tcp --dport 80 -j ACCEPT -m comment --comment 'web'
  11. iptables -A INPUT -p tcp --dport 443 -j ACCEPT -m comment --comment 'web'
  12.  
  13. iptables -A INPUT -j DROP -m comment --comment 'Disable all other connections.'
  14. iptables-save > /etc/iptables.rules
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement