mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-11 03:32:03 +08:00
route changes + primary addr on node
This commit is contained in:
@@ -33,7 +33,14 @@ func deleteRoute(iface string, addr *net.IPNet, address string) error {
|
||||
}
|
||||
|
||||
func setCidr(iface, address string, addr *net.IPNet) {
|
||||
ncutils.RunCmd("route -q -n add -net "+addr.String()+" "+address, false)
|
||||
cidr := ipaddr.NewIPAddressString(addr.String()).GetAddress()
|
||||
if cidr.IsIPv4() {
|
||||
ncutils.RunCmd("route -q -n add -net "+addr.String()+" "+address, false)
|
||||
} else if cidr.IsIPv6() {
|
||||
ncutils.RunCmd("route -A inet6 -q -n add -net "+addr.String()+" "+address, false)
|
||||
} else {
|
||||
logger.Log(1, "could not parse address: "+addr.String())
|
||||
}
|
||||
}
|
||||
|
||||
func removeCidr(iface string, addr *net.IPNet, address string) {
|
||||
|
Reference in New Issue
Block a user