Skip to content

Instantly share code, notes, and snippets.

@GitSumito
Created July 11, 2017 16:18
Show Gist options
  • Save GitSumito/62830099c98b3afb489b5b4b8ab0bb1d to your computer and use it in GitHub Desktop.
Save GitSumito/62830099c98b3afb489b5b4b8ab0bb1d to your computer and use it in GitHub Desktop.
iptablesでサーバから外部(他のサーバ)への接続を遮断する ref: http://qiita.com/S-T/items/be52d5938737b03c45bf
iptables -L
192.168.1.1
192.168.1.2
10.*.*.*
iptables -A OUTPUT -d 192.168.1.1/32 -o eth0 -j DROP
iptables -A OUTPUT -d 192.168.1.2/32 -o eth0 -j DROP
iptables -A OUTPUT -d 10.0.0.0/8 -o eth0 -j DROP
iptables -A INPUT -d 192.168.1.1/32 -j DROP
iptables -A INPUT -d 192.168.1.2/32 -j DROP
iptables -A INPUT -d 10.0.0.0/8 -j DROP
iptables -L
iptables -F
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment