Interface RouteAddOptions

Route add options.

Hierarchy

  • RouteAddOptions

Properties

advmss?: number

The MSS ('Maximal Segment Size') to advertise to these destinations when establishing TCP connections.

If it is not given, Linux uses a default value calculated from the first hop device MTU.

(If the path to these destination is asymmetric, this guess may be wrong.)

as?: {
    address: string;
    to?: true;
}

XXX

Type declaration

  • address: string
  • Optional to?: true
congctl?: string

Sets a specific TCP congestion control algorithm only for a given destination.

If not specified, Linux keeps the current global default TCP congestion control algorithm, or the one set from the application.

If the modifier lock is not used, an application may nevertheless overwrite the suggested congestion control algorithm for that destination. If the modifier lock is used, then an application is not allowed to overwrite the specified congestion control algorithm for that destination, thus it will be enforced/guaranteed to use the proposed algorithm.

cwnd?: number

The clamp for congestion window.

dev?: string

The output device name.

dsfield?: number
encap?: {
    bpf: undefined | AddRouteBpfEncapArgs;
    ioam6: undefined | AddRouteIoam6EncapArgs;
    ip: undefined | AddRouteIpEncapArgs;
    mpls: undefined | AddRouteMplsEncapArgs;
    seg6: undefined | AddRouteSeg6EncapArgs;
    seg6local: undefined | AddRouteSeg6LocalEncapArgs;
}

Attach tunnel encapsulation attributes to this route.

Type declaration

expires?: number

The route will be deleted after the expires time. Only support IPv6 at present.

fastopen_no_cookie?: boolean

Enable TCP Fastopen without a cookie for connections to this destination.

features?: {
    ecn: true;
}

Enable or disable per-route features.

Only available feature at this time is ecn to enable explicit congestion notification when initiating connections to the given destination network.

When responding to a connection request from the given network, ecn will also be used even if the net.ipv4.tcp_ecn sysctl is set to 0.

Type declaration

initcwnd?: number

The initial congestion window size for connections to this destination. Actual window size is this value multiplied by the MSS (``Maximal Segment Size'') for same connection. The default is zero, meaning to use the values specified in RFC2414.

initrwnd?: number

The initial receive window size for connections to this destination. Actual window size is this value multiplied by the MSS of the connection. The default value is zero, meaning to use Slow Start value.

metric?: number

The preference value of the route. NUMBER is an arbitrary 32bit number, where routes with lower values are preferred.

mtu?: number

The MTU along the path to the destination.

nexthops?: ({
    nexthop: true;
} & NextHopArgs)[]

The nexthop of a multipath route.

NEXTHOP is a complex value with its own syntax similar to the top level argument lists.

nhid?: number

Use nexthop object with given id as nexthop specification.

onlink?: true

Pretend that the nexthop is directly attached to this link, even if it does not match any interface prefix.

pervasive?: true

XXX

The IPv6 route preference. PREF is a string specifying the route preference as defined in RFC4191 for Router Discovery messages.

preference?: number
proto?: number | RoutingTableProtocols

The routing protocol identifier of this route. RTPROTO may be a number or a string from the file /etc/iproute2/rt_protos.

If the routing protocol ID is not given, ip assumes protocol boot (i.e. it assumes the route was added by someone who doesn't understand what they are doing).

Several protocol values have a fixed interpretation.

protocol?: number | RoutingTableProtocols
quickack?: boolean

Enable or disable quick ack for connections to this destination.

realms?: string

XXX

reordering?: number

Maximal reordering on the path to this destination.

If it is not given, Linux uses the value selected with sysctl variable net/ipv4/tcp_reordering.

rto_min?: string | number

The minimum TCP Retransmission TimeOut to use when communicating with this destination. Values are specified as with rtt above.

See

rtt

rtt?: string | number

The initial RTT ('Round Trip Time') estimate.

If no suffix is specified the units are raw values passed directly to the routing code to maintain compatibility with previous releases.

Otherwise if a suffix of s, sec or secs is used to specify seconds and ms, msec or msecs to specify milliseconds. X

rttvar?: string | number

The initial RTT variance estimate. Values are specified as with rtt above.

See

rtt

scope?: number | AddressScopes

The scope of the destinations covered by the route prefix. SCOPE_VAL may be a number or a string from the file /etc/iproute2/rt_scopes. If this parameter is omitted, ip assumes scope global for all gatewayed unicast routes, scope link for direct unicast and broadcast routes and scope host for local routes.

ssthresh?: number

An estimate for the initial slow start threshold.

table?: number | RouteRoutingTables

The table to add this route to.

TABLEID may be a number or a string from the file /etc/iproute2/rt_tables. If this parameter is omitted, ip assumes the main table, with the exception of local, broadcast and nat routes, which are put into the local table by default.

to: string

The destination address.

tos?: number

The Type Of Service (TOS) key. This key has no associated mask and the longest match is understood as: First, compare the TOS of the route and of the packet.

If they are not equal, then the packet may still match a route with a zero TOS.

TOS is either an 8 bit hexadecimal number or an identifier from /etc/iproute2/rt_dsfield.

Control whether TTL should be propagated from any encap into the un-encapsulated packet, overriding any global configuration.

Only supported for MPLS at present.

type?: RouteTypes

The destination prefix of the route. If TYPE is omitted, ip assumes type RouteTypes.Unicast. PREFIX is an IP or IPv6 address optionally followed by a slash and the prefix length. If the length of the prefix is missing, ip assumes a full-length host route.

There is also a special PREFIX default - which is equivalent to IP 0/0 or to IPv6 ::/0.

via?: {
    address: string;
    family?: AddressFamilies;
}

The address of the nexthop router, in the address family FAMILY. Actually, the sense of this field depends on the route type. For normal unicast routes it is either the true next hop router or, if it is a direct route installed in BSD compatibility mode, it can be a local address of the interface. For NAT routes it is the first address of the block of translated IP destinations.

The internal buffer used in iproute2 limits the maximum number of nexthops that may be specified in one go. If only ADDRESS is given, the current buffer size allows for 144 IPv6 nexthops and 253 IPv4 ones. For IPv4, this effectively limits the number of nexthops possible per route.

With IPv6, further nexthops may be appended to the same route via ip route append command.

Type declaration

weight?: number

Is a weight for this element of a multipath route reflecting its relative bandwidth or quality.

window?: number

XXX

Generated using TypeDoc