Skip to content

Commit 0082653

Browse files
committed
fix: Incompatibility with Docker Desktop 4.39.0 chipmk#48 chipmk#49
1 parent 55d8839 commit 0082653

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

client/main.go

+17
Original file line numberDiff line numberDiff line change
@@ -186,4 +186,21 @@ func main() {
186186
fmt.Printf("Failed to add iptables nat rule: %v\n", err)
187187
os.Exit(ExitSetupFailed)
188188
}
189+
190+
// Insert or replace iptables accept rule for host peer IP address,
191+
// allowing only tunnel packets to be forwarded and routed
192+
err = ipt.DeleteIfExists("filter", "DOCKER",
193+
"-s", hostPeerIp,
194+
"-j", "ACCEPT")
195+
if err != nil {
196+
fmt.Printf("Failed to delete iptables filter rule: %v\n", err)
197+
os.Exit(ExitSetupFailed)
198+
}
199+
err = ipt.Insert("filter", "DOCKER", 1,
200+
"-s", hostPeerIp,
201+
"-j", "ACCEPT")
202+
if err != nil {
203+
fmt.Printf("Failed to insert iptables filter rule: %v\n", err)
204+
os.Exit(ExitSetupFailed)
205+
}
189206
}

0 commit comments

Comments
 (0)