当前位置: 首页> 游戏> 评测 > 重庆市建设工程施工安全网_企业微信官网_培训行业seo整站优化_关键词优化有哪些作用

重庆市建设工程施工安全网_企业微信官网_培训行业seo整站优化_关键词优化有哪些作用

时间:2025/8/1 21:38:29来源:https://blog.csdn.net/fareast_mzh/article/details/142560098 浏览次数:0次
重庆市建设工程施工安全网_企业微信官网_培训行业seo整站优化_关键词优化有哪些作用

$ sudo iptables -t nat -L -v -n

Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)pkts bytes target     prot opt in     out     source               destination         79  4390 DNAT       tcp  --  enp1s0 *       0.0.0.0/0            0.0.0.0/0            tcp dpt:24662 to:10.8.0.2:246626986  538K DNAT       udp  --  enp1s0 *       0.0.0.0/0            0.0.0.0/0            udp dpt:24672 to:10.8.0.2:2467210   568 DNAT       tcp  --  enp1s0 *       0.0.0.0/0            0.0.0.0/0            tcp dpt:10647 to:10.8.0.4:10647339 26148 DNAT       udp  --  enp1s0 *       0.0.0.0/0            0.0.0.0/0            udp dpt:10523 to:10.8.0.4:10523Chain INPUT (policy ACCEPT 0 packets, 0 bytes)pkts bytes target     prot opt in     out     source               destination         Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)pkts bytes target     prot opt in     out     source               destination         Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)pkts bytes target     prot opt in     out     source               destination         
26591 3302K MASQUERADE  all  --  *      enp1s0  10.8.0.0/24          0.0.0.0/0   

To make your iptables rules permanent so that they persist after a reboot, you can use the iptables-persistent package or manually save and restore the rules. Here are two common approaches:

Method 1: Using iptables-persistent (Recommended)

  1. Install the package:

    sudo apt-get update
    sudo apt-get install iptables-persistent
    

    During the installation, it will prompt you to save your current iptables rules.

  2. If you need to save the rules manually at any point:

    sudo netfilter-persistent save
    
  3. The rules are now saved in /etc/iptables/rules.v4 for IPv4 and /etc/iptables/rules.v6 for IPv6. These rules will be automatically applied after each reboot.

Method 2: Manual Save and Restore

  1. Save the current iptables rules to a file:

    sudo iptables-save > /etc/iptables/rules.v4
    
  2. To restore the rules automatically after reboot, edit the /etc/rc.local file and add the following line before exit 0:

    iptables-restore < /etc/iptables/rules.v4
    
  3. Ensure that the /etc/rc.local file is executable:

    sudo chmod +x /etc/rc.local
    

Now, your iptables rules should be loaded automatically after every reboot.

eMule firewall config - iptables forward rules
Remove a rule from iptables

关键字:重庆市建设工程施工安全网_企业微信官网_培训行业seo整站优化_关键词优化有哪些作用

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: