Last active
October 11, 2015 17:08
-
-
Save fay/3891856 to your computer and use it in GitHub Desktop.
iptables
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
加入白名单: | |
sudo iptables -I INPUT -i lo -p tcp -s 192.168.1.0/24 -j ACCEPT --dport 6379 | |
删除规则: | |
sudo iptables -D INPUT 2 | |
拒绝某个端口的任何访问,黑名单: | |
sudo iptables -A INPUT -p tcp --dport 6379 -j REJECT | |
端口转发: | |
iptables -t nat -A OUTPUT -p tcp -d 10.0.2.15 --dport 8001 -j DNAT --to 127.0.0.1:8000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment