Disable ads (and more) with a membership for a one time $4.99 payment
What command is used to configure a default gateway on a switch?
(config)#ip default-gateway IP ADDRESS
(config)#ip address IP ADDRESS
(config)#set gateway IP ADDRESS
(config)#router default IP ADDRESS
The correct answer is: (config)#ip default-gateway IP ADDRESS
The command to configure a default gateway on a switch is indeed "ip default-gateway IP ADDRESS". This command allows the switch to communicate with devices outside its local subnet, such as routers and other switches, by providing a path for traffic that is destined for a different network. Switches operate primarily at Layer 2 (Data Link layer) of the OSI model, which means they do not have IP routing capabilities unless they are Layer 3 switches. The "ip default-gateway" command is essential for Layer 2 switches, enabling them to send traffic to the configured gateway when they encounter a destination outside their own network. This is critical in environments where switches are managing multiple VLANs or need to reach devices across different IP networks. The other options do not correctly set a default gateway on a switch. For instance, "ip address IP ADDRESS" is used for assigning an IP address to an interface, which is not relevant for configuring a default gateway. "set gateway IP ADDRESS" is not a recognized command in Cisco IOS for configuring a default gateway. Finally, "router default IP ADDRESS" is also not a valid configuration command for setting a default gateway on a switch.