Skip to content

Instantly share code, notes, and snippets.

@samisalkosuo
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samisalkosuo/c0811e968d905420b194 to your computer and use it in GitHub Desktop.
Save samisalkosuo/c0811e968d905420b194 to your computer and use it in GitHub Desktop.
Open port in iptables firewall
#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