Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
KSZK
Sysadmin
Kubernetes
Router Ansible Role
Commits
5d011c95
Commit
5d011c95
authored
Sep 16, 2021
by
rlacko
💬
Browse files
template nftables accepted ports
parent
dce5a59b
Changes
2
Hide whitespace changes
Inline
Side-by-side
defaults/main.yml
View file @
5d011c95
...
...
@@ -10,6 +10,11 @@ lan_port: ens224
# dnat:
# - dport: 6443
# to: 192.168.69.1:6443
# accept:
# - saddr: 152.66.0.0/16
# dport: 10022
# - saddr: 10.0.0.0/8
# dport: 10022
# netplan:
# network:
...
...
templates/etc/nftables.conf.j2
View file @
5d011c95
...
...
@@ -22,7 +22,11 @@ table inet filter {
ip protocol icmp accept
tcp dport {{ ssh_port | default("10022", true) }} accept comment "SSH in"
{% if nftables.accept is defined %}
{% for accept in nftables.accept %}
ip saddr {{ accept.saddr }} tcp dport {{ accept.dport }} accept comment "{{ accept.comment }}"
{% endfor %}
{% endif %}
}
chain forward {
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment