address-family ipv4 unicast
Activates IPv4 unicast address family configuration under a BGP neighbor, enabling the exchange of IPv4 unicast routes.
Overview
The 'address-family ipv4 unicast' command in Cisco IOS-XR is used within BGP neighbor configuration to enable the exchange of IPv4 unicast network layer reachability information (NLRI) with a specific BGP peer. BGP is a path-vector routing protocol that operates by exchanging routing information between autonomous systems (AS). In IOS-XR, BGP configuration is hierarchical: after defining the BGP process and a neighbor, you must explicitly activate the desired address family for that neighbor. Without this command, the neighbor will not exchange any IPv4 unicast routes, even if the BGP session is established. This command is essential for both enterprise and service provider networks where IPv4 unicast routing is the primary means of connectivity. It allows you to apply per-address-family policies, such as route-maps, prefix-lists, and soft-reconfiguration settings. In troubleshooting workflows, verifying that the address family is activated is a common step when routes are not being exchanged. IOS-XR also supports other address families like IPv6 unicast, VPNv4, and L2VPN, but IPv4 unicast remains the most fundamental.
address-family ipv4 unicastWhen to Use This Command
- Configuring a BGP neighbor to exchange IPv4 unicast routes in an enterprise network.
- Setting up route policies (e.g., route-maps, prefix-lists) for IPv4 unicast routes received from or advertised to a neighbor.
- Enabling IPv4 unicast address family for a BGP peer in a service provider MPLS VPN environment.
- Applying soft-reconfiguration inbound or outbound filtering for IPv4 unicast routes.
Parameters
| Parameter | Syntax | Description |
|---|---|---|
| ipv4 unicast | ipv4 unicast | Specifies the IPv4 unicast address family. This is the standard address family for IPv4 unicast routes. No additional parameters are needed. |
Command Examples
Basic IPv4 unicast activation with route policy
router bgp 65000
neighbor 192.0.2.1
address-family ipv4 unicast
route-policy PASS-ALL in
route-policy PASS-ALL outEnters BGP neighbor configuration for 192.0.2.1, then activates IPv4 unicast address family and applies route policies for inbound and outbound updates.
Activating IPv4 unicast with soft-reconfiguration
router bgp 65000
neighbor 198.51.100.1
address-family ipv4 unicast
soft-reconfiguration inbound alwaysEnables soft-reconfiguration inbound for the neighbor under IPv4 unicast address family, allowing local policy changes without resetting the session.
Understanding the Output
The command itself does not produce output; it enters a sub-configuration mode. Verification is done via 'show bgp neighbors <ip>', where you can see the address family state. Key fields include 'Address Family: IPv4 Unicast' and 'Session State: Established'. Healthy state shows 'Established' and route counts. Problem states show 'Idle' or 'Active'.
Configuration Scenarios
Basic BGP IPv4 unicast peering
Two routers in different ASes need to exchange IPv4 routes.
Topology
R1 (AS 65000) --- R2 (AS 65001)Steps
- 1.Configure BGP process on R1 with AS 65000.
- 2.Define neighbor R2 (192.0.2.2) with remote-as 65001.
- 3.Enter neighbor configuration and activate address-family ipv4 unicast.
- 4.Apply a route policy to filter routes if needed.
! On R1 router bgp 65000 neighbor 192.0.2.2 remote-as 65001 address-family ipv4 unicast route-policy PASS-ALL in route-policy PASS-ALL out
Verify: Use 'show bgp neighbors 192.0.2.2' to verify session state and address family activation.
Watch out: Ensure both peers have the address family activated; otherwise, routes won't be exchanged.
Troubleshooting with This Command
When troubleshooting BGP route exchange issues, the first step is to verify that the BGP session is established and that the address family is activated. Use 'show bgp neighbors <ip>' and look for 'Address Family: IPv4 Unicast' and 'Session State: Established'. If the session is up but no routes are received, check if the address family is activated on both sides. Common issues include missing 'address-family ipv4 unicast' under the neighbor, or applying route policies that deny all routes. Use 'show bgp neighbors <ip> received routes' to see what routes are being received. If the output is empty, the problem may be on the neighbor side. Also, verify that the neighbor is sending the routes with the correct next-hop and that there are no filtering policies. In IOS-XR, you can use 'debug bgp' commands cautiously to see update messages. Remember that soft-reconfiguration inbound can help avoid session resets when changing policies.
CCNA Exam Tips
Remember that 'address-family ipv4 unicast' is entered under neighbor configuration, not under router bgp global.
In CCNP exams, know that this command is required to exchange IPv4 routes with a neighbor; without it, no routes are exchanged.
Be aware that route policies are applied per address family, not globally.
Common Mistakes
Forgetting to enter address-family mode before applying route policies, causing the policy to be applied globally instead.
Applying address-family ipv4 unicast under router bgp global instead of neighbor configuration.
Not activating the address family on both peers, resulting in no route exchange.
Platform Notes
In Cisco IOS-XR, the 'address-family ipv4 unicast' command is entered under neighbor configuration, similar to IOS, but IOS-XR uses a hierarchical configuration style. Unlike IOS, IOS-XR requires explicit activation of address families; there is no default. In IOS, the 'neighbor <ip> activate' command under router bgp serves a similar purpose. IOS-XR also supports the 'address-family ipv4 unicast' under the BGP process for global settings, but for neighbor-specific activation, it must be under the neighbor. Equivalent commands on other platforms: Juniper uses 'family inet' under BGP group/neighbor; Arista uses 'address-family ipv4' under neighbor. Version differences: In older IOS-XR versions, the command syntax was similar, but newer versions have enhanced policy application.
Practice for the CCNA 200-301
Test your knowledge with hundreds of CCNA practice questions covering all exam domains.
Practice CCNA Questions