应用服务网格 ASM-卸载ASM-PROXY:删除已添加的iptables规则

时间:2025-02-12 14:54:22

删除已添加的iptables规则

  1. 以root用户登录虚拟机。
  2. 执行以下命令删除添加的istio iptables规则。

    iptables -t nat -D PREROUTING -p tcp -j ISTIO_INBOUND

    iptables -t nat -D OUTPUT -p tcp -j ISTIO_OUTPUT

    iptables -t nat -F ISTIO_OUTPUT

    iptables -t nat -X ISTIO_OUTPUT

    iptables -t nat -F ISTIO_INBOUND

    iptables -t nat -X ISTIO_INBOUND

    iptables -t nat -F ISTIO_REDIRECT

    iptables -t nat -X ISTIO_REDIRECT

    iptables -t nat -F ISTIO_IN_REDIRECT

    iptables -t nat -X ISTIO_IN_REDIRECT

    iptables-save

  3. 执行以下命令查看虚拟机当前的iptables规则。

    iptables -t nat -L -v

    回显如下,可以看到istio相关规则已经清除。

    Chain PREROUTING (policy ACCEPT 2 packets, 104 bytes) pkts bytes target     prot opt in     out     source               destination            47  2498 DOCKER     all  --  any    any     anywhere             anywhere             ADDRTYPE match dst-type LOCALChain INPUT (policy ACCEPT 2 packets, 104 bytes) pkts bytes target     prot opt in     out     source               destination         Chain OUTPUT (policy ACCEPT 5 packets, 350 bytes) pkts bytes target     prot opt in     out     source               destination             0     0 DOCKER     all  --  any    any     anywhere            !localhost/8          ADDRTYPE match dst-type LOCALChain POSTROUTING (policy ACCEPT 5 packets, 350 bytes) pkts bytes target     prot opt in     out     source               destination             0     0 MASQUERADE  all  --  any    !docker0  172.17.0.0/16        anywhere            Chain DOCKER (2 references) pkts bytes target     prot opt in     out     source               destination         0     0 RETURN     all  --  docker0 any     anywhere             anywhere

support.huaweicloud.com/bestpractice-asm/asm_bestpractice_0016.html