mirror of
https://github.com/luscis/openlan.git
synced 2025-10-06 17:17:00 +08:00
fix: share routes for host network.
This commit is contained in:
@@ -2,7 +2,6 @@ package config
|
|||||||
|
|
||||||
type Bridge struct {
|
type Bridge struct {
|
||||||
Network string `json:"-" yaml:"-"`
|
Network string `json:"-" yaml:"-"`
|
||||||
Share string `json:"share,omitempty" yaml:"share,omitempty"`
|
|
||||||
Name string `json:"name,omitempty" yaml:"name,omitempty"`
|
Name string `json:"name,omitempty" yaml:"name,omitempty"`
|
||||||
IPMtu int `json:"mtu,omitempty" yaml:"mtu,omitempty"`
|
IPMtu int `json:"mtu,omitempty" yaml:"mtu,omitempty"`
|
||||||
Address string `json:"address,omitempty" yaml:"address,omitempty"`
|
Address string `json:"address,omitempty" yaml:"address,omitempty"`
|
||||||
|
@@ -927,7 +927,6 @@ func (w *WorkerImpl) forwardSubnet() {
|
|||||||
input = w.br.L3Name()
|
input = w.br.L3Name()
|
||||||
w.forwardZone(input)
|
w.forwardZone(input)
|
||||||
}
|
}
|
||||||
share := cfg.Bridge.Share
|
|
||||||
|
|
||||||
ifAddr := strings.SplitN(cfg.Bridge.Address, "/", 2)[0]
|
ifAddr := strings.SplitN(cfg.Bridge.Address, "/", 2)[0]
|
||||||
if ifAddr == "" {
|
if ifAddr == "" {
|
||||||
@@ -936,9 +935,6 @@ func (w *WorkerImpl) forwardSubnet() {
|
|||||||
|
|
||||||
// Enable MASQUERADE, and FORWARD it.
|
// Enable MASQUERADE, and FORWARD it.
|
||||||
w.toRelated(input, "Accept related")
|
w.toRelated(input, "Accept related")
|
||||||
if share != "" {
|
|
||||||
w.toRelated(share, "Accept related")
|
|
||||||
}
|
|
||||||
for _, rt := range cfg.Routes {
|
for _, rt := range cfg.Routes {
|
||||||
if !w.addIpSet(rt) {
|
if !w.addIpSet(rt) {
|
||||||
break
|
break
|
||||||
@@ -948,19 +944,13 @@ func (w *WorkerImpl) forwardSubnet() {
|
|||||||
if w.vrf != nil {
|
if w.vrf != nil {
|
||||||
w.toForward_i(w.vrf.Name(), w.setR.Name, "To route")
|
w.toForward_i(w.vrf.Name(), w.setR.Name, "To route")
|
||||||
} else {
|
} else {
|
||||||
if share != "" {
|
w.toForward_i("", w.setR.Name, "To route")
|
||||||
w.toForward_i(share, w.setR.Name, "To route")
|
|
||||||
}
|
|
||||||
w.toForward_i(input, w.setR.Name, "To route")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if vpn != nil {
|
if vpn != nil {
|
||||||
w.toMasq_s(w.setR.Name, vpn.Subnet, "To VPN")
|
w.toMasq_s(w.setR.Name, vpn.Subnet, "To VPN")
|
||||||
}
|
}
|
||||||
if share != "" {
|
w.toMasq_i("", w.setR.Name, "To Masq")
|
||||||
w.toMasq_i(share, w.setR.Name, "To Masq")
|
|
||||||
}
|
|
||||||
w.toMasq_i(input, w.setR.Name, "To Masq")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *WorkerImpl) createVPN() {
|
func (w *WorkerImpl) createVPN() {
|
||||||
|
Reference in New Issue
Block a user