Description

During OSPF troubleshooting scenarios, it may be needed to enable traceoptions to further debug the problem. JUNOS allows to enable this function into different hierarchies depending on the setup

Solution

  • The most common traces are enable on the main protocol for IPv4 communications:
set protocols ospf traceoptions file ospf.log
set protocols ospf traceoptions file size 5m
set protocols ospf traceoptions file files 5
set protocols ospf traceoptions flag all
  • For OSPFv3 traces are enable under ospf3 hierarchy:
set protocols ospf3 traceoptions file ospf3.log
set protocols ospf3 traceoptions file size 5m
set protocols ospf3 traceoptions file files 10
set protocols ospf3 traceoptions flag all
  • If OSFP is configured under routing-instances, the configuration for ospf and ospfv3 goes as follow:
set routing-instances ospf-instance protocols ospf traceoptions file ospf-vr.log
set routing-instances ospf-instance protocols ospf traceoptions file size 5m
set routing-instances ospf-instance protocols ospf traceoptions file files 5
set routing-instances ospf-instance protocols ospf traceoptions flag all
 
  •  For those deployments using realms, traces will be configured as follow:
set protocols ospf3 realm ipv4-multicast traceoptions file ospf_R_ipv4_mcast.log
set protocols ospf3 realm ipv4-multicast traceoptions file size 5m
set protocols ospf3 realm ipv4-multicast traceoptions file files 10
set protocols ospf3 realm ipv4-multicast traceoptions flag all

set protocols ospf3 realm ipv4-unicast traceoptions file ospf_R_ipv4_unicast.log
set protocols ospf3 realm ipv4-unicast traceoptions file size 5m
set protocols ospf3 realm ipv4-unicast traceoptions file files 10
set protocols ospf3 realm ipv4-unicast traceoptions flag all

set protocols ospf3 realm ipv6-unicast traceoptions file ospf_R_ipv6_Uni.log
set protocols ospf3 realm ipv6-unicast traceoptions file size 5m
set protocols ospf3 realm ipv6-unicast traceoptions file files 10
set protocols ospf3 realm ipv6-unicast traceoptions flag all

set protocols ospf3 realm ipv6-multicast traceoptions file opsf_R_IPv6_mcast.log
set protocols ospf3 realm ipv6-multicast traceoptions file size 5m
set protocols ospf3 realm ipv6-multicast traceoptions file files 10
set protocols ospf3 realm ipv6-multicast traceoptions flag all
  •  Once the traceoptions are configured, these will be stored under /var/log folder:

root@juniper> show log | match ospf
-rw-r-----  1 root  wheel       2459 Aug 29 14:34 ospf-vr.log
-rw-r-----  1 root  wheel      14243 Aug 29 14:34 ospf.log
-rw-r-----  1 root  wheel       6219 Aug 29 14:34 ospf3.log
-rw-r-----  1 root  wheel       2163 Aug 29 14:34 ospf_R_ipv4_mcast.log
-rw-r-----  1 root  wheel       2521 Aug 29 14:34 ospf_R_ipv4_unicast.log


root@juniper> file list /var/log | match ospf
ospf-vr.log
ospf.log
ospf3.log
ospf_R_ipv4_mcast.log
ospf_R_ipv4_unicast.log
 

  •  They could be extracted from the switch via FTP/ SCP, or review using "show log" command"

root@juniper> show log ospf.log
Aug 29 14:34:32 trace_on: Tracing to "/var/log/ospf.tr" started
Aug 29 14:34:32.773950 task_timer_ucreate: created timer OSPF_LSA age  flags <>
Aug 29 14:34:32.773965 task_timer_ucreate: created timer OSPF_LSA gen  flags <>
Aug 29 14:34:32.773977 ospf_set_lsdb_state: Router LSA 10.255.18.145 adv-rtr 10.255.18.145 state QUIET->GEN_PENDING
Aug 29 14:34:32.773982 task_timer_reset: reset OSPF_LSA gen
Aug 29 14:34:32.773990 task_timer_uset: timer OSPF_LSA gen <Touched> set to interval 0 offset 0.050000 with jitter 0 at 14:34:32.86
6000

Modification History

8/29/23 Submitted