network interface
The network interface command manages the network interfaces on the virtual device. Besides the physical interfaces, the logical interfaces such as VLAN, VXLAN, bond, LACP, bridge, veth and macvtap are defined with this command as well. Its panel equivalent is the interface screen in the network configuration.
The fields change after the type
After type is selected, only the fields of that type are listed. In VLAN the tag and the master interface, in VXLAN the transport mode, and in bond and bridge the member list are asked for.
Command Summary
Required Fields
| Order | Field | Status | What it does | What is written after it |
|---|---|---|---|---|
| 1 | v-device | Required | Selects on which virtual device the interface will be defined | The virtual device |
| 2 | type | Required | Determines the type of the interface; the fields specific to the type are listed after this selection | eth · vlan · vxlan · macvtap · veth · bond · lacp · bridge |
| 3 | name | Required | Gives a name to the interface | The interface name |
| 4 · 5 | vlanId · vlanMasterId | Conditionally required | Only type vlan; the VLAN tag and the interface on which it will be set up | The tag number · an interface record |
| 4–7 | vxlanId · vxlanMasterId · vxlanTransportMode | Conditionally required | Only type vxlan; the network identifier, the lower interface and the transport mode | The VNI · an interface record · remote · peers · multicast |
| 7 | vxlanRemote | Conditionally required | Only vxlanTransportMode remote | The remote endpoint address |
| 7 | vxlanGroup | Conditionally required | Only vxlanTransportMode multicast | The multicast group address |
| 4 | macvtapMasterId | Conditionally required | Only type macvtap | An interface record |
| 4 | vethPeerId | Conditionally required | Only type veth | The other end of the pair |
In this resource the type is the discriminator: the CLI asks for type first and the required fields specific to the type are written without a prefix even if there is a field that starts with -- on the line. No field that starts with -- is accepted before all of them are completed. In the bond, lacp and bridge types the member lists are a list field and are written as --bondMemberIds.0.
The Interface Types
type | What it does | The fields specific to the type |
|---|---|---|
eth | It defines the physical interface | — |
vlan | It creates a tagged virtual network on an interface | vlanId · vlanMasterId |
vxlan | It sets up a layer-2 tunnel between two points | vxlanId · vxlanMasterId · vxlanTransportMode and the transport fields |
macvtap | It creates a virtual interface with a separate MAC address on an interface | macvtapMasterId |
veth | It creates a virtual interface pair | vethPeerId |
bond | It gathers more than one interface in a single logical interface | --bondMemberIds.N |
lacp | It combines the interfaces with the link aggregation protocol | --bondMemberIds.N · --LACPTransmitRate |
bridge | It combines the interfaces in a layer-2 bridge | --bridgeMemberIds.N |
The Fields Specific to the Type
| Field | What it does | What is written after it |
|---|---|---|
vlanId | Determines the VLAN tag | The tag number; it is required while type vlan |
vlanMasterId | Selects the interface on which the VLAN will be set up | An interface record; it is required while type vlan |
vxlanId | Determines the network identifier (VNI) of the tunnel | The VNI value; it is required while type vxlan |
vxlanMasterId | Selects the lower interface over which the tunnel will be carried | An interface record; it is required while type vxlan |
vxlanTransportMode | Selects how the tunnel will reach the other side | remote a single remote point · peers a peer list · multicast a multicast group; it is required while type vxlan |
vxlanRemote | Determines the address of the remote endpoint | The IP address; it is required while vxlanTransportMode remote |
--vxlanPeerIps.N | Determines the endpoints in the peer list | The IP address; each of them with its own index |
vxlanGroup | Determines the multicast group | The IP address; it is required while vxlanTransportMode multicast |
--vxlanLocalIp | Determines the local address from which the tunnel will go out | The IP address |
--vxlanDstPort | Determines the UDP port the tunnel will use | The port number (the default is 4789) |
--vxlanTtl | Determines the time to live of the tunnel packets | The TTL value |
--vxlanLearning | Turns on the MAC addresses being learned by themselves | true (the default) · false |
macvtapMasterId | Selects the interface on which the virtual interface will be set up | An interface record; it is required while type macvtap |
vethPeerId | Selects the other end of the pair | An interface record; it is required while type veth |
--bondMemberIds.N | Selects the interfaces to be gathered | Interface records; it opens while type bond or lacp |
--LACPTransmitRate | Selects the sending frequency of the LACP packets | fast (the default) · slow; it opens while type lacp |
--bridgeMemberIds.N | Selects the interfaces to be taken into the bridge | Interface records; it opens while type bridge |
The Common Fields
| Field | What it does | What is written after it |
|---|---|---|
--namespace | Selects to which routing table the interface will be bound | The routing table (the default is 1) |
--mtu | Determines the largest packet size of the interface | The MTU value |
--tcpAcceleration | Turns on the TCP acceleration on the interface | true · false (the default is false) |
The VIP Takeover Fields
On the devices with a cluster set up, it determines how the virtual address will be taken over between the members.
| Field | What it does | What is written after it |
|---|---|---|
--clusterIpPair | Pairs the interface for the VIP communication | The pairing value; it opens only while the cluster is enabled and while the record is being updated |
--clusterIpMethod | Selects with which method the takeover will be detected | vrrp (the default) · link the link state · gw the gateway reachability · link+gw the two together |
--advertInt | Determines in how many seconds the takeover decision will be evaluated | The second (the default is 3) |
Examples
Things to Know
- The type is written first and determines its fields. After the
v-devicefield the CLI asks fortype, and asks for the name after that. The required fields specific to the type are written without a prefix even if there is a--on the line; for the optional fields,--with Tab shows the whole of that type. - The VXLAN transport mode opens three sub-paths.
remoteasks for a single address,peersfor an address list andmulticastfor a group address; the field of the path not selected falls out of the list. - Bond and LACP use the same member field. In both of them the members are written with
--bondMemberIds.N; in LACP the sending frequency is additionally selected. - The VIP fields open only in the update. The
--clusterIpPairand the fields bound to it are listed on the devices with a cluster set up and after the record is created. - Deleting an interface affects the addresses as well. Before an interface that has a
network iprecord on it is deleted, its addresses should be reviewed.
