Created
July 11, 2017 16:18
-
-
Save GitSumito/62830099c98b3afb489b5b4b8ab0bb1d to your computer and use it in GitHub Desktop.
iptablesでサーバから外部(他のサーバ)への接続を遮断する ref: http://qiita.com/S-T/items/be52d5938737b03c45bf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iptables -L |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
192.168.1.1 | |
192.168.1.2 | |
10.*.*.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iptables -L |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iptables -F |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment