比如iptables本来有这么一条:

-A PREROUTING -d 125.65.27.xxx/32 -p tcp -m tcp --dport 11060 -j DNAT --to-destination 10.1.104.41:911

要将符合该条记录的封包的信息记录到syslog

需要在之前插入一条:

iptables -t nat -I PREROUTING 1 -d 125.65.27.xxx -p tcp -m tcp --dport 11060 -j LOG --log-prefix "[iptables 911:] " --log-level 7

log level 分类

log level to any level you want. The levels are, 0 emerg, 1 alert, 2 crit, 3 err, 4 warning, 5 notice, 6 info, 7 debug. You can use the number or the word in the rule.

[iptables]iptables 添加log到syslog的更多相关文章

  1. 利用CentOS系统IPtables防火墙添加网站IP白名单

    参考博文: 利用CentOS系统IPtables防火墙添加360网站卫士节点IP白名单 centos6.5添加白名单如下: 在防火墙 配置文件中加入白名单  ip -A INPUT -s 183.13 ...

  2. [iptables]iptables常规设置

    转自:http://leil.plmeizi.com/archives/centos-iptables%E9%85%8D%E7%BD%AE%E6%96%B9%E6%B3%95%E8%BD%AC/ 关闭 ...

  3. [转载]在Android C/C++层添加LOG调试

    原文地址:C/C++层添加LOG调试">在Android C/C++层添加LOG调试作者:谢轩昂 在Android C/C++层添加LOG调试,并且在Logcat中输出的方法 第一步: ...

  4. Android开发过程中在sh,py,mk文件中添加log信息的方法

    Android开发过程中在sh,py,mk文件中添加log信息的方法 在sh文件中: echo "this is a log info" + $info 在py文件中: print ...

  5. 利用log4添加log

    應用log4net.dll 新建Global.asax,在cs文件中添加 protected void Application_Start(object sender, EventArgs e)    ...

  6. 解决Ubuntu下添加Log却无法输出(高通平台)

    1.首先考虑到的是你所添加Log的位置确实没有被调用或者在调用前发生异常终止掉了. 2.你修改后没有进行编译或者没有push/install 3.如果你当前的系统版本是User版本,你在push的时候 ...

  7. C# 后台添加Log信息

    我们在做项目的时候,经常会使用到Log日志,今天分享一下如何在后台添加Log信息 创建一个写Log的方法: public void WriteLog(string Action) { try { st ...

  8. CentOS 7下iptables配置添加修改规则端口方法(转)

    简介: Linux CentOS 7默认没有安装iptables,默认的防火墙是firewalld,云吞铺子分享CentOS 7系统下iptables安装.iptables规则配置(放行或者禁用端口) ...

  9. 在iptables中添加vnc访问规则

    iptables -I INPUT -p tcp --dport 5800|5900|5801|5901 -j ACCEPT service iptales save

随机推荐

  1. python同时遍历两个list

    两个list, 有对应关系,希望同时完成遍历 用迭代器迭代的方法也不是不可以,python提供了更直观的方法: 可以使用zip把两个list打包 , 类似: list1 = [1,2,3,4] lis ...

  2. 【Linux 运维】Centos7初始化网络配置

    设置网络 (1)动态获取一个IP地址 #dhclient        系统自动自动获取一个IP地址#ip addr         查看获取的ip地址(2)查看网关,子网掩码 虚拟机编辑>虚拟 ...

  3. Deep Residual Learning for Image Recognition论文笔记

    Abstract We present a residual learning framework to ease the training of networks that are substant ...

  4. 【web前端开发】浏览器兼容性处理大全

    1.居中问题 div里的内容,IE默认为居中,而FF默认为左对齐,可以尝试增加代码margin: 0 auto; 2.高度问题 两上下排列或嵌套的div,上面的div设置高度(height),如果di ...

  5. redis集群sentinel哨兵模式的搭建与实际应用

    参考资料:https://blog.csdn.net/men_wen/article/details/72724406 之前环境使用的keepalived+redis vip集群模式,现在我们服务切换 ...

  6. File Searching

    Description Have you ever used file searching tools provided by an operating system? For example, in ...

  7. Catch That Cow(BFS广搜)

    Description Farmer John has been informed of the location of a fugitive cow and wants to catch her i ...

  8. Java实验二实验报告:java面向对象程序设计

    java实验二实验报告 实验内容 1. 初步掌握单元测试和TDD 2. 理解并掌握面向对象三要素:封装.继承.多态 3. 初步掌握UML建模 4. 熟悉S.O.L.I.D原则 5. 了解设计模式 实验 ...

  9. java实现屏幕共享的小程序

          最近在做软件软件工程的课程设计,做一个用于实验室的屏幕监控系统,参考各种前人代码,最后领悟之后要转换自己的代码,初学者都是这样模仿过来的.       说到屏幕监控系统,有教师断和学生端, ...

  10. 实现一个可以实时提示的textarea组件

    该组件输入.换行.变换光标可以实时给出提示 效果: textarea.vue <template> <div> <el-input id="user-input ...