Static routing: Difference between revisions

Content deleted Content added
m Disambiguating links to Template engine (link changed to Template processor) using DisamAssist.
m fixed lint errors – stripped tags
 
(3 intermediate revisions by 3 users not shown)
Line 1:
{{Short description|Use of fixed routes for routing in networks}}
 
'''Static routing''' describes a process by which [[routing]] is configured with fixed values that do not change at runtime unless manually edited. Static routes are used with and without dynamic [[Routingrouting protocol]]s and usually share the same [[routing table]] as those protocols.<ref>[http://www.redbooks.ibm.com/redbooks/pdfs/gg243376.pdf TCP/IP Tutorial and Technical Overview (IBM RedBooks Series)]</ref> Routes require at least two attributes; the destination and the gateway, but may contain additional attributes such as a [[Metrics (networking)|metric]] (sometimes called the ''administrative distance''). Some implementations treat the network address and [[subnet mask]] as separate values, however in practice both of the values have to be considered for any given routing decision to determine the [[longest prefix match]]. Static routes together with ''connected'' routes and routes from configuration protocols such as [[DHCP]] or [[Neighbor Discovery Protocol|Router Advertisements]] provide the routes which are then redistributed using dynamic routing protocols.<ref>{{Cite web |title=ESPCommunity |url=https://enterprise-support.nvidia.com/s/article/howto-configure-bgp-on-mellanox-switches |access-date=2024-12-18 |website=enterprise-support.nvidia.com}}</ref> While static routes are entered into the system and remain there until removed or changed manually, dynamic routing protocols create and delete routes dynamically at runtime without intervention. Thus the term ''static'' here refers to the nature of remaining unchanged by the system itself. The most prominent example of a static route is a [[default route]] which is often used on devices with a statically configured [[IP address]] to provide the device with access to the rest of the network or the internet by default.<ref>{{Cite web |title=Static Routing {{!}} Cumulus Linux 5.11 |url=https://docs.nvidia.com/networking-ethernet-software/cumulus-linux-511/Layer-3/Routing/Static-Routing/#configure-a-gateway-or-default-route |access-date=2024-12-18 |website=docs.nvidia.com}}</ref> In contrast to a so called ''connected'' route which is automatically generated upon address assignment based on the used subnet mask, a static route must be manually configured. Due to this the configuration may fail if there is no route to the provided gateway at the time of configuration, other than the connected route which will always succeed as it does not require a gateway. The gateway of a static route need not be an address, but can also specify an interface in most implementations.
 
== Uses ==
Static routing may have the following uses:
* When using static address configuration (in the absence of DHCP or Router Advertisements) it can be used to provide a [[default route]], forming a special case of the longest prefix match as it has a prefix length of zero and therefore always matches, and always matches last.
* In small networks it is a viable method for providing alternative routes to direct traffic when multiple routers exist. This is a simple but limited form of [[Teletrafficteletraffic engineering]].
* Static routing has applications in environments with many routes with infrequent changes as it reduces the delay it would take to synchronize the routes from another device.
* On heavily resource constrained devices where routing protocols may not be viable due to lack of computation power, static routes may be used instead.
Line 50:
 
The administrative distance can be manually (re)configured so that the static route can be configured as a backup route, to be used only if the dynamic route is unavailable.<ref name=distance>{{Cite web |title=Describe Administrative Distance |url=https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/15986-admin-distance.html |access-date=2014-06-12 |website=Cisco |language=en}}</ref>
 
 
<syntaxhighlight lang="console">(config)# ip route 10.10.20.0 255.255.255.0 exampleRoute 1 254</syntaxhighlight>
Line 58 ⟶ 57:
== See also ==
{{div col|colwidth=20em}}
* [[Routing]]
* [[Dynamic routing]]
* [[Routing protocol]]
* [[Routing table]]
* [[routerRouter (computing)|Router]]
* [[Route (disambiguation)|Route]]
* [[Routing#Path selection|Metrics]]
{{div col end}}