Created
February 17, 2021 08:16
-
-
Save vietanhduong/2718bcd9abddfd38b8f909fc96fa7567 to your computer and use it in GitHub Desktop.
Iptables handle request into docker port
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
#/etc/iptables/rules.v4 | |
# apply rules => iptables-restore < /etc/iptables/rules.v4 | |
*filter | |
:INPUT ACCEPT [0:0] | |
:FORWARD DROP [0:0] | |
:OUTPUT ACCEPT [0:0] | |
:FILTERS - [0:0] | |
:DOCKER-USER - [0:0] | |
-F INPUT | |
-F DOCKER-USER | |
-F FILTERS | |
-A INPUT -i lo -j ACCEPT | |
-A INPUT -p icmp --icmp-type any -j ACCEPT | |
-A INPUT -j FILTERS | |
-A DOCKER-USER -i ens33 -j FILTERS | |
-A FILTERS -m state --state ESTABLISHED,RELATED -j ACCEPT | |
-A FILTERS -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT | |
-A FILTERS -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT | |
-A FILTERS -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT | |
-A FILTERS -j REJECT --reject-with icmp-host-prohibited | |
COMMIT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment