路由软件quagga和bird日志配置打印ospf邻居变化
背景:
网络侧反馈偶尔会出现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邻居变化的更多相关文章
- 服务器是windows时tomcat无法打印所有日志配置修改
Tomcat运行仅一天磁盘空间突然就增加了很多,发现是日志文件太大了,修改tomcat的日志配置即可. 查看目录所占空间大小: ? 1 [root@XXX webapps]du -sh 清理方法: ? ...
- SpringBoot15 sell01 项目创建、MySQL数据库连接、日志配置、开发热部署、商品信息模块
项目软件版本说明: jdk: 1.8 springboot: 2.0.1 mysql: 5.7 1 项目创建 创建一个SpringBoot项目即可,创建是勾选 web jpa mysql 这三个依赖就 ...
- django开发日志配置
做django开发离不开 日志,这用于保存我门的服务器的日志信息,便于开发人员的维护. 直接上代码: 在setting.py文件里直接配置即可 LOGGING = { 'version': 1, 'd ...
- Log4j2日志配置详解(1)
log4j与log4j不同:log4j是通过Logger的静态方法getLogger()获取Logger对象,而log4j2是通过LogManager的静态方法getLogger()获取Logger对 ...
- Java Slf4j日志配置输出到文件中
1.概述 新项目需要增加日志需求,所以网上找了下日志配置,需求是将日志保存到指定文件中.网上找了下文章,发现没有特别完整的文章,下面自己整理下. 1.Java日志概述 对于一个应用程序来说日志记录是必 ...
- django 1.8 日志配置
django 1.8 日志配置 以下为setings配置logging代码片段 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(_ ...
- 日志配置logback
在选择项目日志框架时,发现log4j的作者开发了新的日志框架,据说性能提高不少,那就选它了,不过,除了配置上有点不习惯外,最重要的一点 ,打印线程号这个功能依然没有(打印线程名这个东西是在是个鸡肋). ...
- log4j2日志配置
背景 log4j2相对于log4j 1.x有了脱胎换骨的变化,其官网宣称的优势有多线程下10几倍于log4j 1.x和logback的高吞吐量.可配置的审计型日志.基于插件架构的各种灵活配置等. 1. ...
- Log4j各级别日志重复打印的问题
今天在配置Log4j日志的时候,发现日志重复打印的问题.网上查了很多资料,发现介绍Log4j配置的文章数量不少,但提到这个问题的文章却寥寥,解决了自己的问题以后,赶紧记录一下. 原文地址:http:/ ...
随机推荐
- 使用 Git 对原理图和线路板时行版本控制
使用 Git 对原理图和线路板时行版本控制 由于之前一直用 Git 管理代码,我又开始试用 git 来对原理图和线路板时行版本控制. 由于 原理图和 PCB 的文件都是二进制文件,git 管理并不怎么 ...
- torcs代码
/** Info returned by driver during the race */ typedef struct { tdble steer; /**< Steer command [ ...
- (一)Fiddler的介绍和安装
一.Fiddler的介绍和安装 Fildder是一款免费的web调试代理工具,支持任何浏览器.系统或平台. 官网地址:https://www.telerik.com/fiddler Fiddler原理 ...
- 用活firewalld防火墙中的zone
原文地址:http://www.excelib.com/article/290/show firewalld中zone的含义学生前面已经给大家介绍过了,说白了一个zone就是一套规则集.可是什么时候该 ...
- struts2学习(7)值栈简介与OGNL引入
一.值栈简介: 二.OGNL引入: com.cy.action.HelloAction.java: package com.cy.action; import java.util.Map; impor ...
- Java-Runoob:Java Stream、File、IO
ylbtech-Java-Runoob:Java Stream.File.IO 1.返回顶部 1. Java 流(Stream).文件(File)和IO Java.io 包几乎包含了所有操作输入.输出 ...
- 生成短的uuid
package test1; import java.util.Random; import java.util.UUID; public class ShareCodeUtil { private ...
- 转:系统吞吐量(TPS)、用户并发量、性能测试概念和公式
PS:下面是性能测试的主要概念和计算公式,记录下: 一.系统吞度量要素: 一个系统的吞度量(承压能力)与request对CPU的消耗.外部接口.IO等等紧密关联. 单个reqeust 对CPU消耗越高 ...
- javascript示例一
开发工具介绍 前端常用开发工具:sublime.visual Studio Code.HBuilder.Webstorm. 那么大家使用的PCharm跟WebStorm是JetBrains公司推出的编 ...
- 深入浅出 Java Concurrency (14): 锁机制 part 9 读写锁 (ReentrantReadWriteLock) (2)
这一节主要是谈谈读写锁的实现. 上一节中提到,ReadWriteLock看起来有两个锁:readLock/writeLock.如果真的是两个锁的话,它们之间又是如何相互影响的呢? 事实上在Reen ...