Created
March 12, 2015 10:17
-
-
Save cdelaitre/cc7038642ed10e2c4497 to your computer and use it in GitHub Desktop.
/etc/sysconfig/iptables filter and nat to allow ssh,jenkins and redirect 80 to 8080
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
# Firewall configuration for the MAPA Project | |
*filter | |
:INPUT DROP [0:0] | |
:FORWARD DROP [0:0] | |
:OUTPUT DROP [0:0] | |
:MAPA-INPUT - [0:0] | |
:MAPA-OUTPUT - [0:0] | |
-A INPUT -j MAPA-INPUT | |
-A OUTPUT -j MAPA-OUTPUT | |
-A MAPA-INPUT -i lo --source 127.0.0.1 --destination 127.0.0.1 -j ACCEPT | |
-A MAPA-INPUT --protocol icmp --icmp-type echo-request -m limit --limit 8/s -j ACCEPT | |
-A MAPA-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT | |
# allow SSH | |
-A MAPA-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT | |
# allow Jenkins | |
-A MAPA-INPUT -m multiport -m comment --comment "Open port for Jenkins" -p tcp --dport 80 -j ACCEPT | |
-A MAPA-INPUT -m multiport -m comment --comment "Open port for Jenkins" -p tcp --dport 8080 -j ACCEPT | |
COMMIT | |
# Generated by iptables-save v1.4.7 on Thu Mar 12 10:26:28 2015 | |
*nat | |
:PREROUTING ACCEPT [1:48] | |
:POSTROUTING ACCEPT [13:1103] | |
:OUTPUT ACCEPT [13:1103] | |
-A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080 | |
COMMIT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment