Static routing
From Wikipedia, the free encyclopedia
Static routing describes a system that does not implement adaptive routing. In these systems, routes through a data network are described by fixed paths (statically). These routes are usually entered into the router by the system administrator. An entire network can be configured using static routes but this type of configuration is not fault tolerant. When there is a change in the network or a failure occurs between two statically defined nodes, traffic will not be rerouted. This means that anything that wishes to take an affected path will either have to wait for the failure to be repaired or the static route to be updated by the administrator before restarting its journey. Most requests will time out (ultimately failing) before these repairs can be made. There are, however, times when static routes make sense and can even improve the performance of a network. Some of these include stub networks and default routes.
Contents |
[edit] Static Routing
Static routing is the term used to refer to the manual method used to set up routing. An administrator enters routes into the router using configuration commands. This method has the advantage of being predictable, and simple to set up. It is easy to manage in small networks but does not scale well.
[edit] Advantages
- Easy to predict and understand in small networks
- Robust against certain kinds of pathological network problems such as routing convergence failure or external route spoofing
[edit] Disadvantages
- Requires extensive planning and has a high management overhead
- Does not dynamically adapt to network topology changes or equipment failures.
- Does not scale well in large networks.
[edit] Static Route Configuration (CISCO)
- Default Route
- Static Null Route
- Preferred Routes
- Backup Routes
- Static Load Balancing
[edit] Types of static routes
Default Route
A default route is often called the 'route of last resort'. It is the last route tried when all other routes fail because it has the fewest number of network bits matching and is therefore less specific. A default route is configured on a Cisco router with the following command: CISCO 'ip route' command:
ip route 0.0.0.0 0.0.0.0 <next hop|exit interface>
Static Null Route
A null route routes traffic to a non-existent interface, what is often called a 'bit bucket'. This traffic is effectively dropped as soon as it is received. A null route is useful for removing packets that cannot make it out of the network or to their destination, and decreases congestion caused by packets with no functional destination. During a denial of service attack, a Null route can temporarilly be used near the destination to drop all traffic generated by the attack. CISCO 'null route' command:
ip route <network> <mask> null0
Preferred Route
The route which has the greatest number of network bits matching the destination address is the preferred route to a destination. This is referred to as 'longest prefix match'.
ip route 202.148.224.0 255.255.255.128 e0
ip route 202.148.224.128 255.255.255.128 e1
In cases where redundancy is required, a second route can be placed on another physical path so that if the first route fails, the second route over the less preferred path(s) will be used. By using a second pair of routes. This method can help compensate for network failures. CISCO router commands:
SPECIFIC ROUTES #(used unless down)
ip route 202.148.224.0 255.255.255.128 e0
ip route 202.148.224.128 255.255.255.128 e1
Backup Routes (used when one of the specifics are down)
ip route 202.148.224.0 255.255.255.0 e0
ip route 202.148.224.0 255.255.255.0 e1
Static Load Balancing You can create load balancing without using a dynamic routing protocol. Most routers will perform load balancing automatically if several equal cost paths to a destination exist on multiple interfaces. To configure this using static routing, you need only create multiple static routes for more than one interface. This creates more than one equal cost path which will balance the load. CISCO router commands:
ip route 202.148.224.0 255.255.255.0 e0
ip route 202.148.224.0 255.255.255.0 e1
[edit] Static vs. Dynamic Routing
Static Static routing is not really a protocol, simply the process of manually entering routes into the routing table via a configuration file that is loaded when the routing device starts up. As an alternative, these routes can be entered by a network administrator who configures the routes. Since these routes don't change after they are configured (unless a human changes them) they are called 'static' routes. Static routing is the simplest form of routing, but it is a manual process and does not work well when the routing information has to be changed frequently or needs to be configured on a large number of routing devices (routers). Static routing also does not handle outages or down connections well because any route that is configured manually must be reconfigured manually to fix or repair any lost connectivity.
Dynamic Dynamic routing protocols are software applications that dynamically discover network destinations and how to get to them. A router will 'learn' routes to all directly connected networks first. It will then learn routes from other routers that run the same routing protocol. The router will then sort through its list of routes and select one or more 'best' routes for each network destination it knows or has learned. Dynamic protocols will then distribute this 'best route' information to other routers running the same routing protocol, thereby extending the information on what networks exist and can be reached. This gives dynamic routing protocols the ability to adapt to logical network topology changes, equipment failures or network outages 'on the fly'.
[edit] Example
[edit] Cisco IOS
conf t
ip route 10.10.20.0 255.255.255.0 192.168.100.1
or the default route 0.0.0.0 0.0.0.0 192.168.100.1 and when you using RIP to configure the router in rip mode
center# conf t
center(config)# router rip
center(config-router)# network 192.168.16.0
[edit] Windows XP
Default route can be only one in whole system and can be added only with the rest of IP configuration for each network interface. Additional static routes can be added by using command "route add target gateway", where:
- target - IP address or network, which to access
- gateway - IP address, through which to send packets to reach the target
In case of point to point networks (usually using ppp protocol (gprs, dialup)), the gateway address is local interface ip address.
In case of broadcast networks (usually ethernet or wifi), the gateway address is computer in network, through which to route packets to target.
Case of system with 2 interfaces (10.0.0.2/24 with gateway 10.0.0.1 and 10.50.20.21/24 with no gateway)(both are broadcast network). Here:
- all traffic destined to addresses 10.0.0.1-10.0.0.254 gets routed through interface 10.0.0.2
- all traffic destined to addresses 10.50.20.1-10.50.20.254 gets routed through interface 10.50.20.21
- all traffic destined to any address outside these 2 address ranges (10.0.0.1/24 and 10.50.20.1/24) gets routed through interface 10.0.0.2 and pointed to (layer 2 packets gets sent to) 10.0.0.1
If network 10.50.20.1/24 has a gateway (for example 10.50.20.254), which could forward packets to some addresses outside that network (10.50.20.1/24), it is left unused and all packets attempts to reach these addresses through 10.0.0.2-10.0.0.1
To make new static route to a single IP address (for example 10.100.0.11) through interface 10.50.20.21 use route command
"route add 10.100.0.11 10.50.20.254"
This will make system to send packets destined to address 10.100.0.11 not through default route (through interface 10.0.0.2 to gateway 10.0.0.1), but through interface 10.50.20.21 to gateway 10.50.20.254.
[edit] See also
[edit] References
http://www.netcordia.com/support/books/chap3-static-routes.asp
http://www.netcordia.com/support/books/chap3-figures.asp