背景:
  网络侧反馈偶尔会出现ospf邻居状态变化:full-> other status -> full.历史原因,线上运行的路由软件有quagga和bird两种。两种路由软件的日志级别配置,打印ospf邻居状态变化的过程。

quagga:
  配置选项:
  日志文件记录配置
  log file /home/work/quagga/logs/ospfd.log
  日志打印邻居关系状态变化过程
  debug ospf nsm status

  配置操作:
  mkdir /home/work/quagga/logs -pv
  chown -R quagga.quagga /home/work/quagga/
  vtysh
  conf t
  log file /home/work/quagga/logs/ospfd.log
  debug ospf nsm status
  end
  w
  exit
  *提示:Linux命令行下复制粘贴上述命令即可,热加载生效,无需重启服务。

  重启ospfd服务:
  service ospfd restart
  *提示:此步骤是为了查看效果,如果是线上机器,请勿执行。

日志如下:
[root@localhost ~]# cat /home/work/quagga/logs/ospfd.log
2017/12/15 13:42:11 OSPF: Terminating on signal
2017/12/15 13:42:11 OSPF: NSM[eth1:10.105.251.26:10.105.252.174]: State change Full -> Deleted (KillNbr)
2017/12/15 13:42:11 OSPF: AdjChg: Nbr 10.105.252.174 on eth1:10.105.251.26: Full -> Deleted (KillNbr)
2017/12/15 13:42:11 OSPF: nsm_change_state(10.105.252.174, Full -> Deleted): scheduling new router-LSA origination
2017/12/15 13:42:11 OSPF: ospfTrapIfStateChange trap sent: 10.105.251.26 now Down
2017/12/15 13:42:11 OSPF: interface 10.105.251.26 [5] leave AllSPFRouters Multicast group.
2017/12/15 13:42:11 OSPF: OSPFd 0.99.15 starting: vty@2604
2017/12/15 13:42:11 OSPF: ospfTrapIfStateChange trap sent: 10.105.251.26 now Point-To-Point
2017/12/15 13:42:11 OSPF: interface 10.105.251.26 [5] join AllSPFRouters Multicast group.
2017/12/15 13:42:11 OSPF: NSM[eth1:10.105.251.26:10.105.252.174]: State change Down -> Init (HelloReceived)
2017/12/15 13:42:11 OSPF: NSM[eth1:10.105.251.26:10.105.252.174]: State change Init -> ExStart (2-WayReceived)
2017/12/15 13:42:11 OSPF: Packet[DD]: Neighbor 10.105.252.174 Negotiation done (Slave).
2017/12/15 13:42:11 OSPF: NSM[eth1:10.105.251.26:10.105.252.174]: State change ExStart -> Exchange (NegotiationDone)
2017/12/15 13:42:11 OSPF: NSM[eth1:10.105.251.26:10.105.252.174]: State change Exchange -> Loading (ExchangeDone)
2017/12/15 13:42:11 OSPF: NSM[eth1:10.105.251.26:10.105.252.174]: State change Loading -> Full (LoadingDone)
2017/12/15 13:42:11 OSPF: AdjChg: Nbr 10.105.252.174 on eth1:10.105.251.26: Loading -> Full (LoadingDone)
2017/12/15 13:42:11 OSPF: nsm_change_state(10.105.252.174, Loading -> Full): scheduling new router-LSA origination

bird:

配置选项:
日志文件记录配置
log "/home/work/logs/bird.log" all;
日志打印邻居关系状态变化过程
1. debug protocols { events }; #全局配置
2. debug { events }; #局部配置,在每个protocol中配置
*提示:在1和2中选择其中一个,请注意配置位置,建议采用全局配置。

配置操作:
sed -i '3idebug protocols { events };' /etc/bird.conf #bird配置文件

热加载生效,无需重启服务。
birdcl config

重启bird服务:
kill -9 `ps -ef |grep bir[d]|awk '{print $2}'`
/usr/local/bird/sbin/bird -c /usr/local/bird/etc/bird.conf
*提示:此步骤是为了查看效果,如果是线上机器,请勿执行。

