Documentation
Name
net add link - add a link to the topology
Synopsis
link
[--bw=]
[--delay=]
[--depth=]
<addr-src> <addr-dst>
Arguments
- --bw=
- optional bandwidth
- --delay=
- optional link delay
- --depth=
- optional number of IGP weights
- addr-src
- address of source node
- addr-dst
- address of destination node
Description
This command adds a new link between two existing nodes whose identifiers are addr-src and addr-dst in the topology. The new link is bidirectional.
Link bandwidth and delay can be specified optionally using the following options --bw= and --delay=.
The option --depth specifies the number of different IGP weights that can be defined for this link. The default (without the option) is to support a single IGP weight. IGP weights are used to compute shortest-path routes. See commands net add domain and net domain compute for more details.
The following example shows how to add link between 2 nodes to create a simple topology:
net add node 1.0.0.1
With the above example, nodes 1.0.0.1 and 1.0.0.2 will both have 2 interfaces: one loopback interface and one rtr interface which correspond to the loopback of the linked node. This can be verified using command net node X show ifaces as show in the following example:
net add node 1.0.0.2
net add link 1.0.0.1 1.0.0.2
cbgp> net node 1.0.0.1 show ifaces
lo 1.0.0.1/32
rtr 1.0.0.2/32
This command can also be used to add a link between a node and a "subnet" (model of a LAN). To do this, the second node address (addr-dst) has a different meaning. It is the identifier of the target subnet combined with the address of the node's future interface on this subnet. This is specified in a prefix form. The address part is the interface address. The masked address and prefix length is the subnet identifier.
The following example show how to add a link between 2 nodes and a subnet. Nodes 1.0.0.1 and 1.0.0.2 will get new interfaces numbered 192.168.0.5 and 192.168.0.7 respectively.
net add node 1.0.0.1
In this case, nodes will also have 2 interfaces: one loopback interface and one ptmp interface:
net add node 1.0.0.2
net add subnet 192.168.0.0/16
net add link 1.0.0.1 192.168.0.5/16
net add link 1.0.0.2 192.168.0.7/16
cbgp> net node 1.0.0.1 show ifaces
lo 1.0.0.1/32
ptmp 192.168.0.5/16
See also
To create a subnet, use command net add subnet.
To add more detailled links (with specific interfaces and subnetting), see command net add link-ptp.