openlan: route to vpn subnet

Signed-off-by: zhihui.ding <danieldin186@gmail.com>
This commit is contained in:
zhihui.ding
2023-09-07 18:40:29 +08:00
parent e271313307
commit c080fafed0
2 changed files with 3 additions and 2 deletions

View File

@@ -179,7 +179,7 @@ func (w *OpenLANWorker) allowedSubnet() {
for _, rt := range cfg.Routes {
if vCfg != nil {
w.toForward("", br.Name, vCfg.Subnet, rt.Prefix, "To VPN")
w.toMasq(vCfg.Subnet, rt.Prefix, "To VPN")
w.toMasq(rt.Prefix, vCfg.Subnet, "To VPN")
}
w.toForward(br.Name, "", subnet, rt.Prefix, "To route")

View File

@@ -414,6 +414,8 @@ func (v *Switch) Stop() {
defer v.lock.Unlock()
v.out.Info("Switch.Stop")
v.fire.Stop()
if v.l2tp != nil {
v.l2tp.Stop()
}
@@ -436,7 +438,6 @@ func (v *Switch) Stop() {
}
v.leftClient(p.Client)
}
v.fire.Stop()
v.server.Close()
}