Forked from djaiss/Open Redis to accept external connections
Created
July 21, 2018 16:49
-
-
Save herpiko/d4dec6022c2b632b7491c8154e8a30cb to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
# 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