Files
sysopsandClaude Sonnet 5 83b1da291f Add per-server NAT egress, ip_forward auto-enable, OPNsense import review checklist
- ServerSetting gains WanInterface/EgressSNATIP for optional per-server
  masquerade/SNAT of client traffic, isolated in each server's own
  nftables table
- wireguard.Start/Restart now ensure net.ipv4.ip_forward and
  net.ipv6.conf.all.forwarding are enabled before bringing an interface up
- OPNsense config.xml import now parses staticroutes/filter/nat rules and
  surfaces them as a manual-review checklist in the preview UI (never
  auto-applied)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ATVUwTa4Pqwq26orW5BcDW
2026-07-29 13:08:52 +02:00

49 lines
2.3 KiB
Go

package model
import (
"time"
)
// GlobalSetting model
type GlobalSetting struct {
EndpointAddress string `json:"endpoint_address"`
DNSServers []string `json:"dns_servers"`
MTU int `json:"mtu,string"`
PersistentKeepalive int `json:"persistent_keepalive,string"`
FirewallMark string `json:"firewall_mark"`
Table string `json:"table"`
ConfigFilePath string `json:"config_file_path"`
UpdatedAt time.Time `json:"updated_at"`
}
// ServerSetting model holds the per-server-interface subset of settings
// that used to live in the single global GlobalSetting. Introduced for the
// multi-server extension; not yet wired into store/handler layers.
type ServerSetting struct {
EndpointAddress string `json:"endpoint_address"`
FirewallMark string `json:"firewall_mark"`
Table string `json:"table"`
ConfigFilePath string `json:"config_file_path"`
// LanInterface is optional: the local interface (e.g. "eth0", "br-lan")
// this server's WireGuard traffic should be allowed to forward to/from.
// Only used to generate the nftables ruleset preview; left empty means
// the preview only covers the WireGuard interface itself.
LanInterface string `json:"lan_interface,omitempty"`
// WanInterface is optional: the local interface this server's client
// traffic should be masqueraded/SNATed out through for full-tunnel
// (internet-egress) clients, e.g. "eth0". Leave empty to skip NAT
// entirely (site-to-site only, no internet egress via this server).
WanInterface string `json:"wan_interface,omitempty"`
// EgressSNATIP is optional: pins the source address used when NATing
// this server's client traffic out WanInterface, for hosts with
// multiple public IPs on the same interface. Leave empty to use
// plain masquerade (follow the interface's routed address).
EgressSNATIP string `json:"egress_snat_ip,omitempty"`
// DNSServers and MTU are optional per-server overrides of the app-wide
// GlobalSetting.DNSServers/GlobalSetting.MTU. Leave empty/zero to fall
// back to the global default (see handler.buildEffectiveSettings).
DNSServers []string `json:"dns_servers,omitempty"`
MTU int `json:"mtu,omitempty"`
UpdatedAt time.Time `json:"updated_at"`
}