日志如下:
[root@localhost ~]# grep state /home/work/logs/bird.log
2017-12-12 19:03:03 <TRACE> C3_CNC: Changing state of iface veth1.306 from down to ptp
2017-12-12 19:03:03 <TRACE> C3_CTC: Changing state of iface veth1.305 from down to ptp
2017-12-12 19:03:03 <TRACE> C3_BGP: Changing state of iface veth1.308 from down to ptp
2017-12-12 19:03:04 <TRACE> C3_CMN: Changing state of iface veth1.307 from down to ptp
2017-12-12 19:03:06 <TRACE> C3_CTC: Changing state of iface lo from down to ptp
2017-12-12 19:03:15 <TRACE> C3_CTC: Changing state of iface lo from ptp to down
2017-12-12 19:03:15 <TRACE> C3_CTC: Changing state of iface lo from down to ptp
2017-12-12 19:03:15 <TRACE> C3_CTC: Changing state of iface lo from down to ptp
2017-12-12 19:03:35 <TRACE> C3_CMN: Neighbor 10.115.254.49 changes state from " down" to " init".
2017-12-12 19:03:35 <TRACE> C3_CMN: Neighbor 10.115.254.49 changes state from " init" to " 2way".
2017-12-12 19:03:35 <TRACE> C3_CMN: Neighbor 10.115.254.49 changes state from " 2way" to " exstart".
2017-12-12 19:03:35 <TRACE> C3_CNC: Neighbor 10.115.254.45 changes state from " down" to " init".
2017-12-12 19:03:35 <TRACE> C3_CNC: Neighbor 10.115.254.45 changes state from " init" to " 2way".
2017-12-12 19:03:35 <TRACE> C3_CNC: Neighbor 10.115.254.45 changes state from " 2way" to " exstart".
2017-12-12 19:03:35 <TRACE> C3_CTC: Neighbor 10.115.254.41 changes state from " down" to " init".
2017-12-12 19:03:35 <TRACE> C3_CTC: Neighbor 10.115.254.41 changes state from " init" to " 2way".
2017-12-12 19:03:35 <TRACE> C3_CTC: Neighbor 10.115.254.41 changes state from " 2way" to " exstart".
2017-12-12 19:03:35 <TRACE> C3_BGP: Neighbor 10.115.254.53 changes state from " down" to " init".
2017-12-12 19:03:35 <TRACE> C3_BGP: Neighbor 10.115.254.53 changes state from " init" to " 2way".
2017-12-12 19:03:35 <TRACE> C3_BGP: Neighbor 10.115.254.53 changes state from " 2way" to " exstart".
2017-12-12 19:03:36 <TRACE> C3_CMN: Neighbor 10.115.254.49 changes state from " exstart" to "exchange".
2017-12-12 19:03:36 <TRACE> C3_CNC: Neighbor 10.115.254.45 changes state from " exstart" to "exchange".
2017-12-12 19:03:36 <TRACE> C3_CTC: Neighbor 10.115.254.41 changes state from " exstart" to "exchange".
2017-12-12 19:03:36 <TRACE> C3_BGP: Neighbor 10.115.254.53 changes state from " exstart" to "exchange".
2017-12-12 19:03:36 <TRACE> C3_CNC: Neighbor 10.115.254.45 changes state from "exchange" to " loading".
2017-12-12 19:03:36 <TRACE> C3_CMN: Neighbor 10.115.254.49 changes state from "exchange" to " loading".
2017-12-12 19:03:36 <TRACE> C3_CTC: Neighbor 10.115.254.41 changes state from "exchange" to " loading".
2017-12-12 19:03:36 <TRACE> C3_BGP: Neighbor 10.115.254.53 changes state from "exchange" to " loading".
2017-12-12 19:03:37 <TRACE> C3_CTC: Neighbor 10.115.254.41 changes state from " loading" to " full".
2017-12-12 19:03:37 <TRACE> C3_CNC: Neighbor 10.115.254.45 changes state from " loading" to " full".
2017-12-12 19:03:37 <TRACE> C3_CMN: Neighbor 10.115.254.49 changes state from " loading" to " full".
2017-12-12 19:03:37 <TRACE> C3_BGP: Neighbor 10.115.254.53 changes state from " loading" to " full".

参考文档:

quagga官方文档:http://www.nongnu.org/quagga/
bird官方文档:http://bird.network.cz/

