Static Routing

Overview

Static routing is a form of routing that occurs when a router uses a manually-configured routing entry, rather than information from dynamic routing traffic. In many cases, static routes are manually configured by a network administrator by adding entries into a routing table, though this may not always be the case. Unlike dynamic routing, static routes are fixed and do not change if the network is changed or reconfigured. Static routing and dynamic routing are not mutually exclusive. Both dynamic routing and static routing are usually used on a router to maximize routing efficiency and to provide backups in the event that dynamic routing information fails to be exchanged. Static routing can also be used in stub networks, or to provide a gateway of last resort.

Static routing may have the following uses:

  • Static routing can be used to define an exit point from a router when no other routes are available or necessary. This is called a default route.
  • Static routing can be used for small networks that require only one or two routes. This is often more efficient since a link is not being wasted by exchanging dynamic routing information.
  • Static routing is often used as a complement to dynamic routing to provide a failsafe backup in the event that a dynamic route is unavailable.
  • Static routing is often used to help transfer routing information from one routing protocol to another (routing redistribution).

The RansNet Gateway Routing UI facilitates users to configure Static Route based on your topology.

NOTE

Static Route – Is a process in which we have to manually add routes in the routing table.

Static Routing

User can configure a static route by clicking on ‘ tab > Routing ‘ menu and click on button, Refer to Image 2 .

Image 1: SD-WAN Gateway Static Route UI

Image 2: SD-WAN Gateway Add Static Route UI

The fields of the Static Routes List are explained below:

S/NFieldsDescription
01.IPv4/6 Route Destination (Network/Prefix)The destination route is a manually-configured route entry that determines the next routing hop based on the destination IP address.
02.IPv4/6 Nexthop IP/InterfaceA next-hop IP is the IP address of an adjacent router or device
03. Other OptionsIPv4 Administrative Distance – This value is used in routers to rank routes from most preferred (low AD value) to least preferred (high AD value).
IPv4 Track Host /Interval – The track-host is used to check the availability of an IP(Internet)
IPv4 Static Route Description
This is to add a note to the route for reference.
Table 1 : The Fields of Static Routes List

New Static Route Interface

To create a new static route, click on the button as in Image 1.

Image 2 : Popup Window to add Static Route

Settings of Static Route

The New/Edit Static Route UI has two Destination Options, namely ‘Default Gateway‘ and ‘Network/Netmask‘.

S/NFieldsOptionsDescription
01.Destination
Default GatewayThis option has 1 required field:
01. Default Gateway IP: The Nexthop IP address.
Network/NetmaskThis option has 2 required and 2 optional fields:
01. Route Destination: The next routing hop is based on the destination IP address
02. Nexthop: Next hop is the next gateway interface to which packets should be forwarded.
03. Administrative Distance (Optional): The value of the distance of the router (Selects the best path when there are two or more different routes to the same destination)  Administrative distance defines the reliability of a routing
04. Remarks (Optional): User’s input as a caption
Table 2 : Settings of Static Route

Understand The Fundamentals

For a router (in this case CMG/HSG/HSA/UA) to forward a packet to its destination

  • First, it will check if there’s a match in its routing table for the destination IP
    • if there is no match (eg. no specific route, no default route), the packet is dropped;
    • if there is a match (eg. either through a specific route learn from static/OSPF/BGP, or at least have a default route 0.0.0.0/0), then move to the next step
  • Next, it will determine the exit interface.
    • If the nexthop is configured as an IP address, it will do a local lookup (check connected routes) to auto determine the exit interface;
    • If the next nexthop is configured as an exit interface, then it’s directly determined.
  • Finally, the router must check the exit interface type and decide how to forward out the packet.
    • if the exit interface is an Ethernet/multipoint link,
      1. if the nexthop is configured as an IP address, it will do an ARP request to determine the nexthop router MAC address and “wrap” the packet into a Layer-2 frame using its exit interface MAC as the source and nexthop router MAC as the destination, and successfully forward out the frame.
      2. if the nexthop is configured as an exit interface, the router will assume the destination host is directly connected/attached to the exit interface and try to do an ARP request for the destination IP directly (instead of ARP for nexthop router IP, as in #1), then the ARP request will fail because no one will reply to the ARP request (the actual destination host is in a distant network). Therefore this will end up in reachability failure.
  • If the exit interface is a point-to-point link (eg. PPPoE or LTE), the router only expects one host/router next to it, and will always forward all packets to the next router, therefore, we can configure nexthop as either IP address or exit interface. Both will work.

SUMMARY PROCEDURE

enable
configure
ip route [destination ip] nexthop [ip address/interface]

If the uplink is Ethernet/multipoint interface, we must configure IP address as nexthop, eg.

!
ip route 0.0.0.0/0 nexthop 192.168.1.1
ip route 0.0.0.0/0 nexthop eth1
!

If the uplink is point-to-point interface (PPPoE or 3g-lte0/1), we can configure either IP or exit interface as nexthop, but for simplicity we usually just use exit interface (so that we can save the trouble of having to find out the nexthop IP address), eg.

!
ip route 0.0.0.0/0 nexthop eth1
ip route 0.0.0.0/0 nexthop ppp0
ip route 0.0.0.0/0 nexthop 3g-lteX (X - LTE interface number)
!

Policy-Based Routes

See Policy-Based Routing (PBR) link

User can configure PBR in the Policy-Based Routes section of the Routing UI to configure details.

Track-host

The “track-host” option is typically used for determining the primary Static route or PBR route, by pinging the tracked host IP in a configurable tracking interval. Typically the tracked host is an upstream IP address (eg. ISP router IP or a known stable Internet IP, eg: 8.8.4.4).

If the tracking fails, it means upstream is unreachable via this path, the router will remove this route, so that it will failover to a secondary route (eg. backup connection). Once the tracking succeeds again, it will add back the route so the connection will fall back to the primary route.

!
ip route 0.0.0.0/0 nexthop 10.30.8.1 track-host 8.8.4.4 3 max 50 10 preempt-delay 300 backup wwan0
ip route 0.0.0.0/0 nexthop wwan0 distance 200 track-host 1.1.1.1 60 max 200 50
!

Using the above config as an example:

  1. The default primary path is via 10.30.8.1 (fixed line), and it tracks 8.8.4.4 at 3s interval, with maximum allowable latency of 50ms at 10% packet loss.
  1. The default secondary patch is via wwan0 (4G), which is configured with a higher admin distance (200), and it tracks 1.1.1.1 at 60s intervals, with maximum allowable latency of 200ms at 50% packet loss therefore it’s less preferred (backup) when the primary is active.
  • If tracking to 8.8.4.4 fails or latency is higher than the 50ms or packet loss is more than 10% (either due to cable failure or upstream link quality issues), whichever condition triggers first, the router will withdraw the primary route and the backup route will become active, eg. all connection will failover to 4G; if tracking to 8.8.4.4 succeeds/recovers, it will add back the primary route and traffic will fall back to the primary path again (via 10.30.8.1).
  • The “preempt delay” timer is an optional setting to delay fallback, eg. waits for up to the configured timer (in seconds) before it adds back the primary route, to prevent flapping situations for the primary path. Note this timer will count from the latest recovery. eg. if tracking fails again within the delay timer window, the fallback will happen from the last recovery.
  • The “backup” is another optional setting to prevent undesirable failover, When a WAN/primary failover connection is met (eg. WAN link failure, or especially high latency on WAN), we want to make sure the 4G/5G connection is stable before failing over to 4G. The objective is to avoid failing over to another bad backup connection when the primary is degraded but still usable.

For example:

Stable fallback scenario: (fail…recover) + 5 mins –> fallback to primary
Flapping fallback scenario (x is less than 5 mins): (fail…recover) + 2 mins + (fail….recover) + x mins + (fail_n….recover_n) + 5 mins —> fallback to primary

wpChatIcon