Name
ip route — global
Synopsis
ip routenetworkmasknext-hop-address[distance] [permanent] no ip routenetworkmasknext-hop-address[distance] [permanent]
Configures
A static route for a network
Default
None
Description
This command defines a static route to the destination network
specified by its network address and
mask.
next-hop-address is the IP address of the
router to which traffic for this destination network should be sent.
distance is an optional administrative
distance that allows you change the way the static route behaves. If
the distance is high enough, it can be overwritten by dynamic
protocols. See Chapter 8 for more information
about administrative distances. The permanent
keyword tells the router to keep the route in the route table even if
the interface goes down. The router normally removes static routes
that are invalid because the interface is down.
Example
The following commands create two static routes. The first route sends traffic for the 192.168.1.0/24 network to 10.1.1.1; the second route sends traffic for the 192.168.2.0/24 network to 10.2.2.2.
ip route 192.168.1.0 255.255.255.0 10.1.1.1 ip route 192.168.2.0 255.255.255.0 10.2.2.2
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access