Add userspace routing

This commit is contained in:
Viktor Liu
2024-12-26 15:07:27 +01:00
parent b3c87cb5d1
commit 4199da4a45
21 changed files with 712 additions and 54 deletions

View File

@@ -117,6 +117,11 @@ func (t *TunDevice) FilteredDevice() *FilteredDevice {
return t.filteredDevice
}
// Device returns the wireguard device
func (t *TunDevice) Device() *device.Device {
return t.device
}
// assignAddr Adds IP address to the tunnel interface and network route based on the range provided
func (t *TunDevice) assignAddr() error {
cmd := exec.Command("ifconfig", t.name, "inet", t.address.IP.String(), t.address.IP.String())