路由软件quagga和bird日志配置打印ospf邻居变化的更多相关文章

  1. 服务器是windows时tomcat无法打印所有日志配置修改

    Tomcat运行仅一天磁盘空间突然就增加了很多,发现是日志文件太大了,修改tomcat的日志配置即可. 查看目录所占空间大小: ? 1 [root@XXX webapps]du -sh 清理方法: ? ...

  2. SpringBoot15 sell01 项目创建、MySQL数据库连接、日志配置、开发热部署、商品信息模块

    项目软件版本说明: jdk: 1.8 springboot: 2.0.1 mysql: 5.7 1 项目创建 创建一个SpringBoot项目即可,创建是勾选 web jpa mysql 这三个依赖就 ...

  3. django开发日志配置

    做django开发离不开 日志,这用于保存我门的服务器的日志信息,便于开发人员的维护. 直接上代码: 在setting.py文件里直接配置即可 LOGGING = { 'version': 1, 'd ...

  4. Log4j2日志配置详解(1)

    log4j与log4j不同:log4j是通过Logger的静态方法getLogger()获取Logger对象,而log4j2是通过LogManager的静态方法getLogger()获取Logger对 ...

  5. Java Slf4j日志配置输出到文件中

    1.概述 新项目需要增加日志需求,所以网上找了下日志配置,需求是将日志保存到指定文件中.网上找了下文章,发现没有特别完整的文章,下面自己整理下. 1.Java日志概述 对于一个应用程序来说日志记录是必 ...

  6. django 1.8 日志配置

    django 1.8 日志配置 以下为setings配置logging代码片段 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(_ ...

  7. 日志配置logback

    在选择项目日志框架时,发现log4j的作者开发了新的日志框架,据说性能提高不少,那就选它了,不过,除了配置上有点不习惯外,最重要的一点 ,打印线程号这个功能依然没有(打印线程名这个东西是在是个鸡肋). ...

  8. log4j2日志配置

    背景 log4j2相对于log4j 1.x有了脱胎换骨的变化,其官网宣称的优势有多线程下10几倍于log4j 1.x和logback的高吞吐量.可配置的审计型日志.基于插件架构的各种灵活配置等. 1. ...

  9. Log4j各级别日志重复打印的问题

    今天在配置Log4j日志的时候,发现日志重复打印的问题.网上查了很多资料,发现介绍Log4j配置的文章数量不少,但提到这个问题的文章却寥寥,解决了自己的问题以后,赶紧记录一下. 原文地址:http:/ ...

随机推荐

  1. Spring整合JavaMail

    1.添加jar包 #此处省略spring基础相关jar包描述,以下是发送邮件相关jar包 <dependency> <groupId>org.springframework&l ...

  2. 网络流量监控分析工具 Ntopng 安装

    官方说明:http://packages.ntop.org/      http://packages.ntop.org/centos-stable/   http://packages.ntop.o ...

  3. 老司机带带我,FIFO不简单

    FIFO,没有想象的那么简单! 根据一般的原则,FIFO这件事情啊,如果能用IP先别自己手写.可以通过FPGA厂家的的IP生成工具生成相应的FIFO. FIFO中的格雷码: 格雷码应用于异步FIFO的 ...

  4. Netty--使用TCP协议传输文件

    简介: 用于将文件通过TCP协议传输到另一台机器,两台机器需要通过网络互联. 实现: 使用Netty进行文件传输,服务端读取文件并将文件拆分为多个数据块发送,接收端接收数据块,并按顺序将数据写入文件. ...

  5. @import '/template/door-info/door-info.wxss';

    小程序css样式引入时,首次要用“”双引号,否则报错

  6. Hashtable、HashMap

    JDK1.6 API public class Hashtable<K,V>extends Dictionary<K,V>implements Map<K,V>, ...

  7. Linux更换jdk版本的一些问题

    111111111111111111111111111111111111111111111111111111111111111111111111 在服务器上更新了新的 jdk,也在 /etc/prof ...

  8. 给深度学习入门者的Python快速教程

    给深度学习入门者的Python快速教程 基础篇 numpy和Matplotlib篇 本篇部分代码的下载地址: https://github.com/frombeijingwithlove/dlcv_f ...

  9. Tkinter Toplevel

       Tkinter Toplevel:顶层部件的工作,直接由窗口管理器管理的窗口.他们不必在它们上面的父widget   顶层部件的工作,直接由窗口管理器管理的窗口.他们不必在它们上面的父widge ...

  10. ubuntu 开机 输入密码 无法进入

    1.给笔记本装了ubuntu14.04.4, 发现开机到输入密码的环节之后,验证正确,然而无法进入桌面,一直在密码页循环. 2.网上找了好多方法,进入命令行(ctrl+alr+F1)登录,能登录进去: ...