From 32f65f81d46db912dd5f19ee877eb3aff6d9fcd9 Mon Sep 17 00:00:00 2001 From: shane Date: Mon, 31 Oct 2022 10:13:26 +0800 Subject: [PATCH] fix: delete fiprule failed at first time (#1998) --- dist/images/vpcnatgateway/nat-gateway.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/images/vpcnatgateway/nat-gateway.sh b/dist/images/vpcnatgateway/nat-gateway.sh index 3b22bf029c3..1051528dc14 100644 --- a/dist/images/vpcnatgateway/nat-gateway.sh +++ b/dist/images/vpcnatgateway/nat-gateway.sh @@ -164,7 +164,7 @@ function del_floating_ip() { if [ "$?" -eq 0 ];then exec_cmd "iptables -t nat -D EXCLUSIVE_DNAT -d $eip -j DNAT --to-destination $internalIp" exec_cmd "iptables -t nat -D EXCLUSIVE_SNAT -s $internalIp -j SNAT --to-source $eip" - exec_cmd "conntrack -D -d $eip" + conntrack -D -d $eip 2>/dev/nul || true fi done }