mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-17 12:58:51 +08:00
chore: Modify iptables initialization logic (#11145)
This commit is contained in:
parent
a5d86d4c00
commit
bb9d9042f0
1 changed files with 2 additions and 7 deletions
|
|
@ -50,14 +50,9 @@ func Init() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if clientName == "ufw" {
|
if clientName != "iptables" {
|
||||||
_ = iptables.UnbindChain(iptables.FilterTab, iptables.ChainInput, iptables.Chain1PanelBasicAfter)
|
return
|
||||||
_ = iptables.UnbindChain(iptables.FilterTab, iptables.ChainInput, iptables.Chain1PanelBasicBefore)
|
|
||||||
_ = iptables.UnbindChain(iptables.FilterTab, iptables.ChainInput, iptables.Chain1PanelBasic)
|
|
||||||
_ = iptables.UnbindChain(iptables.FilterTab, iptables.ChainInput, iptables.Chain1PanelInput)
|
|
||||||
_ = iptables.UnbindChain(iptables.FilterTab, iptables.ChainOutput, iptables.Chain1PanelOutput)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := iptables.LoadRulesFromFile(iptables.FilterTab, iptables.Chain1PanelBasicBefore, iptables.BasicBeforeFileName); err != nil {
|
if err := iptables.LoadRulesFromFile(iptables.FilterTab, iptables.Chain1PanelBasicBefore, iptables.BasicBeforeFileName); err != nil {
|
||||||
global.LOG.Errorf("load basic before rules from file failed, err: %v", err)
|
global.LOG.Errorf("load basic before rules from file failed, err: %v", err)
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue