Routing

ip route <network> <mask> <next-hop>

Add a static route. Supports next-hop IP or exit-interface, optional AD.

Works on: Router, FirewallMode: config

Example

R1(config)# ip route 10.0.0.0 255.255.255.0 192.168.1.2
Watch out

A next hop that isn't reachable yet is still accepted and kept in running-config, as on real gear — but the route stays out of 'show ip route' (and carries nothing) until the next hop resolves through a connected or another installed route.

Run this command live

Don't just read it — type ip route <network> <mask> <next-hop> 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 route <network> <mask> <next-hop>" command do?

Add a static route. Supports next-hop IP or exit-interface, optional AD.

What's the common gotcha with "ip route <network> <mask> <next-hop>"?

A next hop that isn't reachable yet is still accepted and kept in running-config, as on real gear — but the route stays out of 'show ip route' (and carries nothing) until the next hop resolves through a connected or another installed route.

Example of "ip route <network> <mask> <next-hop>"

R1(config)# ip route 10.0.0.0 255.255.255.0 192.168.1.2

More Routing commands

← Back to the full command reference

ip route <network> <mask> <next-hop> — network CLI command reference · NetForge-AI