Last active
September 6, 2019 09:00
-
-
Save andreasnuesslein/d042b4cbaf3239eb48aa847db0f55693 to your computer and use it in GitHub Desktop.
Docker config for gitlab-runner on nftables
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
#!/usr/sbin/nft -f | |
# vim: ft=pf | |
# {{ interface }} would be `eth0` or `enp3s0` or similar | |
table inet filter { | |
chain forward { | |
iifname docker0 oifname {{ interface }} accept | |
iifname {{ interface }} oifname docker0 ct state established accept | |
iifname {{ interface }} oifname docker0 ct state related accept | |
} | |
} | |
table ip nat { | |
chain input { | |
type nat hook input priority 0; policy accept; | |
} | |
chain output { | |
type nat hook output priority 0; policy accept; | |
} | |
chain prerouting { | |
type nat hook prerouting priority 0; policy accept; | |
} | |
chain postrouting { | |
type nat hook postrouting priority 0; policy accept; | |
ip saddr 172.17.0.0/16 counter masquerade | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment