Print Download PDF Send Feedback

Previous

Next

IPv4 Static Routes

A static route defines the destination and one or more paths (next hops) to get to that destination. You define static routes manually using the Gaia Portal, or the Gaia Clish set static-route command.

Static routes let you add paths to destinations that are unknown by dynamic routing protocols. You can define multiple paths (next hops) to a destination and define priorities for selecting a path. Static routes are also useful for defining the default route.

Static route definitions include these parameters:

Configuring IPv4 Static Routes - Gaia Portal

You can configure IPv4 static routes one at a time, or many routes at once.

Configuring One IPv4 Static Route at a Time

Step

Description

1

In the navigation tree, click Network Management > IPv4 Static Routes.

2

In the IPv4 Static Routes section, click Add.

The Add Destination Route window opens.

3

In the Destination field, enter the IPv4 address of destination host, or network.

4

In the Subnet mask field, enter the subnet mask.

5

In the Next Hop Type field, select one of these:

  • Normal - To accept and forward packets
  • Blackhole - To drop packets, without sending ICMP unreachable packet to the traffic source
  • Reject - To drop packets, and send ICMP unreachable packet to the traffic source

6

In the Rank field, leave the default value (60), or enter the relative rank of the IPv4 static route (an integer from 1 to 255).

This value specifies the rank for the configured route when there are overlapping routes from different protocols.

7

Select the Local Scope option, if needed.

Use this setting on a cluster member when the ClusterXL Virtual IPv4 address is in a different subnet than the IPv4 address of a physical interface. This lets the cluster member accept static routes on the subnet of the Cluster Virtual IPv4 address. To make sure that the scopelocal attribute is set correctly, run the cat /etc/routed.conf command. For more information, see sk92799.

8

In the Comment field, enter the applicable comment text (up to 100 characters).

9

Click Add Gateway and select one of these options:

  • Select IP Address to specify the next hop by its IPv4 address.

    In the IPv4 Address field, enter the IPv4 address of the next hop gateway.

    In the Priority field, either do not enter anything, or select an integer between 1 and 8.

    Click OK.

  • Select Network Interface to specify the next hop by the name of the local interface name that connects to it.

    In the Local Interface field, select an interface that connects to the next hop gateway.

    In the Priority field, either do not enter anything, or select an integer between 1 and 8.

    Click Ok.

Priority defines which gateway to select as the next hop when multiple gateways are configured. The lower the priority, the higher the preference - priority 1 means the highest preference, and priority 8 means the lowest preference. You can define two or more paths using the same priority to specify a backup path with equal priority. Gateways with no priority configured are preferred over gateways with priority configured.

10

If you defined a next hop gateway by IP Address, you can select the Ping option, if you need to monitor next hops for the IPv4 static route with the ping.

The Ping feature sends ICMP Echo Requests to verify that the nexthop for a static route is working. Only nexthop gateways, which are verified as working are included in the kernel forwarding table. When Ping is enabled, an IPv4 static route is added to the kernel forwarding table only after at least one gateway is reachable.

11

Click Save.

12

In the Advanced Options section, you can adjust the Ping behavior. If you changed the default settings, click Apply.

Configuring Many IPv4 Static Routes at Once

You can use the batch mode to configure multiple static routes in one step.

Note - This mode does not allow configuring static routes using a logical interface option.

Step

Description

1

In the navigation tree, click Network Management > IPv4 Static Routes.

2

In the Batch Mode section, click Add Multiple Static Routes.

3

In the Add Multiple Routes window, select the Next Hop Type:

  • Normal - To accept and forward packets
  • Blackhole - To drop packets, without sending ICMP unreachable packet
  • Reject - To drop packets, and send ICMP unreachable packet

4

Add the routes in the text box, using this syntax:

<Destination IPv4 Address>/<Mask Length> <IPv4 Address of Next Hop Gateway> ["<Comment>"]

Where:

  • <Destination IPv4 Address>/<Mask Length> - Specifies the IPv4 address of destination host or network using the CIDR notation (IPv4_Address/MaskLength).

    Example: 192.168.2.0/24

    You can use the default keyword instead of an IPv4 address when referring to the default route.

  • <IPv4 Address of Next Hop Gateway> - Specifies the IPv4 address of the next hop gateway
  • "<Comment>" - Optional. Free text comment for the static route.

    Write the text in double-quotes. Maximal length of the text string is 100 characters.

Example:

