Routing improvements (#268)

- Fixes #82 
- Remove `EXTRA_SUBNETS`
- Remove no longer needed iptables rules
- Reduce routing interface arity
- Routing setup is done in main.go instead of in the firewall
- Routing setup gets reverted at shutdown
This commit is contained in:
Quentin McGaw
2020-10-24 18:05:11 -04:00
committed by GitHub
parent 716eb14da1
commit ed4fcc17b3
15 changed files with 209 additions and 251 deletions

View File

@@ -17,7 +17,6 @@ type Configurator interface {
Version(ctx context.Context) (string, error)
SetEnabled(ctx context.Context, enabled bool) (err error)
SetVPNConnection(ctx context.Context, connection models.OpenVPNConnection) (err error)
SetAllowedSubnets(ctx context.Context, subnets []net.IPNet) (err error)
SetAllowedPort(ctx context.Context, port uint16, intf string) (err error)
RemoveAllowedPort(ctx context.Context, port uint16) (err error)
SetDebug()
@@ -40,7 +39,6 @@ type configurator struct { //nolint:maligned
// State
enabled bool
vpnConnection models.OpenVPNConnection
allowedSubnets []net.IPNet
allowedInputPorts map[uint16]string // port to interface mapping
stateMutex sync.Mutex
}