08-18-2013 08:11 PM
I am having a moment...where I am forgetting how they work.
ip route 10.10.10.15/24 10.10.20.25
Does this command make it so the ENTIRE subnet 10.10.10.0/24 is pointed at .25 or that only .15 is pointed at .25????
08-18-2013 09:05 PM
static routes are used to send traffic to a destination. in your case, you would need to input
ip route 10.10.10.0/24 10.10.20.25.
What this says, it that and traffic looking for a destination of 10.10.10.1 to 10.10.10.255 will be sent towards 10.10.20.25
This can be multiple hops away if the next routers also have a route to 10.10.20.25.
Hope this helps you out.
09-04-2013 06:03 AM
Though your post was a while ago, I thought I would still offer a reply.
When you are doing static routes, the netmask determines which octets (the IP address) the router looks for in order to forward to a specific "next-hop". In your example of "ip route 10.10.10.15/24 10.10.20.25" your netmask is technically incorrect. Should you be looking to route 1 specific IP address within a subnet you would want to route a /32
Thus you would state "ip route 10.10.10.15/32 10.10.20.25"
Regarding a /24 route, dlentine's response is partially correct. Rather the router will use the network address and broadcast address to determine traffic forwarding (*NOTE* this is an oversimplified and reduced explanation, but sufficient for a forum post) Therefore in the case of a /24 the network address is .0 and the broadcast is .255 and anything in between will get routed to the next-hop (in your case, the destination is 10.10.20.25)
We could then summarize a static route statment as:
"ip route destination_network_address destination_netmask next_hop"
Further, I feel I must also highlight that static routing is not fault tolerant. Statically routing infers that the network is not aware of its neighbours. Consequently, should something occur your network would not be able to adapt. Once you have gained a greater understanding of IP addressing (ipv4) i would highly recommend investigating dynamic routing protocols such as OSPF and iBGP.
I hope I provided some useful information for you.