Command Line Reference
Layer 3 Configuration
OSPF
33 min
ospf view ospf view table 1 ospf view table 1 ospf view command purpose show ip ospf neighbor \[ options ] display ospf neighbor information show ip ospf route display ospf route information show ip ospf datebase display ospf datebase information show ip ospf vrf vrf name neighbor \[ options ] display ospf neighbor information for specified vrf show ip ospf interface \[ethernet|vlan|link aggregation|traffic|json] display ospf neighbor information for the interface show ip ospf neighbor \[ show ip ospf neighbor \[ options ] \[command] show ip ospf neighbor \[ options ] \[purpose] display ospf neighbor information \[options] option description all display all ospf neighbor information json display in json format detail display neighbor details a b c d display neighbor information based on neighbor id ethernet display neighbor information for physical interface vlan display neighbor information for vlan interface link aggregation display neighbor information for aggregation interfaces \[view] privileged user view \[use cases] sonic# show ip ospf neighbor neighbor id pri state up time dead time address interface rxmtl rqstl dbsml 40 0 0 1 full/dr 2m16s 32 582s 40 0 0 2 ethernet 0/40 40 0 0 1 0 0 0 show ip ospf route show ip ospf route \[command] show ip ospf route \[purpose] display ospf route information \[view] privileged user view \[use cases] sonic# show ip ospf route \============ ospf network routing table ============ n 40 0 0 0/24 \[10000] area 0 0 0 10 directly attached to ethernet 0/40 \============ ospf router routing table ============= \============ ospf external routing table =========== show ip ospf database show ip ospf database \[command] show ip ospf database \[purpose] display ospf database information \[view] privileged user view \[use cases] sonic# show ip ospf database ospf router with id (40 0 0 1) router link states (area 0 0 0 10) link id adv router age seq# cksum link count 40 0 0 1 40 0 0 1 1062 0x8000003c 0x71ca 1 200 0 0 1 200 0 0 1 1063 0x80000003 0x240f 1 net link states (area 0 0 0 10) link id adv router age seq# cksum 40 0 0 2 200 0 0 1 1063 0x80000001 0x2053 show ip ospf vrf show ip ospf vrf vrf name neighbor \[ options ] \[command] show ip ospf vrf vrf name neighbor \[ options ] \[purpose] display ospf neighbor information for specified vrf \[parameters] parameter description vrf name vrf name \[options] option description all display all ospf neighbor information json display in json format detail display neighbor details a b c d display neighbor information based on neighbor id ethernet display neighbor information for physical interface vlan display neighbor information for vlan interface link aggregation display neighbor information for aggregation interfaces \[view] privileged user view \[use cases] sonic# show ip ospf vrf 100 neighbor vrf name vrf100 neighbor id pri state up time dead time address interface rxmtl rqstl dbsml 40 0 0 2 1 full/backup 3 521s 36 996s 40 0 0 2 ethernet 0/40 40 0 0 1 1 0 0 show ip ospf interface \[ethernet|vlan|link aggregation|traffic|json] show ip ospf interface \[ethernet|vlan|link aggregation|traffic|json] \[command] show ip ospf interface \[ethernet|vlan|link aggregation|traffic|json] \[purpose] display ospf neighbor information for the interface \[parameters] parameter description ethernet display neighbor information for physical interfaces vlan display neighbor information for vlan interfaces link aggregation display neighbor information for aggregation interfaces traffic display ospf message count for interface json display interface neighbor information in json format \[view] privileged user view \[use cases] sonic# show ip ospf interface ethernet 0/40 is up ifindex 57, mtu 9216 bytes, bw 10 mbit \<up,broadcast,running,allmulti,multicast> internet address 40 0 0 1/24, broadcast 40 0 0 255, area 0 0 0 10 mtu mismatch detection enabled router id 1 1 1 1, network type broadcast, cost 10000 transmit delay is 1 sec, state backup, priority 1 designated router (id) 200 0 0 1 interface address 40 0 0 2/24 backup designated router (id) 1 1 1 1, interface address 40 0 0 1 multicast group memberships ospfallrouters ospfdesignatedrouters timer intervals configured, hello 10s, dead 40s, wait 40s, retransmit 5 hello due in 1 825s neighbor count is 1, adjacent neighbor count is 1 bfd detect multiplier 3, min rx interval 300, min tx interval 300 ospf config ospf config table 2 ospf config table 2 ospf config command purpose router ospf type \[ vrf name ] enable ospf ospf router id a b c d configure the router id for ospf area area id { authentication | default cost | nssa | stub } configure area related parameters auto cost reference bandwidth bandwidth configure auto cost reference bandwidth redistribute src protocol \[ metric metric value | route map route map ] introducing routing for other protocols ip ospf area area id enable ospf function of the interface ip ospf network { broadcast | non broadcast | point to multipoint | point to point } configure ospf network type ip ospf cost number configure cost value ip ospf priority priority configure ospf router priority ip ospf mtu ignore enable mtu ignore switch ip ospf { dead interval | hello interval | retransmit interval } time configure ospf various time intervals ip ospf authentication \[ null|message digest] configure ospf interface authentication method ip ospf authentication key auth key configure passwords for simple password authentication ip ospf message digest key key id md5 key configure password for md5 authentication ip ospf bfd \[ profile profile name ] configure ospf and bfd linkage ip ospf ttl ttl value set the ttl value of ospf message router router ospf type \[ vrf name ] \[command] router ospf type \[ vrf name ] \[purpose] enable ospf and enter the ospf configuration view \[parameters] parameter description ospf type the type of ospf is ospf or ospf6, which is either ipv4 or ipv6 vrf name vrf name, default vrf if not specified \[view] global configuration view \[notes] run command no router ospf \[ vrf name ] to disable ospf function \[use cases] sonic# configure sonic(config)# router ospf ospf router id ospf router id a b c d \[command] ospf router id a b c d \[purpose] configure router id \[parameters] parameter description a b c d router id \[view] ospf configuration view \[notes] run command no ospf router id a b c d delete ospf router id \[use cases] sonic# configure sonic(config)# router ospf sonic(config router)# ospf router id 1 1 1 1 area area area id {authentication|default cost|nssa|stub} \[command] area area id { authentication|default cost|nssa|stub } \[purpose] configure area related parameters \[parameters] parameter description area id area id authentication set the area authentication as short answer password authentication or md5 encryption authentication default cost set default cost for nssa or stub domains nssa configure ospf area as nssa stub configure ospf area as stub \[view] ospf configuration view \[notes] run command no area area id {authentication| default cost| nssa| stub} to delete area related parameter configurations \[use cases] sonic# configure sonic(config)# router ospf asonic(config router)# area 10 stub auto cost reference bandwidth auto cost reference bandwidth bandwidth \[command] auto cost reference bandwidth bandwidth \[purpose] configure auto cost reference bandwidth \[parameters] parameter description bandwidth reference bandwidth value, the unit is mb/s, with a value range of 1 4294967 \[view] ospf configuration view \[notes] run command no auto cost reference bandwidth to delete configured reference bandwidth \[use cases] sonic# configure sonic(config)# router ospf sonic(config router)# auto cost reference bandwidth 10000 redistribute redistribute src protocol \[metric metric value |route map route map ] \[command] redistribute src protocol \[ metric metric value | route map route map ] \[purpose] redistribute information from another routing protocol in ospf \[parameters] parameter description src protocol set source protocol (connected|isis|kernel|ospf|rip|static|bgp) metric value metric for redistributed routes, range from 0 to 16777214 route map route map reference \[view] ospf configuration view \[notes] the redistribution for the same protocol is an overriding configuration run command no redistribute src protocol \[ metric metric value | route map route map ] to cancel route redistribution \[use cases] sonic# configure terminal sonic(config)# router ospf sonic(config router)# redistribute connected metric 100 ip ospf area ip ospf area area id \[command] ip ospf area area id \[purpose] enable ospf function of the interface \[parameters] parameter description area id area id, it is an ip address or decimal form if it is a decimal value, the range of values is 0 4294967295 \[view] physical interface/vlan interface/lag interface configuration view \[notes] run command no ip ospf area area id to disable ospf function of the interface \[use cases] sonic# configure sonic(config)# interface ethernet 0/40 sonic(config if 0/40)# ip ospf area 10 ip ospf network {broadcast|non broadcast|point to multipoint|point to point} ip ospf network {broadcast|non broadcast|point to multipoint|point to point} \[command] ip ospf network {broadcast|non broadcast|point to multipoint|point to point} \[purpose] configure ospf network type \[view] physical interface/vlan interface/lag interface configuration view \[notes] run command no ip ospf network to not specify the network type for ospf, the default network type is broadcast \[use cases] sonic# configure sonic(config)# interface ethernet 0/40 sonic(config if 0/40)# ip ospf network point to point ip ospf cost ip ospf cost number \[command] ip ospf cost number \[purpose] configure the cost value of ospf network ports \[parameters] parameter description number cost value, the value range is 1 65535 \[view] physical interface/vlan interface/lag interface configuration view \[notes] run command no ip ospf cost to delete the cost value of the interface \[use cases] sonic# configure sonic(config)# interface ethernet 0/40 sonic(config if 0/40)# ip ospf cost 100 ip ospf priority ip ospf priority priority \[command] ip ospf priority priority \[purpose] configure ospf router priority \[parameters] parameter description priority priority level, range of values is 0 255, default level is 1 \[view] physical interface/vlan interface/lag interface configuration view \[notes] run command no ip ospf priority to restore ospf router priority to default value \[use cases] sonic# configure sonic(config)# interface ethernet 0/40 sonic(config if 0/40)# ip ospf priority 10 ip ospf mtu ignore ip ospf mtu ignore \[command] ip ospf mtu ignore \[purpose] enable mtu ignore switch \[view] physical interface/vlan interface/lag interface configuration view \[notes] run command no ip ospf mtu ingore to disable mtu ignore switch \[use cases] sonic# configure sonic(config)# interface ethernet 0/40 sonic(config if 0/40)# ip ospf mtu ignore ip ospf {dead interval|hello interval|retransmit interval} ip ospf {dead interval|hello interval|retransmit interval} \[command] ip ospf {dead interval|hello interval|retransmit interval} \[purpose] configure ospf various time intervals \[parameters] parameter description dead interval neighbor timeout interval, measured in seconds, with a range of 1 to 65535, default to 40 seconds hello interval the time interval for sending hello messages, measured in seconds, with a range of 1 to 65535 the default value is 10 seconds retransmit interval the time interval for retransmitting lsa messages, measured in seconds, with a range of 1 to 65535, and a default of 5 seconds \[view] physical interface/vlan interface/lag interface configuration view \[notes] run command no ip ospf {dead interval|hello interval|retransmit interval} to restore various time intervals to default values \[use cases] sonic# configure sonic(config)# interface ethernet 0/40 sonic(config if 0/40)# ip ospf dead interval 50 sonic(config if 0/40)# ip ospf hello interval 10 sonic(config if 0/40)# ip ospf retransmit interval 20 ip ospf authentication \[null|message digest] ip ospf authentication \[null|message digest] \[command] ip ospf authentication \[null|message digest] \[purpose] configure ospf interface authentication method \[parameters] parameter description null configure authentication method as null authentication message digest configure the authentication method to md5 authentication \[view] physical interface/vlan interface/lag interface configuration view \[notes] when there are no parameters, the authentication method is simple password authentication when both regional authentication and interface authentication are configured, interface authentication is preferred run command no ip ospf authentication to delete ospf interface authentication \[use cases] sonic# configure sonic(config)# interface ethernet 0/40 sonic(config if 0/40)# ip ospf authentication sonic(config if 0/40)# ip ospf authentication message digest ip ospf authentication key ip ospf authentication key auth key \[command] ip ospf authentication key auth key \[purpose] configure simple password authentication password \[parameters] parameter description auth key authentication password, password length less than or equal to 8 digits \[view] physical interface/vlan interface/lag interface configuration view \[notes] run command no ip ospf authentication to delete password for simple password authentication \[use cases] sonic# configure sonic(config)# interface ethernet 0/40 sonic(config if 0/40)# ip ospf authentication key 123456 ip ospf message digest key ip ospf message digest key key id md5 key \[command] ip ospf message digest key key id md5 key \[purpose] configure md5 authentication password \[parameters] parameter description key id key id, with a value range of 1 255 key password for md5 authentication method, with a length of less than or equal to 16 bits \[view] physical interface/vlan interface/lag interface configuration view \[notes] run command no ip ospf message digest key key id md5 key to delete password for md5 authentication method \[use cases] sonic# configure sonic(config)# interface ethernet 0/40 sonic(config if 0/40)# ip ospf message digest key 10 md5 123456 ip ospf bfd \[profile ip ospf bfd \[profile profile name ] \[command] ip ospf bfd \[ profile profile name ] \[purpose] configure ospf and bfd linkage \[parameters] parameter description profile name the profile name of bfd \[view] physical interface/vlan interface/lag interface configuration view \[notes] run command no ip ospf bfd to delete ospf and bfd linkage \[use cases] sonic# configure sonic(config)# interface ethernet 0/40 sonic(config if 0/40)# ip ospf bfd sw1 ip ospf ttl ip ospf ttl ttl value \[command] ip ospfttl ttl value \[purpose] set the ttl value of ospf message \[parameters] parameter description ttl value ttl value, the range is 0 255 \[view] physical interface/vlan interface/lag interface configuration view \[notes] run command no ip ospf ttl to restore to the default value the default ttl is 1 \[use cases] sonic# configure sonic(config)# interface ethernet 0/40 sonic(config if 0/40)# ip ospf ttl 10
