OSPF
此内容尚不支持你的语言。
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 [
Section titled “show ip ospf neighbor [”[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 neighborNeighbor ID Pri State Up Time Dead Time Address Interface RXmtL RqstL DBsmL40.0.0. 1 Full/DR 2m16s 32.582s 40.0.0.2 ethernet 0/40:40.0.0.1 0 0 0show ip ospf route
Section titled “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
Section titled “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 count40.0.0.1 40.0.0.1 1062 0x8000003c 0x71ca 1200.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# CkSum40.0.0.2 200.0.0.1 1063 0x80000001 0x2053show ip ospf vrf
Section titled “show ip ospf vrf”[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 neighborVRF Name: Vrf100Neighbor ID Pri State Up Time Dead Time Address Interface RXmtL RqstL DBsmL40.0.0.2 1 Full/Backup 3.521s 36.996s 40.0.0.2 ethernet 0/40:40.0.0.1 1 0 0show ip ospf interface [ethernet|vlan|link-aggregation|traffic|json]
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]
| 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 interfaceethernet 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: 300OSPF Config
Section titled “OSPF Config”Table 2 OSPF Config
| Command | Purpose |
|---|---|
| routerospf_type [vrf_name] | Enable OSPF. |
| ospf router-id A.B.C.D | Configure the router ID for OSPF. |
| areaarea_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-idmd5 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
Section titled “router”[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# configuresonic(config)# router ospfospf router-id
Section titled “ospf router-id”[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# configuresonic(config)# router ospfsonic(config-router)# ospf router-id 1.1.1.1[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# configuresonic(config)# router ospfasonic(config-router)# area 10 stubauto-cost reference-bandwidth
Section titled “auto-cost reference-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# configuresonic(config)# router ospfsonic(config-router)# auto-cost reference-bandwidth 10000redistribute
Section titled “redistribute”[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 terminalsonic(config)# router ospfsonic(config-router)# redistribute connected metric 100ip ospf area
Section titled “ip ospf area”[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# configuresonic(config)# interface ethernet 0/40sonic(config-if-0/40)# ip ospf area 10ip 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# configuresonic(config)# interface ethernet 0/40sonic(config-if-0/40)# ip ospf network point-to-pointip ospf cost
Section titled “ip ospf cost”[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# configuresonic(config)# interface ethernet 0/40sonic(config-if-0/40)# ip ospf cost 100ip ospf priority
Section titled “ip ospf 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# configuresonic(config)# interface ethernet 0/40sonic(config-if-0/40)# ip ospf priority 10ip ospf mtu-ignore
Section titled “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# configuresonic(config)# interface ethernet 0/40sonic(config-if-0/40)# ip ospf mtu-ignoreip 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]
| 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# configuresonic(config)# interface ethernet 0/40sonic(config-if-0/40)# ip ospf dead-interval 50sonic(config-if-0/40)# ip ospf hello-interval 10sonic(config-if-0/40)# ip ospf retransmit-interval 20ip 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]
| 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# configuresonic(config)# interface ethernet 0/40sonic(config-if-0/40)# ip ospf authenticationsonic(config-if-0/40)# ip ospf authentication message-digestip ospf authentication-key
Section titled “ip ospf authentication-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# configuresonic(config)# interface ethernet 0/40sonic(config-if-0/40)# ip ospf authentication-key 123456ip ospf message-digest-key
Section titled “ip ospf message-digest-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# configuresonic(config)# interface ethernet 0/40sonic(config-if-0/40)# ip ospf message-digest-key 10 md5 123456ip ospf bfd [profile
Section titled “ip ospf bfd [profile”[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# configuresonic(config)# interface ethernet 0/40sonic(config-if-0/40)# ip ospf bfd sw1ip ospf ttl
Section titled “ip ospf ttl”[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# configuresonic(config)# interface ethernet 0/40sonic(config-if-0/40)# ip ospf ttl 10