From 5a331e21256e289c9e56ad1d587a2b34e98f49ae Mon Sep 17 00:00:00 2001 From: bjdgyc Date: Mon, 26 Feb 2024 11:10:33 +0800 Subject: [PATCH] =?UTF-8?q?iptables=20=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/handler/link_tun.go | 5 +++-- version | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/server/handler/link_tun.go b/server/handler/link_tun.go index cabbb5c..67e31c6 100644 --- a/server/handler/link_tun.go +++ b/server/handler/link_tun.go @@ -45,11 +45,12 @@ func checkTun() { base.CheckModOrLoad("iptable_filter") base.CheckModOrLoad("iptable_nat") - natRule := []string{"-s", base.Cfg.Ipv4CIDR, "-o", base.Cfg.Ipv4Master, "-j", "MASQUERADE"} - forwardRule := []string{"-j", "ACCEPT"} + natRule := []string{"-s", base.Cfg.Ipv4CIDR, "-o", base.Cfg.Ipv4Master, "-m", "comment", + "--comment", "anylink tun nat", "-j", "MASQUERADE"} if natExists, _ := ipt.Exists("nat", "POSTROUTING", natRule...); !natExists { ipt.Insert("nat", "POSTROUTING", 1, natRule...) } + forwardRule := []string{"-m", "comment", "--comment", "anylink forward filter", "-j", "ACCEPT"} if forwardExists, _ := ipt.Exists("filter", "FORWARD", forwardRule...); !forwardExists { ipt.Insert("filter", "FORWARD", 1, forwardRule...) } diff --git a/version b/version index a8839f7..2bb6a82 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.11.2 \ No newline at end of file +0.11.3 \ No newline at end of file