跳转到内容
Ask AI

OSPF

此内容尚不支持你的语言。

Table 1 OSPF View

CommandPurpose
**show ip ospf neighbor ** [OPTIONs]Display OSPF neighbor information
show ip ospf routeDisplay OSPF route information
show ip ospf datebaseDisplay 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

[Command] **show ip ospf neighbor ** [OPTIONs]

[Purpose] Display OSPF neighbor information.

[Options]

OptionDescription
allDisplay all OSPF neighbor information.
jsonDisplay in Json format.
detailDisplay neighbor details.
A.B.C.DDisplay neighbor information based on neighbor ID.
ethernetDisplay neighbor information for physical interface.
vlanDisplay neighbor information for VLAN interface.
link-aggregationDisplay 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

[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 ===========

[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

[Command] show ip ospf vrf vrf_name **neighbor ** [OPTIONs]

[Purpose] Display OSPF neighbor information for specified VRF.

[Parameters]

ParameterDescription
vrf_nameVrf name.

[Options]

OptionDescription
allDisplay all OSPF neighbor information.
jsonDisplay in Json format.
detailDisplay neighbor details.
A.B.C.DDisplay neighbor information based on neighbor ID.
ethernetDisplay neighbor information for physical interface.
vlanDisplay neighbor information for VLAN interface.
link-aggregationDisplay 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
Section titled “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]

ParameterDescription
ethernetDisplay neighbor information for physical interfaces.
vlanDisplay neighbor information for VLAN interfaces.
link-aggregationDisplay neighbor information for aggregation interfaces.
trafficDisplay OSPF message count for interface.
jsonDisplay 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

Table 2 OSPF Config

CommandPurpose
routerospf_type [vrf_name]Enable OSPF.
ospf router-id A.B.C.DConfigure the router ID for OSPF.
areaarea_id {authentication|default-cost|nssa|stub}Configure area related parameters.
auto-cost reference-bandwidth bandwidthConfigure auto-cost reference bandwidth.
redistribute src_protocol [metric metric_value|route-map route_map]Introducing routing for other protocols.
ip ospf area area_idEnable OSPF function of the interface.
ip ospf network{broadcast|non-broadcast|point-to-multipoint|point-to-point}Configure OSPF network type.
ip ospf cost numberConfigure cost value.
ip ospf priority priorityConfigure OSPF router priority.
ip ospf mtu-ignoreEnable MTU ignore switch.
ip ospf{dead-interval|hello-interval|retransmit-interval} timeConfigure OSPF various time intervals.
**ip ospf authentication ** [null|message-digest]Configure OSPF interface authentication method.
ip ospf authentication-key auth-keyConfigure passwords for simple password authentication.
ip ospf message-digest-key key-idmd5 keyConfigure password for MD5 authentication.
**ip ospf bfd [profile profile_name]Configure OSPF and BFD linkage.
ip ospf ttl ttl_valueSet the TTL value of OSPF message.

[Command] router ospf_type [vrf_name]

[Purpose] Enable OSPF and enter the OSPF configuration view.

[Parameters]

ParameterDescription
ospf_typeThe type of OSPF is ospf or ospf6, which is either IPv4 or IPv6
vrf_nameVRF 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

[Command] ospf router-id A.B.C.D

[Purpose] Configure router ID.

[Parameters]

ParameterDescription
A.B.C.Drouter 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

[Command] area area_id {authentication|default-cost|nssa|stub}

[Purpose] Configure area related parameters.

[Parameters]

ParameterDescription
area_idarea id
authenticationSet the area authentication as short answer password authentication or MD5 encryption authentication
default-costSet default cost for nssa or stub domains
nssaConfigure OSPF area as nssa
stubConfigure 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

[Command] auto-cost reference-bandwidth bandwidth

[Purpose] Configure auto-cost reference bandwidth.

[Parameters]

ParameterDescription
bandwidthReference 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

[Command] redistribute src_protocol [metric metric_value|route-map route-map]

[Purpose] Redistribute information from another routing protocol in OSPF.

[Parameters]

ParameterDescription
src_protocolSet source protocol (connected|isis|kernel|ospf|rip|static|bgp).
metric_valueMetric for redistributed routes, range from 0 to 16777214.
route-mapRoute 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

[Command] ip ospf area area_id

[Purpose] Enable OSPF function of the interface.

[Parameters]

ParameterDescription
area_idarea 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}

Section titled “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

[Command] ip ospf cost number

[Purpose] Configure the cost value of OSPF network ports.

[Parameters]

ParameterDescription
numberCost 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

[Command] ip ospf priority priority

[Purpose] Configure OSPF router priority.

[Parameters]

ParameterDescription
priorityPriority 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

[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}

Section titled “ip ospf {dead-interval|hello-interval|retransmit-interval}”

[Command] ip ospf {dead-interval|hello-interval|retransmit-interval}

[Purpose] Configure OSPF various time intervals.

[Parameters]

ParameterDescription
dead-intervalNeighbor timeout interval, measured in seconds, with a range of 1 to 65535, default to 40 seconds
hello-intervalThe time interval for sending hello messages, measured in seconds, with a range of 1 to 65535. The default value is 10 seconds
retransmit-intervalThe 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]

Section titled “ip ospf authentication [null|message-digest]”

[Command] ip ospf authentication [null|message-digest] [Purpose] Configure OSPF interface authentication method.

[Parameters]

ParameterDescription
nullConfigure authentication method as null authentication
message-digestConfigure 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

[Command] ip ospf authentication-key auth-key

[Purpose] Configure simple password authentication password.

[Parameters]

ParameterDescription
auth-keyAuthentication 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

[Command] ip ospf message-digest-key key-id md5 key

[Purpose] Configure MD5 authentication password.

[Parameters]

ParameterDescription
key_idKey ID, with a value range of 1-255
keyPassword 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

[Command] **ip ospf bfd ** [profile profile_name]

[Purpose] Configure OSPF and BFD linkage.

[Parameters]

ParameterDescription
profile_nameThe 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

[Command] ip ospfttl ttl_value

[Purpose] Set the TTL value of OSPF message.

[Parameters]

ParameterDescription
ttl_valueTTL 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