CategoryCisco

Cisco iOS routing

Making a static route on cisco iOS is rather easy!

With static routes you can tell your router (or any other network device) where to route the network traffic for a specified network to. This can be an Interface or IP address. The command looks like this:

iOS(config)# ip route <IP/network> <netmask> <gateway/interface>

So, if you know that network 10.10.0.0/16 is behind router 192.168.1.1 you’d do:

iOS(config)# ip route 10.10.0.0 255.255.0.0 192.168.1.1

If you want to add a default route, specify a 0.0.0.0/0 network:

iOS(config)# ip route 0.0.0.0 0.0.0.0 192.168.1.1

And, last but not least, use a exit interface: (192.168.1.2 is directly connected to FE1)

iOS(config)# ip route 192.168.1.2 255.255.255.255 FE1

And at the end, you probably want to have a look at what you’ve done:

iOS(config)# show ip route static

or more specific, “grep” for a route or gateway:

iOS(config)# show ip route static | inc 192.168.1.1

As inc stands for include, see this post.

grep in Cisco iOS

As an alternative to the grep command in Linux, use include in Cisco iOS.

Linux grep:

# ip route show | grep 192.168.

iOS include:

# show ip route static | include 192.168.

© 2017 netmess

Theme by Anders NorenUp ↑