File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,19 @@ func Init() {
2727
2828 settingRepo := repo .NewISettingRepo ()
2929 if clientName == "ufw" || clientName == "iptables" {
30+ if err := iptables .AddChain (iptables .FilterTab , iptables .Chain1PanelForward ); err != nil {
31+ global .LOG .Errorf ("add forward chain failed, err: %v" , err )
32+ return
33+ }
34+ if err := iptables .AddChain (iptables .NatTab , iptables .Chain1PanelPreRouting ); err != nil {
35+ global .LOG .Errorf ("add prerouting chain failed, err: %v" , err )
36+ return
37+ }
38+ if err := iptables .AddChain (iptables .NatTab , iptables .Chain1PanelPostRouting ); err != nil {
39+ global .LOG .Errorf ("add postrouting chain failed, err: %v" , err )
40+ return
41+ }
42+ global .LOG .Infof ("init iptables chains for forward successfully" )
3043 if err := iptables .LoadRulesFromFile (iptables .FilterTab , iptables .Chain1PanelForward , iptables .ForwardFileName ); err != nil {
3144 global .LOG .Errorf ("load forward rules from file failed, err: %v" , err )
3245 return
You can’t perform that action at this time.
0 commit comments