Static routing: Difference between revisions

Content deleted Content added
Benaryorg (talk | contribs)
first of all fix the command to actually be correct, second redo some of the links and clarify that the command is not iproute2 but ip, and also add that static route configuration is usually done using the network configuration software
Benaryorg (talk | contribs)
less Cisco marketing, fixed links, remove the second set of commands which did not match the text it followed (the gateway of a route is not usually referred to as the destination) which also has nothing to do with the one route that this section is supposed to set. I won't touch the rest of the section because while it is also irrelevant to the initial task, isn't particularly wrong (just badly explained)
Line 36:
 
=== Cisco ===
[[Cisco Systems|Cisco routers]] running the [[Cisco IOS]] operating system can be configured using the command line interface:<ref>{{Cite web |date=2013-02-02 |title=Cisco IOS IP Command Reference, Volume 2 of 4: Routing Protocols, Release 12.3 T - IP Routing Protocol Commands: ip policy route-map through is-type |url=https://web.archive.org/web/20130202041013/http://www.cisco.com/en/US/docs/ios/12_3t/ip_route/command/reference/ip2_i2gt.html#wp1106404 |access-date=2024-12-18 |website=web.archive.org}}</ref>
Enterprise-level [[Cisco Systems|Cisco routers]] are configurable using the Cisco IOS command line, rather than a web management interface.
 
<syntaxhighlight lang="console">
==== Add a static route ====
> enable
'''Router#''' configure terminal
'''Router(config)#''' ip route 10.10.20.0 255.255.255.0 192.168.100.1
</syntaxhighlight>
 
==== Configuring administrative distance ====
The commands to add a static route are as follows:<ref name="ip route">[http://www.cisco.com/en/US/docs/ios/12_3t/ip_route/command/reference/ip2_i2gt.html#wp1106404 ip route]</ref>
 
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>Cisco{{Cite Systemsweb (2013),|title=Describe Administrative [httpDistance |url=https://www.cisco.com/c/en/USus/techsupport/tk365docs/technologies_tech_note09186a0080094195ip/border-gateway-protocol-bgp/15986-admin-distance.shtml What is Administrative Distance?], retrievedhtml |access-date=2014-06-12 June|website=Cisco 2014|language=en}}</ref>
'''Router>''' enable
'''Router#''' configure terminal
'''Router(config)#''' ip route 10.10.20.0 255.255.255.0 192.168.100.1
 
Network configurations are not restricted to a single static route per destination:<ref name="ip route"/>
 
'''Router>''' enable
'''Router#''' configure terminal
'''Router(config)#''' ip route 197.164.73.0 255.255.255.0 197.164.72.2
'''Router(config)#''' ip route 197.164.74.0 255.255.255.0 197.164.72.2
 
==== Configuring administrative distance ====
 
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>Cisco Systems (2013), [http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094195.shtml What is Administrative Distance?], retrieved 12 June 2014</ref>
 
<codesyntaxhighlight lang="console">'''Router(config)#''' ip route 10.10.20.0 255.255.255.0 exampleRoute 1 254</codesyntaxhighlight>
 
Setting the administrative distance to 254 will result in the route being used only as a backup.