Last active
August 29, 2015 14:10
-
-
Save samisalkosuo/c0811e968d905420b194 to your computer and use it in GitHub Desktop.
Open port in iptables firewall
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
#Open firewall for port | |
FW_PORT=9877 | |
iptables -I INPUT 1 -p tcp -m tcp --dport $FW_PORT -j ACCEPT | |
iptables -I INPUT 1 -p tcp -m tcp --sport $FW_PORT -j ACCEPT | |
iptables -I OUTPUT 1 -p tcp -m tcp --sport $FW_PORT -j ACCEPT | |
iptables -I OUTPUT 1 -p tcp -m tcp --dport $FW_PORT -j ACCEPT | |
#save firewall rules | |
/sbin/service iptables save | |
/sbin/service iptables restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment