Documentation

routedelindex

Name

net node route add -  add a static route to a node

Synopsis

add [--gw=] [--oif=] <prefix> <weight> 

Arguments

--gw=
optional gateway address
--oif=
optional outgoing interface
prefix
destination prefix
weight
weight associated with the route

Description

This command adds a static route towards a specific prefix to a node. The route can take different forms.

--oif
if --oif is specified, then the route will send messages towards the prefix through the specified outgoing interface.
--gw
if --gw is specified, then the route will send messages towards the prefix through the specified gateway. A second lookup is performed to find the outgoing interface for that gateway.
--oif and --gw
if both --oif and --gw are specified, then the route will send messages towards the prefix through the specified gateway. The gateway is reached through the specified outgoing interface.

The following example illustrates how to configure static routes in a simple topology composed of 3 nodes, one point-to-point link and a link through a subnet: net add node 1.0.0.1
net add node 1.0.0.2
net add node 1.0.0.3
net add subnet 192.168.0.0/24 transit
net add link 1.0.0.1 1.0.0.2
net add link 1.0.0.2 192.168.0.1/24
net add link 1.0.0.3 192.168.0.2/24

net node 1.0.0.1 route add --oif=1.0.0.2 1.0.0.2/32 1
net node 1.0.0.1 route add --oif=1.0.0.2 1.0.0.3/32 1

net node 1.0.0.2 route add --oif=1.0.0.1 1.0.0.1/32 1
net node 1.0.0.2 route add --oif=192.168.0.1 192.168.0.0/24 1
net node 1.0.0.2 route add --gw=192.168.0.2 1.0.0.3/32 1

net node 1.0.0.3 route add --oif=192.168.0.2 192.168.0.0/24 1
net node 1.0.0.3 route add --gw=192.168.0.1 1.0.0.1/32 1
net node 1.0.0.3 route add --gw=192.168.0.1 1.0.0.2/32 1

See also

To remove a static route, use command net node X route del.

To show existing routes, use command net node X show rt.

Another mean to obtain routing information is to rely on routing protocols. C-BGP contains two routing protocol models: an intradomain routing protocol (IGP) and an interdomain routing protocol (BGP). See command net domain compute to learn more about the IGP model configuration. See command bgp add router to learn more about the BGP model.