Administrator Guide

Layer 2 Switching Commands 505
A domain name. The DNS client stores each domain name in its domain
name list.
Examples
To enable DHCPv4 on vlan 2:
console#config
console(config)#interface vlan 2
console(config-if-vlan2)#ip address dhcp
ip default-gateway
Use the ip default-gateway command to configure a default gateway (router).
Syntax
ip default-gateway
ip-address
no ip default-gateway
ip-address
ip-address
—Valid IPv4 address of an attached router.
Default Configuration
No default gateway is defined.
Command Mode
Global Configuration mode, Virtual Router Configuration mode
User Guidelines
When the system does not have a more specific route to a packet’s
destination, it sends the packet to the default gateway. The system installs a
default IPv4 route with the gateway address as the next hop address. The
route preference is 253. A default gateway configured with this command is
more preferred than a default gateway learned from a DHCP server, which has
a route preference of 254. It is less preferred than a static route configured via
the
ip route
command, which has a route preference of 1. Use the
show ip
route
command to display the active default gateway.
2CSNXXX_SWUM204.book Page 505 Monday, January 25, 2016 1:25 PM