Configure OSPF Globally
Configure OSPF parameters on the switch so that you can control OSPF behavior on the system. The switch uses global parameters to communicate with other OSPF routers. Globally configure OSPF before you configure OSPF for an interface, port, or VLAN.
Before you begin
-
Ensure that the switch has an IP interface.
-
You configure OSPF on a VRF instance the same way you configure the GlobalRouter, except that you must use VRF Router Configuration mode and the prefix ip ospf to commands. Not all parameters are configurable on non0 VRFs.
Procedure
Example
Configure the OSPF router ID to 192.0.2.2, enable the automatic creation of OSPF virtual links, and enable traps. Configure the default cost metric for Ethernet to 101, for fast Ethernet to 110, and for gig-Ethernet, ten-gig-Ethernet, twentyfive-gig-ethernet, forty-gig-Ethernet, and hundred-gig-ethernet to 20, and vlan to 1. Configure the basic holdown to 10. Enable OSPF for the switch, and review the configuration.
Switch:1>enable
Switch:1#configure terminal
Switch:1(config)#router ospf
Switch:1(config-ospf)#router-id 192.0.2.2
Switch:1(config-ospf)#auto-vlink
Switch:1(config-ospf)#default-cost ethernet 101
Switch:1(config-ospf)#default-cost fast-ethernet 110
Switch:1(config-ospf)#default-cost gig-ethernet 20
Switch:1(config-ospf)#default-cost ten-gig-ethernet 20
Switch:1(config-ospf)#default-cost twentyfive-gig-ethernet 20
Switch:1(config-ospf)#default-cost Forty-gig-ethernet 20
Switch:1(config-ospf)#default-cost hundred-gig-ethernet 20
Switch:1(config-ospf)#default-cost vlan 2
Switch:1(config-ospf)#timers basic holddown 10
Switch:1(config-ospf)#trap enable
Switch:1(config-ospf)#exit
Switch:1(config)#router ospf enable
Switch:1(config)#show ip ospf
================================================================================
OSPF General - GlobalRouter
================================================================================
RouterId: 192.0.2.2
AdminStat: disabled
VersionNumber: 2
AreaBdrRtrStatus: false
ASBdrRtrStatus: true
Bad-Lsa-Ignore: false
ExternLsaCount: 0
ExternLsaCksumSum: 0(0x0)
TOSSupport: 0
OriginateNewLsas: 0
RxNewLsas: 0
TrapEnable: false
AutoVirtLinkEnable: false
SpfHoldDownTime: 10
Rfc1583Compatibility: disable
Helper mode: enabled
default-metric :
ethernet - 101
fast-ethernet - 110
gig-ethernet - 20
ten-gig-ethernet - 20
twentyfive-gig-ethernet - 20
forty-gig-ethernet - 20
hundred-gig-ethernet - 20
Vlan - 1
Variable definitions
The following table defines parameters for the router-id command.
|
Variable |
Value |
|---|---|
|
<A.B.C.D> |
Configures the OSPF router ID IP address, where A.B.C.D is the IP address. |
The following table defines parameters for the default-cost command.
|
Variable |
Value |
|---|---|
|
ethernet <1-65535> |
Configures the OSPF default metrics. The lower the metric, the more likely that OSPF chooses the link to route an OSPF packet. ethernet is for 10 Mb/s Ethernet (default is 100). |
|
fast-ethernet <1-65535> |
Configures the OSPF default metrics. The lower the metric, the more likely that OSPF chooses the link to route an OSPF packet. fast-ethernet is for 100 Mb/s (Fast) Ethernet (default is 10). |
|
forty-gig-ethernet <1-65535> |
Configures the OSPF default metrics. The lower the metric, the more likely that OSPF chooses the link to route an OSPF packet. forty-gig-ethernet is for 40 Gigabit Ethernet (default is 1). |
|
gig-ethernet <1-65535> |
Configures the OSPF default metrics. The lower the metric, the more likely that OSPF chooses the link to route an OSPF packet. gig-ethernet is for Gigabit Ethernet (default is 1). |
|
hundred-gig-ethernet <1-65535> |
Configures the OSPF default metrics. The lower the metric, the more likely that OSPF chooses the link to route an OSPF packet. hundred-gig-ethernet is for 100 Gigabit Ethernet (default is 1). |
|
ten-gig-ethernet <1-65535> |
Configures the OSPF default metrics. The lower the metric, the more likely that OSPF chooses the link to route an OSPF packet. ten-gig-ethernet is for 10 Gigabit Ethernet (default is 1). |
|
twentyfive-gig-ethernet <1-65535> |
Configures the OSPF default metrics. The lower the metric, the more likely that OSPF chooses the link to route an OSPF packet. On a channelized 100 Gbps port, the default-cost for each 25 Gbps channel is 1. |
|
vlan <1-65535> |
Configures the OSPF default metrics. vlan is for Vlan interfaces (default is 10). |
The following table defines parameters for the timers basic holddown command.
|
Variable |
Value |
|---|---|
|
<3-60> |
Configures the OSPF hold-down timer value in seconds. The default is 10. |
The following table defines parameters for the show ip ospf command.
|
Variable |
Value |
|---|---|
|
vrf WORD<1-16> |
Specifies a VRF by name. |
|
vrfids WORD<0-512> |
Specifies a range of VRF IDs. |
