Initial commit
This commit is contained in:
commit
11c3655907
6 changed files with 200 additions and 0 deletions
25
templates/captive-portal-rules.nft.j2
Normal file
25
templates/captive-portal-rules.nft.j2
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
define captive_portal_interface = {{ captive_portal.interface }}
|
||||
define captive_portal_http_redirect_port = {{ captive_portal.http_redirect_port }}
|
||||
|
||||
table inet captive_portal {
|
||||
set allowed_macs {
|
||||
type ether_addr;
|
||||
timeout {{ captive_portal.timeout }};
|
||||
}
|
||||
|
||||
chain forward {
|
||||
type filter hook forward priority filter; policy accept;
|
||||
iifname != $captive_portal_interface return
|
||||
ether saddr @allowed_macs return
|
||||
|
||||
reject with icmpx type no-route
|
||||
}
|
||||
|
||||
chain dstnat {
|
||||
type nat hook prerouting priority dstnat; policy accept;
|
||||
iifname != $captive_portal_interface return
|
||||
ether saddr @allowed_macs return
|
||||
|
||||
tcp dport 80 redirect to :$captive_portal_http_redirect_port
|
||||
}
|
||||
}
|
||||
4
templates/captive-portal.conf.j2
Normal file
4
templates/captive-portal.conf.j2
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
|
||||
INTERFACE = {{ captive_portal.interface|tojson }}
|
||||
USER_PORTAL_URL = {{ captive_portal.user_portal_url|tojson }}
|
||||
VENUE_INFO_URL = {{ captive_portal.venue_info_url|tojson }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue