Configuring a DHCPv4 server on a VRF

  • An enabled layer 3 interface.

  • A VRF.

  • An external TFTP server to host BOOTP image files (optional).

  • An external storage device installed and configured (optional).

  1. Assign the DHCPv4 server to a VRF with the command dhcp-server vrf. This switches to the DHCPv4 server configuration context.
  2. If you want the DHCPv4 server to be the sole authority for IP addresses on the VRF, enable authoritative mode with the command authoritative.
  3. Define an address pool for the VRF with the command pool. This switches to the DHCPv4 server pool context. Customize pool settings as follows:
    1. Define the range of addresses in the pool with the command range.
    2. Set the lease time for addresses in the pool with the command lease.
    3. Set the domain name for the pool with the command domain-name.
    4. Define up to four default routers with the command default-router.
    5. Define up to four DNS servers with the command dns-server.
    6. Create static bindings for specific addresses in the pool with the command static-bind.
    7. Configure custom DHCPv4 options for the pool with the command option.
    8. Configure NetBIOS support with the commands netbios-name-server and netbios-node-type.
    9. Configure BOOTP options with the command bootp.
    10. Exit the DHCPv4 server pool context with the command exit.
  4. Enable the DHCP server on the VRF with the command enable.
  5. Configure support for persistent external storage of DHCP settings with the command dhcp-server external-storage.
  6. View DHCPv4 server configuration settings with the command show dhcp-server all-vrfs.


This example creates the following configuration:

  • Configures the DHCPv4 server on VRF primary-vrf.
  • Enables authoritative mode.

  • Defines the pool primary-pool with the following settings:

    • Address range: to

    • Lease time: 12 hours.

    • Domain name:

    • Default routers: and

    • DNS servers: and

    • Static binding of for MAC address 24:be:05:24:75:73.

    • DHCP custom option 3 with IP address

  • Enables the DHCPv4 server.

switch(config)# dhcp-server vrf primary
switch(config-dhcp-server)# pool primary-pool
switch(config-dhcp-server-pool)# range
switch(config-dhcp-server-pool)# lease 12:00:00
switch(config-dhcp-server-pool)# domain-name
switch(config-dhcp-server-pool)# default-router ip
switch(config-dhcp-server-pool)# dns-server
switch(config-dhcp-server-pool)# static-bind ip mac 24:be:05:24:75:73
switch(config-dhcp-server-pool)# option 3 ip
switch(config-dhcp-server-pool)# exit
switch(config-dhcp-server)# enable