2017-08-07 12:09:13 +02:00
|
|
|
---
|
|
|
|
# defaults file for nftables
|
|
|
|
|
|
|
|
# packages
|
2017-08-07 13:48:54 +02:00
|
|
|
nft_pkg_manage: true
|
|
|
|
nft_pkg_state: 'installed'
|
|
|
|
|
|
|
|
# conf
|
|
|
|
nft_main_conf_path: '/etc/nftables.conf'
|
|
|
|
nft_main_conf_content: 'etc/nftables.conf.j2'
|
2017-08-08 13:42:02 +02:00
|
|
|
nft_input_conf_path: '/etc/nftables.d/inet-input.nft'
|
|
|
|
nft_input_conf_content: 'etc/nftables.d/inet-input.nft.j2'
|
2017-08-08 15:35:05 +02:00
|
|
|
nft_output_conf_path: '/etc/nftables.d/inet-output.nft'
|
|
|
|
nft_output_conf_content: 'etc/nftables.d/inet-output.nft.j2'
|
2017-08-08 12:11:58 +02:00
|
|
|
nft_define_conf_path: '/etc/nftables.d/defines.nft'
|
|
|
|
nft_define_conf_content: 'etc/nftables.d/defines.nft.j2'
|
2017-08-08 14:32:59 +02:00
|
|
|
nft_set_conf_path: '/etc/nftables.d/inet-sets.nft'
|
|
|
|
nft_set_conf_content: 'etc/nftables.d/inet-sets.nft.j2'
|
2017-08-07 14:14:14 +02:00
|
|
|
|
2017-08-07 17:07:35 +02:00
|
|
|
# rules
|
|
|
|
nft_global_default_rules:
|
|
|
|
000 state management:
|
|
|
|
- ct state established,related accept
|
|
|
|
- ct state invalid drop
|
|
|
|
nft_global_group_rules: {}
|
|
|
|
nft_global_host_rules: {}
|
2017-08-08 14:53:29 +02:00
|
|
|
|
2017-08-07 17:41:03 +02:00
|
|
|
nft_input_default_rules:
|
|
|
|
000 policy:
|
|
|
|
- type filter hook input priority 0; policy drop;
|
2017-08-08 14:32:59 +02:00
|
|
|
005 global:
|
2017-08-07 17:41:03 +02:00
|
|
|
- jump global
|
2017-08-08 14:37:54 +02:00
|
|
|
010 drop unwanted:
|
|
|
|
- ip daddr @blackhole counter drop
|
2017-08-09 10:49:03 +02:00
|
|
|
040 dhcp:
|
|
|
|
- udp sport bootps udp dport bootpc limit rate 6/minute accept
|
|
|
|
220 ssh:
|
2017-08-08 14:53:29 +02:00
|
|
|
- tcp dport ssh ct state new counter accept
|
2017-08-07 17:41:03 +02:00
|
|
|
nft_input_group_rules: {}
|
|
|
|
nft_input_host_rules: {}
|
2017-08-07 17:07:35 +02:00
|
|
|
|
2017-08-08 15:35:05 +02:00
|
|
|
nft_output_default_rules:
|
|
|
|
000 policy:
|
2017-08-09 10:34:29 +02:00
|
|
|
- type filter hook output priority 0; policy drop;
|
2017-08-08 15:35:05 +02:00
|
|
|
005 global:
|
|
|
|
- jump global
|
2017-08-09 10:49:03 +02:00
|
|
|
040 dhcp:
|
|
|
|
- udp sport bootpc udp dport bootps limit rate 6/minute accept
|
2017-08-09 10:34:29 +02:00
|
|
|
050 domain:
|
2017-08-09 10:49:03 +02:00
|
|
|
- udp dport domain ct state new accept
|
2017-08-08 15:35:05 +02:00
|
|
|
nft_output_group_rules: {}
|
|
|
|
nft_output_host_rules: {}
|
|
|
|
|
2017-08-08 12:11:58 +02:00
|
|
|
# define nft vars
|
|
|
|
nft_define_default:
|
|
|
|
broadcast and multicast:
|
|
|
|
desc: 'broadcast and multicast'
|
|
|
|
name: badcast_addr
|
|
|
|
value: '{ 255.255.255.255, 224.0.0.1, 224.0.0.251 }'
|
|
|
|
nft_define_group: {}
|
|
|
|
nft_define_host: {}
|
2017-08-08 14:53:29 +02:00
|
|
|
|
2017-08-08 14:32:59 +02:00
|
|
|
nft_set_default:
|
|
|
|
blackhole:
|
|
|
|
- type ipv4_addr;
|
|
|
|
- elements = $badcast_addr
|
|
|
|
nft_set_group: {}
|
|
|
|
nft_set_host: {}
|
2017-08-08 12:11:58 +02:00
|
|
|
|
2017-08-07 14:14:14 +02:00
|
|
|
# service
|
|
|
|
nft_service_manage: true
|
|
|
|
nft_service_name: 'nftables'
|