interface [intf]
Configures OSPF interface parameters under the OSPF area configuration mode on Cisco IOS-XR.
Overview
The 'interface [intf]' command under OSPF area configuration mode on Cisco IOS-XR is used to enter the OSPF interface configuration submode for a specific interface. This allows you to customize OSPF parameters on a per-interface basis, such as cost, timers, authentication, and network type. OSPF (Open Shortest Path First) is a link-state routing protocol that uses hello packets to discover neighbors and maintain adjacencies. The interface configuration is critical for fine-tuning OSPF behavior to meet network requirements. On IOS-XR, the configuration hierarchy is strict: you must be in router ospf configuration mode, then area configuration mode, before you can configure an interface. This command is used when you need to adjust OSPF parameters for a specific link, such as setting a higher cost to influence path selection, reducing hello intervals for faster convergence, or enabling authentication for security. In troubleshooting workflows, you would use this command to verify or modify interface-specific settings that may be causing adjacency issues or suboptimal routing.
interface <interface-name>When to Use This Command
- Enabling OSPF on a specific interface within an area
- Adjusting OSPF cost or hello/dead intervals per interface
- Setting OSPF authentication on a per-interface basis
- Configuring OSPF network type (broadcast, point-to-point) on an interface
Parameters
| Parameter | Syntax | Description |
|---|---|---|
| interface-name | interface <interface-name> | The full interface name (e.g., GigabitEthernet0/0/0/0). This specifies which interface to configure OSPF parameters for. The interface must exist and be up/up. |
Command Examples
Enter OSPF interface configuration for GigabitEthernet0/0/0/0
interface GigabitEthernet0/0/0/0router ospf 100 area 0 interface GigabitEthernet0/0/0/0 cost 10 hello-interval 5 dead-interval 20 authentication message-digest message-digest-key 1 md5 cisco123 !
Enters interface configuration mode for GigabitEthernet0/0/0/0 under OSPF area 0. The subsequent lines set OSPF cost to 10, hello interval to 5 seconds, dead interval to 20 seconds, and enable MD5 authentication with key id 1.
Set OSPF network type to point-to-point
interface GigabitEthernet0/0/0/1router ospf 100 area 1 interface GigabitEthernet0/0/0/1 network point-to-point !
Configures the OSPF network type as point-to-point on GigabitEthernet0/0/0/1, which disables DR/BDR election and is suitable for links between two routers.
Understanding the Output
The output shown is a configuration snippet, not a show command output. When you enter 'interface <intf>' under OSPF area configuration, the prompt changes to indicate you are in OSPF interface configuration submode. From there, you can set various OSPF parameters. The key fields are: cost (metric for the interface), hello-interval (time between hello packets), dead-interval (time before neighbor is declared dead), authentication (type and key), and network type. Healthy values depend on the network design; typical hello intervals are 10 seconds for broadcast and 30 for non-broadcast, with dead intervals four times the hello. Problem values include mismatched intervals between neighbors (prevents adjacency) or missing authentication keys.
Configuration Scenarios
Configuring OSPF on a point-to-point link with custom timers
Two routers connected via a dedicated fiber link. Need faster convergence and authentication.
Topology
R1 --- R2
G0/0/0/0 G0/0/0/0Steps
- 1.Enter router ospf configuration: router ospf 100
- 2.Enter area 0: area 0
- 3.Enter interface: interface GigabitEthernet0/0/0/0
- 4.Set network type: network point-to-point
- 5.Set hello interval: hello-interval 5
- 6.Set dead interval: dead-interval 20
- 7.Enable authentication: authentication message-digest
- 8.Set key: message-digest-key 1 md5 cisco123
router ospf 100 area 0 interface GigabitEthernet0/0/0/0 network point-to-point hello-interval 5 dead-interval 20 authentication message-digest message-digest-key 1 md5 cisco123 !
Verify: Use 'show ospf interface GigabitEthernet0/0/0/0' to verify timers and authentication. Use 'show ospf neighbor' to confirm adjacency.
Watch out: Both routers must have matching hello/dead intervals and authentication parameters, otherwise adjacency will not form.
Troubleshooting with This Command
When troubleshooting OSPF adjacency issues on Cisco IOS-XR, the 'interface' command under area configuration is used to check and modify interface-specific parameters. Common problems include mismatched hello/dead intervals, authentication mismatches, or incorrect network types. To diagnose, first use 'show ospf interface <intf>' to display current settings. Look for mismatches between neighbors: if the hello interval is 10 on one side and 5 on the other, the routers will not become adjacent. Similarly, if one side has authentication enabled and the other does not, or if the keys differ, adjacency fails. Another issue is the network type: if one side is configured as broadcast and the other as point-to-point, they may still form an adjacency but DR/BDR election may behave unexpectedly. Use 'debug ospf hello' to see hello packet details and identify mismatches. To fix, enter the interface configuration mode under the appropriate area and adjust the parameters to match the neighbor. Remember that changes take effect immediately; no reload is needed. Also, ensure that the interface itself is up/up and has an IP address in the correct subnet for the OSPF area.
CCNA Exam Tips
Remember that OSPF interface configuration is done under the area, not globally; you must first enter router ospf, then area, then interface.
Know the default hello and dead intervals: 10/40 for broadcast and point-to-point, 30/120 for non-broadcast and point-to-multipoint.
Be aware that changing network type can affect DR/BDR election; point-to-point disables it.
Common Mistakes
Forgetting to enter the area configuration mode before the interface command; the interface must be under an area.
Configuring OSPF parameters on the wrong interface or with typos in the interface name.
Setting mismatched hello/dead intervals or authentication parameters between neighbors, causing adjacency failure.
Platform Notes
On Cisco IOS-XR, the OSPF interface configuration is done under the area, unlike classic IOS where it is under router ospf directly. This hierarchical structure is more strict. The command syntax is 'interface <intf>' under 'area <area-id>'. In IOS, you would use 'network <ip> <wildcard> area <area-id>' to enable OSPF on an interface, and then use 'interface <intf>' under router ospf for parameter changes. IOS-XR requires explicit interface configuration per area. Also, IOS-XR supports multiple OSPF instances and VRFs, so you must be in the correct VRF context if using non-default. Equivalent commands on other platforms: Juniper uses 'set protocols ospf area <area> interface <intf>', while Arista uses 'router ospf <process> interface <intf>'. Version differences: In earlier IOS-XR versions, the interface command might not support all parameters; always check the release notes. The 'cost' parameter can also be set dynamically via 'auto-cost reference-bandwidth'.
Practice for the CCNA 200-301
Test your knowledge with hundreds of CCNA practice questions covering all exam domains.
Practice CCNA Questions