Static routes allow administrators to configure routes for specific hosts or networks manually as against learning dynamically using routing protocols like RIP, EIGRP and OSPF. Static routes basically tells the Cisco IOS of which next hop router or the exit interface on the local router that the traffic for a particular host or network needs to be passed to.
To add a Static Route in cisco ios based switches and routers the following is the command syntax. This command is run from the global configuration mode.
SYNTAX:
ciscorouter(config)# ip route <IP/Network> <NETMASK> <NEXT HOP ROUTER/Interface>
For example,
Add Static route to a host using an exit interface
ciscorouter(config)# ip route 192.168.2.10 255.255.255.255 serial0/0/0
Where 192.168.1.1 is the host & serial0/0/0 is the exit interface on the router
Add Static route to a Network using a next hop router
ciscorouter(config)# ip route 192.168.1.0 255.255.255.0 192.168.100.1
Where 192.168.1.0 is the network & 192.168.100.1 is the next hop router
Add a default Route in Cisco IOS
To Add a default route using a Gateway IP Address (called as Gateway of last resort) as a next hop router
ciscorouter(config)# ip route 0.0.0.0 0.0.0.0 10.10.10.10
If you want to use a local exit interface
ciscorouter(config)# ip route 0.0.0.0 0.0.0.0 serial0/0/1
This should help. To display the static routes on a switch or a router use the following show command
ciscorouter# show ip route static
To filter the output for a specific host or network
ciscorouter# show ip route static | include 10.10.10.100
S 10.10.10.100 [1/0] via 192.168.100.1
where the output is filtered to display only the static route for the host 10.10.10.100.
Thanks for the post i tried this a couple of times using the Cisco guidelines and it was messy, but this does the trick
you say above you can add a static pointing to an interface.
if you have a static route:-
>(config)# ip route 192.168.2.10 255.255.255.255 fa0/0
If this is an ethernet interface, what MAC destination address is used in the frame as the IP packet is output to that interface?
Hi,
I want to Add the route to Ethernet interface in my cisco 2509 router which has IOS 11.0. But it doesn’t help “ip route” command. in the help there is “ip source-route” command. is these commands are same or are there any other way to add routes.
Thanks.