300 lines
8.9 KiB
JSON
300 lines
8.9 KiB
JSON
{
|
|
"client_requirement": "client_is_viewer+",
|
|
"items": [
|
|
{
|
|
"type": "header_page_title",
|
|
"items": [
|
|
{
|
|
"type": "h1",
|
|
"text": "Network Layout"
|
|
},
|
|
{
|
|
"type": "p",
|
|
"text": "Network segments managed by systemd-networkd, dnsmasq, nftables, and freeradius."
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "info_bar",
|
|
"variant": "info",
|
|
"text": "For a basic flat network with no VLAN segmentation, only use VLAN 1 and delete the others."
|
|
},
|
|
{
|
|
"type": "table",
|
|
"datasource": "config:vlans",
|
|
"empty_message": "No VLANs configured.",
|
|
"columns": [
|
|
{
|
|
"label": "VLAN ID",
|
|
"field": "vlan_id",
|
|
"class": "col-mono col-narrow"
|
|
},
|
|
{
|
|
"label": "Name",
|
|
"field": "name",
|
|
"class": "col-narrow"
|
|
},
|
|
{
|
|
"label": "Interface",
|
|
"field": "interface",
|
|
"class": "col-mono col-narrow"
|
|
},
|
|
{
|
|
"label": "Subnet",
|
|
"field": "subnet",
|
|
"class": "col-mono col-narrow"
|
|
},
|
|
{
|
|
"label": "Mask",
|
|
"field": "subnet_mask",
|
|
"class": "col-mono col-narrow"
|
|
},
|
|
{
|
|
"label": "Self Ident(s)",
|
|
"field": "server_identity_ips",
|
|
"render": "tag_list"
|
|
},
|
|
{
|
|
"label": "Blocklists",
|
|
"field": "use_blocklists",
|
|
"class": "col-expand",
|
|
"render": "tag_list"
|
|
},
|
|
{
|
|
"label": "Default",
|
|
"field": "radius_default",
|
|
"class": "col-narrow",
|
|
"render": "badge_yes_no",
|
|
"render_options": {
|
|
"title_true": "RADIUS Default",
|
|
"title_false": "Not RADIUS Default"
|
|
}
|
|
},
|
|
{
|
|
"label": "mDNS",
|
|
"field": "mdns_reflection",
|
|
"class": "col-narrow",
|
|
"render": "badge_yes_no",
|
|
"render_options": {
|
|
"title_true": "mDNS Reflection Enabled",
|
|
"title_false": "mDNS Reflection Disabled"
|
|
}
|
|
},
|
|
{
|
|
"label": "Record",
|
|
"field": "dnsmasq_log_queries",
|
|
"class": "col-narrow",
|
|
"render": "badge_yes_no",
|
|
"render_options": {
|
|
"title_true": "DNS Queries Recorded",
|
|
"title_false": "DNS Queries Not Recorded"
|
|
}
|
|
}
|
|
],
|
|
"row_actions": [
|
|
{
|
|
"client_requirement": "client_is_administrator+",
|
|
"method": "js_edit",
|
|
"target": "edit-vlan-form",
|
|
"text": "Edit",
|
|
"class": "btn-ghost btn-sm"
|
|
},
|
|
{
|
|
"client_requirement": "client_is_administrator+",
|
|
"action": "/action/networklayout/vlans_delete",
|
|
"method": "post",
|
|
"text": "Delete",
|
|
"class": "btn-danger btn-sm",
|
|
"disable_if": {
|
|
"field": "vlan_id",
|
|
"value": 1
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "card",
|
|
"id": "edit-vlan-form",
|
|
"label": "Edit VLAN",
|
|
"hidden": true,
|
|
"client_requirement": "client_is_administrator+",
|
|
"items": []
|
|
},
|
|
{
|
|
"type": "card",
|
|
"id": "add-form",
|
|
"label": "Add VLAN",
|
|
"client_requirement": "client_is_administrator+",
|
|
"items": [
|
|
{
|
|
"type": "form",
|
|
"action": "/action/networklayout/addvlan_add",
|
|
"method": "post",
|
|
"items": [
|
|
{
|
|
"type": "field_row",
|
|
"cols": 4,
|
|
"items": [
|
|
{
|
|
"type": "field",
|
|
"label": "VLAN ID",
|
|
"name": "vlan_id",
|
|
"input_type": "number",
|
|
"min": 1,
|
|
"max": 4094,
|
|
"validate": "vlan_id",
|
|
"hint": "Unique integer 1-4094. Sets the 802.1Q tag and interface name."
|
|
},
|
|
{
|
|
"type": "field",
|
|
"label": "VLAN Name",
|
|
"name": "name",
|
|
"input_type": "text",
|
|
"validate": "dashname",
|
|
"hint": "Lowercase letters, digits, hyphens. E.g. iot"
|
|
},
|
|
{
|
|
"type": "subnet_row",
|
|
"label": "VLAN Subnet",
|
|
"subnet_name": "subnet",
|
|
"prefix_name": "subnet_mask",
|
|
"subnet_placeholder": "e.g. 192.168.x.0",
|
|
"prefix_value": "24"
|
|
},
|
|
{
|
|
"type": "field",
|
|
"label": "VLAN Type",
|
|
"name": "is_vpn",
|
|
"input_type": "checkbox",
|
|
"checkbox_label": "Is VPN",
|
|
"hint": "Check if this VLAN uses a WireGuard interface (e.g. wg0, wg1, etc)."
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "hr"
|
|
},
|
|
{
|
|
"type": "record_editor",
|
|
"label": "Router identities on this VLAN",
|
|
"name": "server_identities",
|
|
"empty_message": "No identities added.",
|
|
"fields": [
|
|
{
|
|
"label": "IP Address",
|
|
"name": "ip",
|
|
"valtype": "address",
|
|
"attrs": {
|
|
"data-dep-subnet": "[name='subnet']",
|
|
"data-dep-mask": ".subnet-prefix-input"
|
|
},
|
|
"placeholder": "x.x.x.x",
|
|
"required": true
|
|
},
|
|
{
|
|
"label": "Description",
|
|
"name": "description",
|
|
"placeholder": "Optional label"
|
|
},
|
|
{
|
|
"label": "Hostname",
|
|
"name": "hostname",
|
|
"validate": "networkname",
|
|
"placeholder": "Optional"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "hr"
|
|
},
|
|
{
|
|
"type": "field_row",
|
|
"cols": 4,
|
|
"items": [
|
|
{
|
|
"type": "readonly_select",
|
|
"label": "Gateway",
|
|
"name": "gateway"
|
|
},
|
|
{
|
|
"type": "overridable_textarea",
|
|
"label": "DNS Server(s)",
|
|
"name": "dns_server",
|
|
"override_name": "dns_server_override",
|
|
"validate": "ip_in_subnet"
|
|
},
|
|
{
|
|
"type": "overridable_textarea",
|
|
"label": "NTP Server(s)",
|
|
"name": "ntp_server",
|
|
"override_name": "ntp_server_override",
|
|
"validate": "ip_in_subnet"
|
|
},
|
|
{
|
|
"type": "field",
|
|
"label": "Domain",
|
|
"name": "dhcp_domain",
|
|
"input_type": "text",
|
|
"validate": "networkname",
|
|
"value": "local"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "hr"
|
|
},
|
|
{
|
|
"type": "field",
|
|
"label": "Blocklists",
|
|
"name": "use_blocklists",
|
|
"input_type": "checkbox_group",
|
|
"options": "%BLOCKLIST_NAME_OPTIONS%",
|
|
"hint": "Note: Selected lists will be merged and de-duplicated prior to use."
|
|
},
|
|
{
|
|
"type": "hr"
|
|
},
|
|
{
|
|
"type": "field",
|
|
"label": "RADIUS Default",
|
|
"name": "radius_default",
|
|
"input_type": "checkbox",
|
|
"hint": "Wireless devices without a DHCP reservation will be placed into this VLAN. (Note: wired devices are not placed via RADIUS but rather by layer 3 switch policy.)"
|
|
},
|
|
{
|
|
"type": "field",
|
|
"label": "mDNS Reflection",
|
|
"name": "mdns_reflection",
|
|
"input_type": "checkbox",
|
|
"hint": "Reflect mDNS traffic to/from this VLAN via avahi-daemon. Not supported on WireGuard interfaces."
|
|
},
|
|
{
|
|
"type": "field",
|
|
"label": "Record DNS Queries",
|
|
"name": "dnsmasq_log_queries",
|
|
"input_type": "checkbox",
|
|
"hint": "Log every DNS query. High volume - enable for debugging only."
|
|
},
|
|
{
|
|
"type": "button_row",
|
|
"items": [
|
|
{
|
|
"type": "button_primary",
|
|
"action": "/action/networklayout/addvlan_add",
|
|
"method": "post",
|
|
"text": "Add VLAN",
|
|
"class": "add-vlan-btn",
|
|
"disabled": true
|
|
},
|
|
{
|
|
"type": "button_cancel",
|
|
"text": "Cancel"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|