Introduction
This document describes how to configure and verify Administrative Distance (AD) on default routes received via DHCP.
Prerequisites
Requirements
Cisco recommends that you have knowledge of these topics:
- Cisco Software-defined Wide Area Network (SD-WAN)
- Templates.
Components Used
The information in this document is based on these software and hardware versions:
- SD-WAN Controllers (20.9.4.1)
- Cisco Edge Router (17.09.04)
The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, ensure that you understand the potential impact of any command.
Scenario
In some setups, an SD-WAN edge might be connected to multiple transports where one is using DHCP to learn its IP address and default gateway and another is configured with a static IP using either a static route or a routing protocol to learn a default route.
This becomes a problem due to different administrative distances(AD). The default AD for a DHCP-learned default route is 254, versus 1 for a static route or 20 for an external BGP route. Because the other route has a better AD, the DHCP route is not installed in the routing table and control is not built across that path.
This can be mitigated by configuring the same AD for the DHCP-learned route.
Configure
Method 1: Change AD in the VPN
Configuration via Feature Template
Navigate to Feature template Cisco VPN > IPv4 Route > New IPv4 Route > Prefix . Add the prefix 0.0.0.0/0
Click Add a Next Hop > Under the address field specify DHCP . Change Distance field to the desired value.
Enter the values and click onsave.
Configuration via CLI
Configure default route in the device under configuration mode.
cEdge# config-transaction
cEdge(config)# ip route 0.0.0.0 0.0.0.0 dhcp 20
cEdge(config)# commit
Note: NOTE: To configure via CLI the routes must not have a template attached to it. To verify this run: show sdwan system status.
Method 2: Change AD in the Interface
Configuration via Feature Template
Navigate to Feature templates > Add Template > Cisco VPN Interface Ethernet > Basic Configuration > IPv4 . Click in Dynamic > DHCP Distance
Change DHCP Distance to the desired value.
Click on save template.
Navigate to Feature template Cisco VPN> IPv4 Route > New IPv4 Route > Prefix . Add the prefix 0.0.0.0/0 . Modify the entry for 0.0.0.0/0 > Add a Next Hop . Under the address field specify DHCP.
Configuration via CLI
To change the default DHCP Administrative Distance, use the ip dhcp client default-router distancecommand in interface configuration:
cEdge# config-transaction
cEdge(config)# interface GigabitEthernet1
cEdge(config-if)# ip dhcp client default-router distance 20
cEdge(config-if)# commit
Note: Using this method, it is not necessary to change the AD on the default route, since is configured on the VPN Interface Ethernet Feature Template.
For the configuration to take effect, the device needs to make a new discovery or when Discover-Offer-Request-Ack (DORA) cycle happens again.
The process to acquire another IP via DHCP DORA can be forced via one of these methods.
1. When the interface is cleared the hardware logic resets on the specific interface.
cEdge#clear interface GigabitEthernet1
2. Release DHCP lease.
Command triggers the immediate termination of the DHCP lease on the designated interface. Once the IP address is removed and is no longer associated with the interface, execute the command renew dhcp GigabitEthernet1 to facilitate a renewal of the DHCP lease.
cEdge#release dhcp GigabitEthernet1
cEdge#renew dhcp GigabitEthernet1
Note: When both Cisco VPN Feature Template and the Cisco VPN Interface Ethernet Feature Template have the Administrative Distance set, the configured preference on the Cisco VPN Feature Template takes precedence.
Verify
To verify that the configured DHCP AD works correctly, execute the command provided and focus on the distance value for the IP route.
cEdge#show ip route 0.0.0.0
Routing entry for 0.0.0.0/0, supernet
Known via "static", distance 20, metric 0, candidate default path
Routing Descriptor Blocks:
* 192.168.32.1
Route metric is 0, traffic share count is 1
Related documentation.