Skip to content

Commit 5a331e2

Browse files
committed
iptables 添加注释
1 parent a0e8431 commit 5a331e2

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

server/handler/link_tun.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ func checkTun() {
4545
base.CheckModOrLoad("iptable_filter")
4646
base.CheckModOrLoad("iptable_nat")
4747

48-
natRule := []string{"-s", base.Cfg.Ipv4CIDR, "-o", base.Cfg.Ipv4Master, "-j", "MASQUERADE"}
49-
forwardRule := []string{"-j", "ACCEPT"}
48+
natRule := []string{"-s", base.Cfg.Ipv4CIDR, "-o", base.Cfg.Ipv4Master, "-m", "comment",
49+
"--comment", "anylink tun nat", "-j", "MASQUERADE"}
5050
if natExists, _ := ipt.Exists("nat", "POSTROUTING", natRule...); !natExists {
5151
ipt.Insert("nat", "POSTROUTING", 1, natRule...)
5252
}
53+
forwardRule := []string{"-m", "comment", "--comment", "anylink forward filter", "-j", "ACCEPT"}
5354
if forwardExists, _ := ipt.Exists("filter", "FORWARD", forwardRule...); !forwardExists {
5455
ipt.Insert("filter", "FORWARD", 1, forwardRule...)
5556
}

version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.11.2
1+
0.11.3

0 commit comments

Comments
 (0)