default 192.0.2.100 192.0.2.1 "Default Route"
192.0.2.200/24 192.0.2.18 "My Backup Route"

5

Click Apply.

The newly configured static routes show in the IPv4 Static Routes section.

Note - The text box shows entries that contain errors with messages at the top of the page.

6

Correct errors and reload the affected routes.

7

In the top right corner, click the Monitoring tab to make sure that the routes are configured correctly.

Configuring IPv4 Static Routes - Gaia Clish

Description

Configure, show and delete IPv4 static routes.

Note - There are no add commands for the static route feature.

Syntax

Important - After you add, configure, or delete features, run the save config command to save the settings permanently.

Parameters

Parameter

Description

default

Defines the default static IPv4 route.

<Destination IPv4 Address>

Specifies the IPv4 address of destination host or network using the CIDR notation (IPv4_Address/MaskLength).

Example: 192.168.2.0/24

You can use the default keyword instead of an IPv4 address when referring to the default route.

comment {"Text" | off}

Defines of removes the optional comment for the static route.

  • Write the text in double-quotes.
  • Text must be up to 100 characters.
  • This comment appears in the Gaia Portal and in the output of the show configuration command.

nexthop

Defines the next hop path, which can be a gateway, blackhole, or reject.

gateway

Specifies that this next hop accepts and sends packets to the specified destination.

blackhole

Specifies that this next hop drops packets, but does not send ICMP unreachable packet to the traffic source.

reject

Specifies that this next hop drops packets and sends ICMP unreachable packet to the traffic source.

address <IPv4 Address of Next Hop Gateway>

Specifies the IPv4 address of the next hop gateway.

logical <Name of Local Interface>

Identifies the next hop gateway by the name of the local interface that connects to it.

Use this option only if the next hop gateway has an unnumbered interface.

priority <Priority>

Defines which gateway to select as the next hop when multiple gateways are configured.

The lower the priority, the higher the preference - priority 1 means the highest preference, and priority 8 means the lowest preference.

You can define two or more paths using the same priority to specify a backup path with equal priority.

Gateways with no priority configured are preferred over gateways with priority configured.

nexthop ... on

Adds the specified next hop.

nexthop ... off

Deletes the specified next hop.

If you specify a next hop, only the specified path is deleted.

If no next hop is specified, the route and all related paths are deleted.

ping {on | off}

Enables (on) or disables (off) the ping of specified next hop gateways for IPv4 static routes.

The Ping feature sends ICMP Echo Requests to verify that the nexthop for a static route is working. Only nexthop gateways, which are verified as working are included in the kernel forwarding table.

When Ping is enabled, an IPv4 static route is added to the kernel forwarding table only after at least one gateway is reachable.

To adjust the ping behavior, run:
set ping count <value>
set ping interval <value>

rank <Rank>

Selects a route, if there are many routes to a destination that use different routing protocols.

The route with the lowest rank value is selected.

Use the rank keyword in place of the nexthop keyword with no other parameters.

Accepted values are: default (60), integer numbers from 0 to 255.

In addition, see this command: set protocol-rank protocol <Rank>

scopelocal {on | off}

Defines a static route with a link-local scope.

Use this setting on a cluster member, when the ClusterXL Virtual IPv4 address is in a different subnet than the IPv4 address of a physical interface. This lets the cluster member accept static routes on the subnet of the Cluster Virtual IPv4 address.

To make sure that the scopelocal attribute is set correctly, run the cat /etc/routed.conf command.
For more information, see sk92799.

Example

gaia> set static-route 192.0.2.0/24 nexthop gateway address 192.0.2.155 on

 

gaia> set static-route 192.0.2.0/24 nexthop gateway address 192.0.2.155 off

 

gaia> set static-route 192.0.2.0/24 nexthop gateway logical eth0 on

 

gaia> set static-route 192.0.2.0/24 off

 

gaia> set static-route 192.0.2.100/32 nexthop blackhole

 

gaia> set static-route 192.0.2.100/32 rank 2

 

gaia> show route static

Codes: C - Connected, S - Static, R - RIP, B - BGP,

O - OSPF IntraArea (IA - InterArea, E - External, N - NSSA)

A - Aggregate, K - Kernel Remnant, H - Hidden, P - Suppressed

 

S 0.0.0.0/0 via 192.168.3.1, eth0, cost 0, age 164115

S 192.0.2.100 is a blackhole route

S 192.0.2.240 is a reject route