The easy way is to use iptables-persistent.

Install iptables-persistent:

sudo apt-get install iptables-persistent

After it's installed, you can save/reload iptables rules anytime:

sudo /etc/init.d/iptables-persistent save
sudo /etc/init.d/iptables-persistent reload

Ubuntu 16.04 Server

The installation as described above works without a problem, but the two commands for saving and reloading above do not seem to work with a 16.04 server. The following commands work with that version:

sudo netfilter-persistent save
sudo netfilter-persistent reload


How to save rules of the iptables?的更多相关文章

  1. How can i use iptables save on centos 7?

    I installed CentOS 7 with minimal configuration (os + dev tools). I am trying to open 80 port for ht ...

  2. How to allow/block PING on Linux server – IPTables rules for icmp---reference

    BY ADMIN - APRIL, 9TH 2014 The ‘PING’, it’s a command-line tool to check a host is reachable or not. ...

  3. 解决service iptables save出错please try to use systemctl

    # service iptables save The service command supports only basic LSB actions (start, stop, restart, t ...

  4. iptables中文介绍 、基本使用操作命令(转)

    iptables 命令介绍   原文链接http://www.cnblogs.com/wangkangluo1/archive/2012/04/19/2457072.html iptables防火墙可 ...

  5. Iptables防火墙

    1 位置 使用vim /usr/sysconfig/iptables 2 启动.关闭.保存 service iptables stop service iptables start service i ...

  6. iptables 命令介绍

    http://www.cnblogs.com/wangkangluo1/archive/2012/04/19/2457072.html iptables 防火墙可以用于创建过滤(filter)与NAT ...

  7. linux中iptables配置文件及命令详解详解

    iptables配置文件 直接改iptables配置就可以了:vim /etc/sysconfig/iptables. 1.关闭所有的 INPUT FORWARD OUTPUT 只对某些端口开放. 下 ...

  8. Linux的iptables常用配置范例(2)

    iptables -F   #清除所有规则 iptables -X  #清除所有自定义规则 iptables -Z   #各项计数归零 iptables -P INPUT DROP  #将input链 ...

  9. Linux iptables 防火墙详解

    0x00 iptables介绍 linux的包过滤功能,即linux防火墙,它由netfilter 和 iptables 两个组件组成. netfilter 组件也称为内核空间,是内核的一部分,由一些 ...

随机推荐

  1. SQL Full Join 的 Where条件

    SQL需求是损益视图串资产负债视图 用Excel透视表模拟出来的结果就是 用SQL查询如下: 当Where条件是左边的视图的时候 select 损益视图.年 ,损益视图.年月 ,损益视图.期间 ,损益 ...

  2. 洛谷 P3757 [CQOI2017]老C的键盘

    题面 luogu 题解 其实就是一颗二叉树 我们假设左儿子小于根,右儿子大于根 考虑树形\(dp\) \(f[u][i]\)表示以\(u\)为根的子树,\(u\)为第\(i\)小 那么考虑子树合并 其 ...

  3. Jquery 在多个相同标签click的问题

    最近在做文章的删除动作,用Jquery来执行操作.但是实现时一开始总是只能对第一个起作用,其他的点击删除后没反应. 一开始的jquery代码是这样的, $('#articledelete').on(' ...

  4. Redis之hiredis API (String)

    String // // Created by zhangrongxiang on 2018/3/7 13:48 // File string2 // #include <hiredis/hir ...

  5. 724_Find-Pivot-Index

    目录 724_Find-Pivot-Index Description Solution Java solution Python solution 724_Find-Pivot-Index Desc ...

  6. Nginx proxy buffer相关的设置和解释

    proxy_buffer_size 4k; proxy_buffering on;proxy_buffers 4 4k;proxy_busy_buffers_size 8k;proxy_max_tem ...

  7. Nginx 基于客户端 IP 来开启/关闭认证

    前些日子帮助公司在搭建了一个内部资源的导航页面,方便公司员工访问各种常用的系统.因为这个页面包含一些敏感信息,我们希望对其做认证,但仅当从外网访问的时候才开启,当从公司内网访问的时候,则无需输入账号密 ...

  8. nodejs添加jsonwebtoken验证

    具体使用模块: 使用compression压缩处理请求响应.cors模块添加跨域.helmet安全模块.body-parser解析请求参数.jsonwebtoken用于生成及校验token.使用内置c ...

  9. System.Web.HttpException: 请求在此上下文中不可用

    转自:https://www.cnblogs.com/wangguowen27/archive/2013/05/12/IIS_itcast_win7.html 问题:Web应用程序池配置错误造成的,这 ...

  10. Autocomplete 自动提示

    <!doctype html> <html lang="en"> <head> <meta charset="utf-8&quo ...