When you configure a tunnel interface on a vEdge router, a number of services are enabled by default on that interface, including DHCP.
A vEdge router can act as a DHCP server for the service-side network to which it is connected, and it can also act as a DHCP helper, forwarding requests for IP addresses from devices in the service-side network to a DHCP server that is in a different subnet on the service side of the vEdge router.
Enable DHCP on the WAN Interface
On a vEdge router's WAN interface—the interface configured as a tunnel interface in VPN 0, the transport VPN—DHCP is enabled by default. You can see this by using the details filter with the show running-config command. This command also shows that the DNS and ICMP services are enabled by default.
vm1# show running-config vpn 0 interface ge0/2 tunnel-interface | details vpn 0 interface ge0/2 tunnel-interface encapsulation ipsec weight 1 color lte control-connections carrier default no allow-service all no allow-service bgp allow-service dhcp allow-service dns allow-service icmp no allow-service ospf no allow-service sshd no allow-service ntp no allow-service stun ! ! !
Enabling DHCP on the router's WAN interface allows the device that actually connects the router to the transport network (such as a DSL router) to dynamically assign a DHCP address to the vEdge router. The DHCP service in VPN 0 affects the transport-side network.
Have a vEdge Router Be a DHCP Server
One or more service-side interfaces on vEdge router can act as a DHCP server, assigning IP addresses to hosts in the service-side network. To do this, configure this function on the interface that connects the vEdge router to the local site's network. At a minimum, you must configure the pool of IP addresses available for assigning to hosts:
vEdge(config-vpn)# interface geslot/port dhcp-server address-pool ip-address/prefix vEdge(config-dhcp-server)#
You can exclude IP addresses that fall within the range of the DHCP address pool:
vEdge(config-dhcp-server)# exclude ip-address
To specify multiple individual addresses, list them in a single exclude command, separated by a space (for example, exclude 184.108.40.206 220.127.116.11 18.104.22.168). To specify a range of addresses, separate them with a hyphen (for example, exclude 22.214.171.124-126.96.36.199).
You can also statically assign IP addresses to a host:
vEdge(config-dhcp-server)# static-lease mac-address ip ip-address
By default, the DHCP server on a single interface can assign 254 DHCP leases, and each lease is valid for 24 hours. The offer of an IP address is valid indefinitely, until that DHCP server runs out of addresses to offer. You can modify these values:
vEdge(config-dhcp-server)# max-leases number vEdge(config-dhcp-server)# lease-time seconds vEdge(config-dhcp-server)# offer-time seconds
These values can range from 0 through (232 – 1).
The Viptela software supports DHCP server options that allow you to configure the IP addresses of a default gateway, DNS server, and TFTP server in the service-side network and the network mask of the service-side network:
vEdge(config-dhcp-server)# options default-gateway ip-address vEdge(config-dhcp-server)# options dns-servers ip-address vEdge(config-dhcp-server)# options domain-name domain-name vEdge(config-dhcp-server)# options interface-mtu mtu vEdge(config-dhcp-server)# options tftp-servers ip-address
Have a vEdge Router Be a DHCP Helper
One or more service-side interfaces on a vEdge router can be a DHCP helper. With this configuration, the interface forwards any broadcast BOOTP DHCP requests that it receives from hosts on the service-side network to the DHCP server or servers specified by the configured IP helper address (or addresses) and returns the assigned IP address to the requester.
When the DHCP server at the vEdge router's local site is on a different segment than the devices connected to the vEdge router or than the vEdge router itself. When configured as a DHCP helper, the vEdge interface forwards any broadcast BOOTP DHCP requests that it receives to the DHCP server specified by the configured IP helper address.
To configure an interface as a DHCP helper, configure the IP address of the DHCP server on the interface that connects to the local site's network:
vEdge(config-vpn)# interface geslot/port dhcp-helper ip-address
You can configure up to four IP addresses, and you must enter the addresses in a single dhcp-helper command.
In Releases 17.2.2 and later, you can configure up to eight IP address. You must enter all the addresses in a single dhcp-helper command.