bandwidth [kbps]
Sets the bandwidth value (in kbps) on an interface for routing protocol metric calculations and QoS, overriding the default detected bandwidth.
Definition: bandwidth [kbps] is a Cisco IOS interface config command. Sets the bandwidth value (in kbps) on an interface for routing protocol metric calculations and QoS, overriding the default detected bandwidth.
Overview
The `bandwidth` command is a fundamental interface configuration command in Cisco IOS that allows a network engineer to manually set the bandwidth value (in kilobits per second) on an interface. This value is used by routing protocols (such as OSPF, EIGRP, and IS-IS) for metric calculations, and by QoS mechanisms for bandwidth-based queuing and shaping. By default, Cisco routers automatically detect the bandwidth of physical interfaces (e.g., 100 Mbps for FastEthernet, 1 Gbps for GigabitEthernet), but this detected value may not reflect the actual available bandwidth due to carrier-imposed rate limits, oversubscription, or administrative policy.
For example, a GigabitEthernet link might be provisioned at only 100 Mbps by the service provider; without adjusting the bandwidth, routing protocols would assume 1 Gbps, leading to suboptimal path selection. The `bandwidth` command overrides the default detected bandwidth, influencing routing metrics and QoS behavior. It is important to note that this command does not affect the actual physical speed of the interface; it only changes the value used for calculations.
The command is entered in interface configuration mode and takes effect immediately, appearing in the running configuration. It requires privileged EXEC access (enable mode) to configure. The bandwidth value is stored in the running config and can be saved to startup config.
A common alternative is the `bandwidth inherit` command (used in some QoS contexts) or using the `ip ospf cost` command to directly set OSPF cost, but `bandwidth` remains the standard for EIGRP and OSPF metric tuning. In troubleshooting, checking the bandwidth setting is crucial when routing metrics seem inconsistent with link capacity. The command is available in all IOS versions and platforms, including IOS-XE, IOS-XR, and NX-OS (with slight syntax differences).
Understanding when and how to use this command is essential for CCNA and CCNP candidates, as it directly impacts routing protocol behavior and network performance.
bandwidth [kbps]When to Use This Command
- Adjusting OSPF or EIGRP cost on a serial link to influence path selection
- Simulating lower-speed link for testing routing protocol behavior
- Setting bandwidth on a tunnel interface to match the underlying path capacity
- Configuring QoS bandwidth parameters on an interface
Parameters
| Parameter | Syntax | Description |
|---|---|---|
| kbps | <1-10000000> | The bandwidth value in kilobits per second. Valid range is 1 to 10,000,000 kbps. Common values include 64 (DS0), 1544 (T1), 100000 (FastEthernet), 1000000 (GigabitEthernet). Setting a value that does not match the actual link speed can cause routing protocol metric miscalculations. A common mistake is forgetting to set the bandwidth on both ends of a link, leading to asymmetric metrics. |
Command Examples
Set bandwidth on a serial interface
Router(config-if)# bandwidth 128Router(config-if)#
No output is displayed upon successful configuration. The command sets the interface bandwidth to 128 kbps.
Verify bandwidth setting with show interface
show interfaces serial 0/0/0Serial0/0/0 is up, line protocol is up
Hardware is HD64570
Internet address is 192.168.1.1/30
MTU 1500 bytes, BW 128 Kbit/sec, DLY 20000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation HDLC, loopback not set
Keepalive set (10 sec)
...The 'BW 128 Kbit/sec' line shows the configured bandwidth. This value is used by routing protocols (e.g., OSPF cost = 10^8 / BW) and QoS.
Understanding the Output
The 'bandwidth' command itself produces no output. To verify the setting, use 'show interfaces' or 'show ip ospf interface'. In 'show interfaces', look for 'BW' followed by the value in Kbit/sec.
This value affects OSPF cost (cost = reference bandwidth / interface bandwidth), EIGRP composite metric (bandwidth is a factor), and QoS bandwidth allocation. A common mistake is confusing bandwidth with actual link speed; this command only affects routing metrics and QoS, not the physical speed.
Configuration Scenarios
Adjust OSPF metric on a serial link with fractional T1
A branch office connects to headquarters via a serial link that is provisioned at 512 kbps, but the router's serial interface defaults to 1544 kbps (T1). OSPF uses the bandwidth to calculate cost (cost = reference bandwidth / bandwidth). The default cost would be too low, making this link appear more favorable than it actually is.
Topology
Branch_Router(Serial0/0/0)---512kbps---(Serial0/0/0)HQ_RouterSteps
- 1.Step 1: Enter privileged EXEC mode: enable
- 2.Step 2: Enter global configuration mode: configure terminal
- 3.Step 3: Enter interface configuration mode for the serial interface: interface serial0/0/0
- 4.Step 4: Set the bandwidth to 512 kbps: bandwidth 512
- 5.Step 5: Exit configuration mode: end
- 6.Step 6: Verify the setting: show interfaces serial0/0/0
! interface Serial0/0/0 bandwidth 512 !
Verify: Use 'show interfaces serial0/0/0' and look for 'BW 512 Kbit' in the output. Also use 'show ip ospf interface serial0/0/0' to see the OSPF cost (should be reference-bandwidth/512).
Watch out: If the reference bandwidth is not changed from the default (100 Mbps), the OSPF cost will be 100000/512 = 195 (rounded). Ensure the reference bandwidth is consistent across the OSPF domain.
Set bandwidth on a GigabitEthernet interface for EIGRP metric tuning
A network administrator wants to influence EIGRP path selection by artificially lowering the bandwidth on a backup link so that the primary link is preferred. EIGRP uses bandwidth and delay to compute metric. By reducing the bandwidth, the metric increases, making the link less preferred.
Topology
Core_Router(Gig0/0)---1Gbps---(Gig0/0)Primary_Router
Core_Router(Gig0/1)---1Gbps---(Gig0/0)Backup_RouterSteps
- 1.Step 1: Enter privileged EXEC mode: enable
- 2.Step 2: Enter global configuration mode: configure terminal
- 3.Step 3: Enter interface configuration mode for the backup link: interface gigabitethernet0/1
- 4.Step 4: Set bandwidth to 100000 kbps (100 Mbps): bandwidth 100000
- 5.Step 5: Exit configuration mode: end
- 6.Step 6: Verify EIGRP topology: show ip eigrp topology
! interface GigabitEthernet0/1 bandwidth 100000 !
Verify: Use 'show ip eigrp topology' to see the metric for routes learned via this interface. The metric should be higher compared to the primary link. Also use 'show interfaces gigabitethernet0/1' to confirm the bandwidth setting.
Watch out: EIGRP also uses delay; if delay is not adjusted, the metric change may not be as expected. Also, ensure that the bandwidth command is applied on both routers on the same link for consistent metric calculation.
Troubleshooting with This Command
When troubleshooting routing issues, the `bandwidth` command is often overlooked but critical. A common symptom is suboptimal routing where a slower link is preferred over a faster one. This can happen if the bandwidth is set incorrectly or not set at all.
For example, if a serial interface defaults to 1544 kbps but the actual circuit is 256 kbps, OSPF will calculate a lower cost (higher preference) than intended. To diagnose, start by checking the interface bandwidth with `show interfaces`. Look for the 'BW' field; if it does not match the provisioned speed, the bandwidth needs adjustment.
Next, examine routing protocol metrics. For OSPF, use `show ip ospf interface` to see the cost; for EIGRP, use `show ip eigrp topology` to see the composite metric. Compare the metric values across paths.
If a link with lower actual speed has a lower metric, the bandwidth is likely too high. Another symptom is QoS misbehavior: if you have configured shaping or policing based on bandwidth, an incorrect bandwidth setting can cause under- or over-shaping. Use `show policy-map interface` to verify QoS statistics.
When troubleshooting, also check the `bandwidth` setting on both ends of the link; asymmetry can cause routing loops or suboptimal paths. Correlate with `show ip route` to see which path is installed. If the bandwidth is correct but metrics still seem off, check the OSPF reference bandwidth (`auto-cost reference-bandwidth`) or EIGRP K-values.
Remember that the `bandwidth` command does not affect the actual speed; it only affects calculations. If you suspect physical issues, use `show interfaces` for errors, CRC, or drops. A step-by-step diagnostic flow: 1) Identify the interface in question. 2) Verify the current bandwidth setting. 3) Compare with the provisioned bandwidth. 4) Check routing protocol metrics. 5) Adjust bandwidth if needed. 6) Verify the change took effect. 7) Monitor routing table for correct path selection.
In complex scenarios, use `debug ip routing` to see route changes, but use with caution in production. The `bandwidth` command is a powerful tool for influencing routing behavior without changing physical topology.
CCNA Exam Tips
CCNA exam tip: OSPF cost is calculated as 10^8 / bandwidth (in bps). Changing bandwidth changes cost and thus path selection.
CCNA exam tip: EIGRP uses bandwidth in its metric formula; a lower bandwidth increases the metric.
CCNA exam tip: The 'bandwidth' command does not change the actual line speed; it only affects routing protocol calculations.
CCNA exam tip: On Ethernet interfaces, default bandwidth is 10,000 kbps for FastEthernet and 1,000,000 kbps for GigabitEthernet.
Common Mistakes
Mistake 1: Setting bandwidth to a value higher than the actual link speed, causing routing protocols to prefer this link incorrectly.
Mistake 2: Forgetting that the bandwidth command is in kbps, not bps; e.g., setting 'bandwidth 1000000' for 1 Gbps instead of 'bandwidth 1000000' (which is correct for 1 Gbps = 1,000,000 kbps).
Mistake 3: Confusing 'bandwidth' with 'speed' command; speed sets the actual interface speed, while bandwidth only affects metrics and QoS.
bandwidth [kbps] vs show interfaces
Both commands involve the bandwidth parameter of an interface, but one configures it and the other displays it. They are often used together when tuning routing metrics or verifying interface settings.
| Aspect | bandwidth [kbps] | show interfaces |
|---|---|---|
| Scope | Affects routing protocol metrics and QoS calculations | Displays detailed Layer 1/2 statistics including bandwidth |
| Configuration mode | Interface configuration mode | Privileged EXEC mode |
| Persistence | Saved in running-config and startup-config | Output only; not saved in configuration |
| Precedence | Overrides automatically detected bandwidth | Shows the operational bandwidth value (configured or detected) |
| Typical use | Set bandwidth for metric tuning or QoS shaping | Verify interface status, bandwidth, and error counters |
Use bandwidth [kbps] when you need to influence routing protocol metrics or QoS settings on a link.
Use show interfaces when you need to verify the current interface status, including configured bandwidth, speed, and errors.
Platform Notes
In IOS-XE (e.g., Catalyst 9000 switches), the `bandwidth` command syntax is identical to classic IOS. However, on some switches, the bandwidth value may be used for different purposes (e.g., QoS trust boundaries). The output of `show interfaces` may display bandwidth in a slightly different format (e.g., 'BW 1000000 Kbit' vs 'BW 1000000 Kbps').
In NX-OS (e.g., Nexus switches), the equivalent command is `bandwidth` under interface configuration, but the range may differ (e.g., 1-400000000 kbps). Additionally, NX-OS uses the bandwidth for routing protocol metrics similarly, but there is also a `bandwidth inherit` command for QoS. On ASA firewalls, the `bandwidth` command is not available for routing metric purposes; instead, routing metrics are set via route maps or directly in the routing process.
In IOS-XR, the command is `bandwidth` under interface configuration, but the syntax is `bandwidth [kbps]` and the range is 1-4294967295. IOS-XR also supports `bandwidth` for QoS. There are no significant differences between IOS 12.x, 15.x, and 16.x for this command, though newer versions may support higher bandwidth values (e.g., 10000000 for 10 Gbps).
Always verify the supported range on your specific platform.
Related Commands
show interfaces
Displays detailed Layer 1 and Layer 2 statistics for all interfaces or a specific interface: line protocol state, hardware type, MAC address, MTU, bandwidth, duplex, speed, input/output rates, error counters, and queue statistics.
show ip eigrp topology
Displays the EIGRP topology table, showing all learned routes and their feasible successors, used to verify EIGRP convergence and path selection.
show ip ospf interface
Displays OSPF interface parameters and status, used to verify OSPF configuration and troubleshoot neighbor relationships.
Practice for the CCNA 200-301
Test your knowledge with practice questions covering all CCNA 200-301 exam domains.
Practice CCNA 200-301 Questions