Cisco Certified Network Associate (CCNA) Practice Exam

Disable ads (and more) with a membership for a one time $2.99 payment

Prepare for the CCNA Exam with detailed questions and thorough study materials. Each question is accompanied by hints and explanations to facilitate your learning process. Get ready to ace the CCNA Exam!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


What command is used to configure a default gateway on a switch?

  1. (config)#ip default-gateway IP ADDRESS

  2. (config)#ip address IP ADDRESS

  3. (config)#set gateway IP ADDRESS

  4. (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.