在CentOS上有几个服务需要用到ip6tables的MASQUERADE,通过ChatGPT检索到需要更新1.4.18才能支持,看了一下版本决定将版本升级到1.4.21,由于CentOS 6已经没有支持了,而且ELPE库也没有新版本,只能手动编译升级,具体升级方法如下:

  1. 下载并解压 iptables 1.4.21 源码
    你可以从 Netfilter 官方网站 下载 iptables 源码。
    wget http://www.netfilter.org/projects/iptables/files/iptables-1.4.21.tar.bz2
    tar -xvf iptables-1.4.21.tar.bz2
    cd iptables-1.4.21
    
  2. 编译并安装

    ./configure
    make
    sudo make install
    
  3. 重启&确认版本

    reboot
    iptables -V
    ip6tables -V