Static routes

Standard routing

Once the IP addresses have been configured, communication is possible between the nodes (hosts or routers) directly connected to the same IP sub-network. It is a one hop communication. To communicate with other nodes that are connected to a different sub-network, a dedicated node, the router, requires routes. For example, you can define static IP routes to link sub-networks.

Static routes do not scale and are not error-free. They should be used only when dynamic routing protocols cannot be deployed, or in case of very simple topologies.

You can implement static routing by directly manipulating the equipment routing table. It may be used with any dynamic routing protocol. When both static and dynamic routes are set, the static ones are preferred because their administrative distance is 1.

To add a static route, do:

vrouter running config# vrf main
vrouter running vrf main# routing static
vrouter running static# ipv4-route 10.200.0.0/24 next-hop 10.125.0.2
vrouter running static# commit
Configuration applied.

To display the static routes state:

vrouter running config# show state vrf main routing static
static
    ipv4-route 10.200.0.0/24
        next-hop 10.125.0.2
        ..
    ..

To check the route is present in the system Routing Information Base:

vrouter running config# show state vrf main routing rib
rib
    ipv4-route 10.200.0.0/24
        next-hop 10.125.0.2
            selected true
            distance 1
            protocol static
            uptime 00:11:55
            interface ntfp2
            active true
            fib true
            ..
            [...]
        ..
    ..

To show the state in a human readable way:

vrouter running config# show ipv4-routes vrf main

K>* 0.0.0.0/0 [0/0] via 10.0.2.2, mgmt0, 00:02:00
C>* 10.0.2.0/24 is directly connected, mgmt0, 00:02:00
C>* 10.100.0.0/24 is directly connected, ntfp1, 00:02:00
C>* 10.125.0.0/24 is directly connected, ntfp2, 00:02:00
C>* 10.175.0.0/24 is directly connected, ntfp3, 00:02:00
S>* 10.200.0.0/24 [1/0] via 10.125.0.2, ntfp2, 00:02:00

The same configuration can be made using this NETCONF XML configuration:

vrouter running config# show config xml absolute vrf main routing static
<config xmlns="urn:6wind:vrouter">
  <vrf>
    <name>main</name>
    <routing xmlns="urn:6wind:vrouter/routing">
      <static>
        <ipv4-route>
          <destination>10.200.0.0/24</destination>
          <next-hop>
            <next-hop>10.125.0.2</next-hop>
          </next-hop>
        </ipv4-route>
      </static>
    </routing>
  </vrf>
</config>

See also

The command-reference for details.

Policy-Based Routing

Turbo Router supports multiple routing tables. By default, routes are set in the main table as explained above. For PBR, it is possible to specify the table to use using an identifier. See the Policy-Based Routing section for details.

To add a static route in a specific table, do:

vrouter running static# ipv4-route 10.200.0.0/24 next-hop 10.175.0.2 table 100
vrouter running static# commit
Configuration applied.

To show the state for a specific table:

vrouter running config# show config xml absolute vrf main routing static
vrouter running config# show ipv4-routes vrf main table 100

S>* 10.200.0.0/24 [1/0] via 10.175.0.2, ntfp3, 00:02:00

The matching NETCONF XML is as follows:

vrouter running config# show config xml absolute vrf main routing static
<config xmlns="urn:6wind:vrouter">
  <vrf>
    <name>main</name>
    <routing xmlns="urn:6wind:vrouter/routing">
      <static>
        <ipv4-route>
          <destination>10.200.0.0/24</destination>
          <next-hop>
            <next-hop>10.175.0.2</next-hop>
            <table>100</table>
          </next-hop>
        </ipv4-route>
      </static>
    </routing>
  </vrf>
</config>