Currently ip2nets parameter is parsed in the kernel, which is not desirable. This is being deprecated in the Multi-Rail code and all parsing will occur in user-space in the DLC library. Once ip2nets syntax is parsed, the DLC library will configure the networks through the standard IOCTL interface.
This page will outline how ip2nets behaves.
ip2nets in DLC can be specified only through the YAML interface. Below is the YAML syntax for ip2nets:
/* * ip2nets: * - net-spec: <tcp|o2ib|gni>[NUM] * interfaces: * 0: <intf name>['['<expr>']'] * 1: <intf name>['['<expr>']'] * ip-range: * 0: <expr.expr.expr.expr> * 1: <expr.expr.expr.expr> * N: <expr.expr.expr.expr> */ net-spec: specifies the network to be configured. interfaces: This is an optional block. It specifies the list of interfaces to be configured. The expression enclosed in the following brackets describes the CPU partitions to bind the network interface to ip-range: This is an optional block. It is a list of ip ranges to match the interfaces to. Each interface specified must match at least one of the ip-ranges. The <net-spec> block can be specified multiple times to define multipe Networks to configure. |
When the ip2nets YAML block is parsed each interface and it's CPT expression is resolved and matched to the ip-ranges. The matching interfaces are configured under the network specified in net-spec.
Each interface in the interfaces list is matched against the ip-range expression. The interface will only be configured if it matches at least one of the ip-range expressions.
If there are no ip-ranges specified, then all interfaces are configured in the network if they are currently UP.
If there are no interfaces specified but there are ip-ranges specified, then all available interfaces in the system are checked against the ip-ranges and the interfaces which match the ip-ranges are configured.
If neither the interfaces or ip-ranges are specified then the first interface available is configured.
ip2nets: - net-spec: tcp1 interfaces: 0: eth0 1: eth1 2: eth2 ip-range: 0: 192.168.122.* |
ip2nets: - net-spec: tcp1 ip-range: 0: 192.168.122.* |
ip2nets: - net-spec: tcp1 interfaces: 0: eth0[1,2] 1: eth1[0,1] 2: eth2[2,3] ip-range: 0: 192.168.122.* |
ip2nets: - net-spec: tcp1 interfaces: 0: eth0 ip-range: 0: 192.168.122.* - net-spec: tcp2 interfaces: 1: eth1 2: eth2 ip-range: 0: 192.168.122.* |
ip2nets: - net-spec: tcp1 interfaces: 0: eth0 1: eth1 2: eth2 ip-range: 0: 192.168.122.199 |
ip2nets: - net-spec: tcp1 interfaces: 0: eth0 1: eth1 2: eth2 |
ip2nets: - net-spec: tcp1 |