路由软件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
  *提示:此步骤是为了查看效果,如果是线上机器,请勿执行。

日志如下:
[[email protected] ~]# 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: [email protected]
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
*提示:此步骤是为了查看效果,如果是线上机器,请勿执行。

日志如下:
[[email protected] ~]# 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/

时间: 2024-11-10 13:35:06

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

ros软路由防火墙(双线路、日志配置)

1实验目的 然防火墙的日志导出到服务器系统上,双线路的目的是使得有线与无线上网行为能够控制. 2 实验内容 本次内容包括Ros防火墙配置.winxp系统 ping测试,日志导出. 3 实验工具 VMware Workstation12.Ros防火墙软件.Winx2系统,win7(物理机) 4实验步骤 4.1 日志的导出配置 4.1.1 首先需要把dude软件复制到win xp2上去,然后安装使用,用127.0.0.1进行登录,首先需要添加SimHei字体,也需要复制到win xp2系统桌面上,然

安装Quagga路由软件

> #!/bin/bash 要先下载好软件:quagga-0.99.19.tar.gz cp /etc/yum.conf /etc/yum.conf.lnmp sed -i 's:exclude=.*:exclude=:g' /etc/yum.conf for packages in gcc gcc-c++ ncurses-devel libxml2-devel openssl-devel curl-devel libjpeg-devel libpng-devel autoconf pcre-d

log4j2日志配置

背景 log4j2相对于log4j 1.x有了脱胎换骨的变化,其官网宣称的优势有多线程下10几倍于log4j 1.x和logback的高吞吐量.可配置的审计型日志.基于插件架构的各种灵活配置等. 1.所需jar 1)maven配置 <dependencies> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-api</artifactId&

CentOS 6.6 sudo日志配置

CentOS 6.6 sudo日志配置 查询syslog和sudo软件是否已安装 [[email protected] ~]# rpm-qa|egrep "sudo|syslog" rsyslog-5.8.10-8.el6.x86_64 sudo-1.8.6p3-15.el6.x86_64 配置/etc/sudoers文件 [[email protected] ~]# echo"Defaults    logfile=/var/log/sudo.log">&g

Tomcat日志配置

1.Log4j日志配置 ①log4j代替tomcat自身的log 如果想用log4j来详细的打印出 tomcat的log,用下面的方法可以做到首先,将common-logging和log4j的包放入tomat/common/lib下然后将log4j.properties文件放入tomcat/common/classes下 ②根据日志不同级别,进行配置输出 配置文件: ### set log levels ###log4j.rootLogger = debug ,  stdout ,  D , 

django 1.8 日志配置

以下为setings配置logging代码片段 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) LOGDIR = os.path.join(BASE_DIR, "logs") LOGFILE = datetime.datetime.now().strftime("%Y-%m-%d") + ".log" if not os.path.exists(LOGD

tomcat访问(access)日志配置、记录Post请求参数(转)

一.配置与说明 tomcat访问日志格式配置,在config/server.xml里Host标签下加上 <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"               prefix="localhost_access_log." suffix=".txt"               pattern=&

Log4J日志配置详解和自定义log4j日志级别及输出日志到不同文件实现方法

Log4J日志配置详解 一.Log4j简介 Log4j有三个主要的组件:Loggers(记录器),Appenders(输出源)和Layouts(布局).这里可简单理解为日志类别,日志要输出的地方和日志以何种形式输出.综合使用这三个组件可以轻松地记录信息的类型和级别,并可以在运行时控制日志输出的样式和位置. 1.Loggers Loggers组件在此系统中被分为五个级别:DEBUG.INFO.WARN.ERROR和FATAL.这五个级别是有顺序的,DEBUG < INFO < WARN <

Log4j日志配置记录

在项目中使用log4j,大致过程如下: 1.web.xml中配置对log4j配置文件的加载.如下 <context-param> <param-name>logbackConfigLocation</param-name> <param-value>file:${config.root}/logback.xml</param-value> </context-param> 2.代码中对log4j的使用,进行日志的打印. 有两种使用方式