{{define "content"}} {{with .Data}} {{$e := .Errors}}

Every LAN and tunnel belongs to a zone. Traffic inside a zone is allowed; between zones it is denied unless a rule allows it. A rule works in one direction (replies are always allowed), so letting two zones talk to each other takes two rules.

Zones {{range $i, $m := .Members}} {{with index $e (printf "member[%d]" $i)}}{{end}} {{end}}
InterfaceDeviceZone
{{if eq $m.Kind "lan"}}LAN{{else}}Tunnel{{end}} {{$m.Name}} {{$m.Device}}
{{.}}

Several interfaces can share a zone. The uplink is the zone wan; rules from it publish services.

{{range .Empty}}

Zone {{.}} has no interface. {{with index $e (printf "zone.%s" .)}}{{.}}{{end}}

{{end}} {{with index $e "newzone"}}{{.}}{{end}}

A new zone can be picked above (and in the rules) after saving.

Rules
{{range $i, $r := .Rows}} {{range $f := list "from" "sources" "sourcePorts" "to" "destination" "ports" "protocol"}}{{with index $e (printf "rule[%d].%s" $i $f)}}{{end}}{{end}} {{end}}
From zoneFrom addressFrom portTo zoneTo addressTo portProtocolRemove
{{if or $r.From $r.To}}{{end}}
{{$f}}: {{.}}

Fill in the last row to add a rule. Addresses (several separated by commas) are IPv4 or IPv6, single or CIDR; to address is one address or network. Ports (tcp and udp only): 22, 443, 5000-5100.

{{if .Other}}

Other rules

Port forwards and rules with more options are kept as they are; change them in settings.json.

{{end}} {{end}} {{end}}