LOGBOOK

HELP

1 / 458
time's up — finish this card
Other keys: showSpace: good1-4: rate0: skip5: flag
Topic Basic Router Configuration

Question

Why does a switch need a default gateway and how do you configure it?

Answer

A Layer 2 switch needs a default gateway only so its own management traffic (SSH/Telnet/HTTP) can reach an admin on another network; set it with the ip default-gateway ip-address global command.

Default Gateway on a Switch:

A Layer 2 switch needs a default gateway to be remotely managed from another network.

Why switches need a default gateway:

  • Switch management traffic (Telnet, SSH, HTTP) originates from the switch
  • Without a gateway, management is only possible from the local network
  • The switch SVI (VLAN interface) needs an IP for management

Configuration command:

Switch(config)# ip default-gateway ip-address

Example:

S1(config)# interface vlan 1
S1(config-if)# ip address 192.168.10.50 255.255.255.0
S1(config-if)# no shutdown
S1(config-if)# exit
S1(config)# ip default-gateway 192.168.10.1

Important distinction:

  • Routers do NOT use ip default-gateway - they use default routes (ip route 0.0.0.0 0.0.0.0 next-hop)
  • Switches use ip default-gateway for management traffic only

Go deeper:

Topological layout of described network
Topological layout of described network
Gargoyle888 · CC BY-SA 4.0 · Wikimedia Commons
or press any other key
Topic Network Layer

Question

What are the three types of routes in a router's routing table?

Answer

Directly connected (added automatically for active, addressed interfaces), remote (learned statically or dynamically), and the default route (used when nothing else matches).

The route types in a routing table

* Directly connected routes are automatic; remote routes are learned statically or dynamically; the default route catches everything else. *

Three types of routes in a routing table:

Route Type Description How Added
Directly Connected Networks attached to the router's interfaces Automatically added when interface is active with addressing
Remote Networks NOT directly attached to the router Learned manually (static) or dynamically (routing protocol)
Default Route Used when NO other route matches Forwards all unmatched traffic to a specific direction

Remote routes can be learned:

  • Statically - Administrator manually configures the route
  • Dynamically - Routing protocols (OSPF, EIGRP, etc.) share information between routers

Default route:

  • Often called the "gateway of last resort"
  • Represented as 0.0.0.0/0 in IPv4
  • Used when the destination doesn't match any specific route

Go deeper:

Route table showing internet BGP routes
Route table showing internet BGP routes
User:NAME · CC BY-SA 4.0 · Wikimedia Commons
or press any other key