Routing

ip default-gateway <ip>

Set the gateway on a non-routing device (L2 switch, endpoint).

Works on: SwitchMode: config
Run this command live

Don't just read it — type ip default-gateway <ip> in a real network simulator in your browser and watch it take effect. No install, no account needed to start.

Open the lab

Frequently asked

What does the "ip default-gateway <ip>" command do?

Set the gateway on a non-routing device (L2 switch, endpoint).

More Routing commands

← Back to the full command reference

ip default-gateway <ip> — network CLI command reference · NetForge-AI