mirror of
https://github.com/kubenetworks/kubevpn.git
synced 2025-12-24 11:51:13 +08:00
hotfix: add self tun ip to route table (#712)
This commit is contained in:
@@ -401,6 +401,12 @@ func (c *ConnectOptions) startLocalTunServer(ctx context.Context, forwardAddress
|
||||
routes = append(routes, types.Route{Dst: *ipNet})
|
||||
}
|
||||
}
|
||||
if c.LocalTunIPv4 != nil {
|
||||
routes = append(routes, types.Route{Dst: net.IPNet{IP: c.LocalTunIPv4.IP, Mask: net.CIDRMask(32, 32)}})
|
||||
}
|
||||
if c.LocalTunIPv6 != nil {
|
||||
routes = append(routes, types.Route{Dst: net.IPNet{IP: c.LocalTunIPv6.IP, Mask: net.CIDRMask(128, 128)}})
|
||||
}
|
||||
|
||||
tunConfig := tun.Config{
|
||||
Addr: (&net.IPNet{IP: c.LocalTunIPv4.IP, Mask: net.CIDRMask(32, 32)}).String(),
|
||||
|
||||
Reference in New Issue
Block a user