Add a static route#
You will end up with a route in the router's forwarding table, and a page that shows you whether the router is using it.
Before you start#
- The operator role and a licence.
- The destination network, and a gateway on a network one of the router's interfaces is in — or the interface the route should leave by.
Step 1 — Add it#
- Network → Static routes → Add static route.
- Choose the Address family, and enter the Destination with its prefix length:
198.51.100.0/24. It has to be the network's own address; the form offers the right one if it is not. - Give it a Description if you like:
Lab. - Next hop 1: type Gateway, and the gateway's address,
192.0.2.254. Leave Interface at Any unless the gateway is an IPv6 link-local address, which needs the interface it is on. - Add route.
The type decides where traffic goes: Gateway to a router's address, Interface out of an interface with no gateway (a point-to-point tunnel, say), Discard nowhere, silently, and Reject nowhere, telling the sender. A discard route is the usual way to stop traffic for your own unused address space leaving by the default route.
Distance decides who wins when more than one source has a route to the same destination: lower wins, and 1 is a static route's default. Add a second next hop with a higher distance and it takes over only when the first cannot be used. That is also how a default route ranks an uplink — A second uplink with health-checked failover.
Step 2 — Apply it#
The Commit Bar lists Add static route 198.51.100.0/24 — Via 192.0.2.254, description “Lab”. Apply changes.
Check it worked#
On Network → Static routes, the route's row says Installed, and the forwarding table has the destination with source Static and the gateway as its next hop.
| Row says | Forwarding table has | Means |
|---|---|---|
| Installed | the route | It worked |
| Not installed | no static route to it in use | The gateway is not on a network any interface is in, the interface is down, or another source has a better route |
| (no row) | the route, from another source | Something else put it there: BGP or OSPF, a DHCP client, the failover daemon |
For traffic that still does not arrive, run a traceroute from the router on Diagnostics → Tools.
Changing or removing it#
Select the row: the same form, filled in. Save changes stages only what changed; Delete route, pressed twice, removes it.
See also#
- A second uplink with health-checked failover — a default route is a route with a rank
- Send one subnet out a chosen uplink — routes in an alternate table
- A BGP session, An OSPF area — routes somebody else tells you about
- Static routes