mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-22 21:15:23 +08:00
adding darwin routing logic
This commit is contained in:
parent
4e61f6a586
commit
cd7199441b
1 changed files with 9 additions and 3 deletions
|
@ -1,12 +1,13 @@
|
|||
package local
|
||||
|
||||
import (
|
||||
"net"
|
||||
"strings"
|
||||
|
||||
"fmt"
|
||||
"github.com/c-robinson/iplib"
|
||||
"github.com/gravitl/netmaker/logger"
|
||||
"github.com/gravitl/netmaker/netclient/ncutils"
|
||||
"net"
|
||||
"regexp"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// GetDefaultRoute - Gets the default route (ip and interface) on a mac machine
|
||||
|
@ -59,6 +60,11 @@ func setRoute(iface string, addr *net.IPNet, address string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
// SetExplicitRoute - sets route via explicit ip address
|
||||
func SetExplicitRoute(iface string, destination *net.IPNet, gateway string) error {
|
||||
return setRoute(iface, destination, gateway)
|
||||
}
|
||||
|
||||
func deleteRoute(iface string, addr *net.IPNet, address string) error {
|
||||
var err error
|
||||
_, err = ncutils.RunCmd("route -q -n delete "+addr.String(), false)
|
||||
|
|
Loading…
Add table
Reference in a new issue