Last active
August 29, 2015 14:21
-
-
Save marktopper/a40c07754bc160b9b850 to your computer and use it in GitHub Desktop.
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
# Manually secure port 6379 | |
sudo iptables -A INPUT -p tcp --dport 6379 -s xxx.xxx.xxx.xxx -j ACCEPT | |
sudo iptables -A INPUT -p tcp --dport 6379 -j DROP | |
sudo iptables -L | |
# Save current firewall config | |
# sudo iptables-save > /etc/iptables.conf | |
# Above removed - Mark | |
sudo bash -c "iptables-save > /etc/iptables.conf" | |
# Load iptables.conf on startup | |
sudo nano /etc/rc.local | |
# Add the following: | |
# Load iptables rules from this file | |
iptables-restore < /etc/iptables.conf | |
# EXAMPLE: | |
# Generated by iptables-save v1.4.12 on Thu Oct 17 19:46:50 2013 | |
*filter | |
:INPUT ACCEPT [4316:515188] | |
:FORWARD ACCEPT [0:0] | |
:OUTPUT ACCEPT [15307:1118735] | |
-A INPUT -s xxx.xxx.xxx.xxx/32 -p tcp -m tcp --dport 6379 -j ACCEPT | |
-A INPUT -p tcp -m tcp --dport 6379 -j DROP | |
COMMIT | |
# Completed on Thu Oct 17 19:46:50 2013 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment