vinfra node iface set

Modify network interface parameters (overwrite the omitted options with the default values for the interface):

usage: vinfra node iface set [--ipv4 <ipv4>] [--ipv6 <ipv6>]
                             [--gw4 <gw4>] [--gw6 <gw6>] [--mtu <mtu>]
                             [--dhcp4 | --no-dhcp4] [--dhcp6 | --no-dhcp6]
                             [--auto-routes-v4 | --ignore-auto-routes-v4]
                             [--auto-routes-v6 | --ignore-auto-routes-v6]
                             [--network <network> | --no-network]
                             [--connected-mode | --datagram-mode]
                             [--ifaces <ifaces>] [--bond-type <bond-type>]
                             [--node <node>] <iface>
--ipv4 <ipv4>
A comma-separated list of IPv4 addresses
--ipv6 <ipv6>
A comma-separated list of IPv6 addresses
--gw4 <gw4>
Gateway IPv4 address
--gw6 <gw6>
Gateway IPv6 address
--mtu <mtu>
MTU interface value
--dhcp4
Enable DHCPv4
--no-dhcp4
Disable DHCPv4
--dhcp6
Enable DHCPv6
--no-dhcp6
Disable DHCPv6
--auto-routes-v4
Enable automatic IPv4 routes
--ignore-auto-routes-v4
Ignore automatic IPv4 routes
--auto-routes-v6
Enable automatic IPv6 routes
--ignore-auto-routes-v6
Ignore automatic IPv6 routes
--network <network>
Network ID or name
--no-network
Remove a network from the interface
--connected-mode
Enable connected mode (InfiniBand interfaces only)
--datagram-mode
Enable datagram mode (InfiniBand interfaces only)
--ifaces <ifaces>
A comma-separated list of network interface names, for example, iface1,iface2,...,ifaceN
--bond-type <bond-type>

Bond type (balance-rr, balance-xor, broadcast, 802.3ad, balance-tlb, balance-alb)

Bond type for an OVS interface (balance-tcp, active-backup)

--node <node>
Node ID or hostname (default: node001.vstoragedomain)
<iface>
Network interface name

Example 1. Assigning a network to a network interface:

# vinfra node iface set eth2 --network MyNet --node node002
+---------+--------------------------------------+
| Field   | Value                                |
+---------+--------------------------------------+
| task_id | 8a378098-6760-4fe9-ac20-1f18a8ed9d2e |
+---------+--------------------------------------+

This command creates a task to assign the network MyNet to the network interface eth2 located on the node node002.

Task outcome:

# vinfra task show 8a378098-6760-4fe9-ac20-1f18a8ed9d2e
+---------+---------------------------------------------------------------+
| Field   | Value                                                         |
+---------+---------------------------------------------------------------+
| details |                                                               |
| name    | backend.presentation.network.tasks.NetworkInterfaceChangeTask |
| result  | contained_in: null                                            |
|         | dhcp4: null                                                   |
|         | dhcp4_enabled: false                                          |
|         | dhcp6: null                                                   |
|         | dhcp6_enabled: false                                          |
|         | duplex: null                                                  |
|         | gw4: null                                                     |
|         | gw6: null                                                     |
|         | ignore_auto_routes_v4: true                                   |
|         | ignore_auto_routes_v6: true                                   |
|         | ipv4: []                                                      |
|         | ipv6: []                                                      |
|         | mac_addr: fa:16:3e:a7:fa:bc                                   |
|         | mtu: 1450                                                     |
|         | multicast: true                                               |
|         | name: eth2                                                    |
|         | node_id: db83dc60-e34a-43d3-06fe-0caeb5ddaae2                 |
|         | plugged: true                                                 |
|         | roles_set: 7577efe8-33b5-44da-b54e-ab8f4419125b               |
|         | rx_bytes: 7038                                                |
|         | rx_dropped: 0                                                 |
|         | rx_errors: 0                                                  |
|         | rx_overruns: 0                                                |
|         | rx_packets: 90                                                |
|         | speeds:                                                       |
|         |   current: null                                               |
|         |   max: null                                                   |
|         | state: up                                                     |
|         | tx_bytes: 356                                                 |
|         | tx_dropped: 0                                                 |
|         | tx_errors: 0                                                  |
|         | tx_overruns: 0                                                |
|         | tx_packets: 4                                                 |
|         | type: iface                                                   |
| state   | success                                                       |
| task_id | 8a378098-6760-4fe9-ac20-1f18a8ed9d2e                          |
+---------+---------------------------------------------------------------+

Example 2. Unassigning a network from a network interface:

# vinfra node iface set eth2 --node node002 --no-network
+---------+--------------------------------------+
| Field   | Value                                |
+---------+--------------------------------------+
| task_id | c47837c4-e7a8-40d0-ab77-67c65375b86d |
+---------+--------------------------------------+

This command creates a task to unassign a network from the network interface eth2 located on the node node002.

Task outcome:

# vinfra task show c47837c4-e7a8-40d0-ab77-67c65375b86d
+---------+---------------------------------------------------------------+
| Field   | Value                                                         |
+---------+---------------------------------------------------------------+
| details |                                                               |
| name    | backend.presentation.network.tasks.NetworkInterfaceChangeTask |
| result  | contained_in: null                                            |
|         | dhcp4: null                                                   |
|         | dhcp4_enabled: false                                          |
|         | dhcp6: null                                                   |
|         | dhcp6_enabled: false                                          |
|         | duplex: null                                                  |
|         | gw4: null                                                     |
|         | gw6: null                                                     |
|         | ignore_auto_routes_v4: true                                   |
|         | ignore_auto_routes_v6: true                                   |
|         | ipv4: []                                                      |
|         | ipv6: []                                                      |
|         | mac_addr: fa:16:3e:a7:fa:bc                                   |
|         | mtu: 1450                                                     |
|         | multicast: true                                               |
|         | name: eth2                                                    |
|         | node_id: db83dc60-e34a-43d3-06fe-0caeb5ddaae2                 |
|         | plugged: true                                                 |
|         | roles_set: ''                                                 |
|         | rx_bytes: 7038                                                |
|         | rx_dropped: 0                                                 |
|         | rx_errors: 0                                                  |
|         | rx_overruns: 0                                                |
|         | rx_packets: 90                                                |
|         | speeds:                                                       |
|         |   current: null                                               |
|         |   max: null                                                   |
|         | state: up                                                     |
|         | tx_bytes: 356                                                 |
|         | tx_dropped: 0                                                 |
|         | tx_errors: 0                                                  |
|         | tx_overruns: 0                                                |
|         | tx_packets: 4                                                 |
|         | type: iface                                                   |
| state   | success                                                       |
| task_id | c47837c4-e7a8-40d0-ab77-67c65375b86d                          |
+---------+---------------------------------------------------------------+

Example 3. Enabling DHCP for a network interface:

# vinfra node iface set eth2 --node node002 --dhcp4
+---------+--------------------------------------+
| Field   | Value                                |
+---------+--------------------------------------+
| task_id | 077ef0c2-de0b-4e6c-84d0-d7cafd390606 |
+---------+--------------------------------------+

This command creates a task to enable IP address allocation via DCHP for the network interface eth2 located on the node node002.

Task outcome:

# vinfra task show 077ef0c2-de0b-4e6c-84d0-d7cafd390606
+---------+---------------------------------------------------------------+
| Field   | Value                                                         |
+---------+---------------------------------------------------------------+
| details |                                                               |
| name    | backend.presentation.network.tasks.NetworkInterfaceChangeTask |
| result  | contained_in: null                                            |
|         | dhcp4: 192.168.30.192/24                                      |
|         | dhcp4_enabled: true                                           |
|         | dhcp6: null                                                   |
|         | dhcp6_enabled: true                                           |
|         | duplex: null                                                  |
|         | gw4: null                                                     |
|         | gw6: null                                                     |
|         | ignore_auto_routes_v4: true                                   |
|         | ignore_auto_routes_v6: false                                  |
|         | ipv4:                                                         |
|         | - 192.168.30.192/24                                           |
|         | ipv6: []                                                      |
|         | mac_addr: fa:16:3e:a7:fa:bc                                   |
|         | mtu: 1450                                                     |
|         | multicast: true                                               |
|         | name: eth2                                                    |
|         | node_id: db83dc60-e34a-43d3-06fe-0caeb5ddaae2                 |
|         | plugged: true                                                 |
|         | roles_set: ''                                                 |
|         | rx_bytes: 8080                                                |
|         | rx_dropped: 0                                                 |
|         | rx_errors: 0                                                  |
|         | rx_overruns: 0                                                |
|         | rx_packets: 93                                                |
|         | speeds:                                                       |
|         |   current: null                                               |
|         |   max: null                                                   |
|         | state: up                                                     |
|         | tx_bytes: 1570                                                |
|         | tx_dropped: 0                                                 |
|         | tx_errors: 0                                                  |
|         | tx_overruns: 0                                                |
|         | tx_packets: 13                                                |
|         | type: iface                                                   |
| state   | success                                                       |
| task_id | 077ef0c2-de0b-4e6c-84d0-d7cafd390606                          |
+---------+---------------------------------------------------------------+

Example 4. Disabling DHCP and manually setting the IP address for a network interface:

# vinfra node iface set eth2 --node node002 --no-dhcp4 --ipv4 192.168.30.20/24
+---------+--------------------------------------+
| Field   | Value                                |
+---------+--------------------------------------+
| task_id | 95ab841c-3ce8-4ada-ab61-60ddcfc90d79 |
+---------+--------------------------------------+

This command creates a task to disable DHCP and set the IP address 192.168.30.20/24 for the network interface eth2 located on the node node002.

Task outcome:

# vinfra task show 95ab841c-3ce8-4ada-ab61-60ddcfc90d79
+---------+---------------------------------------------------------------+
| Field   | Value                                                         |
+---------+---------------------------------------------------------------+
| details |                                                               |
| name    | backend.presentation.network.tasks.NetworkInterfaceChangeTask |
| result  | contained_in: null                                            |
|         | dhcp4: null                                                   |
|         | dhcp4_enabled: false                                          |
|         | dhcp6: null                                                   |
|         | dhcp6_enabled: false                                          |
|         | duplex: null                                                  |
|         | gw4: null                                                     |
|         | gw6: null                                                     |
|         | ignore_auto_routes_v4: true                                   |
|         | ignore_auto_routes_v6: true                                   |
|         | ipv4:                                                         |
|         | - 192.168.30.20/24                                            |
|         | ipv6: []                                                      |
|         | mac_addr: fa:16:3e:a7:fa:bc                                   |
|         | mtu: 1450                                                     |
|         | multicast: true                                               |
|         | name: eth2                                                    |
|         | node_id: db83dc60-e34a-43d3-06fe-0caeb5ddaae2                 |
|         | plugged: true                                                 |
|         | roles_set: ''                                                 |
|         | rx_bytes: 8164                                                |
|         | rx_dropped: 0                                                 |
|         | rx_errors: 0                                                  |
|         | rx_overruns: 0                                                |
|         | rx_packets: 95                                                |
|         | speeds:                                                       |
|         |   current: null                                               |
|         |   max: null                                                   |
|         | state: up                                                     |
|         | tx_bytes: 1962                                                |
|         | tx_dropped: 0                                                 |
|         | tx_errors: 0                                                  |
|         | tx_overruns: 0                                                |
|         | tx_packets: 19                                                |
|         | type: iface                                                   |
| state   | success                                                       |
| task_id | 95ab841c-3ce8-4ada-ab61-60ddcfc90d79                          |
+---------+---------------------------------------------------------------+

Example 5. Changing the bond type for a network bond:

# vinfra node iface set bond0 --node node002 --bond-type balance-xor
+---------+--------------------------------------+
| Field   | Value                                |
+---------+--------------------------------------+
| task_id | 3a21b5b8-fe5e-432a-b143-43f80ec51b70 |
+---------+--------------------------------------+

This command creates a task to change the bond type of the network bond bond0 located on the node node002 to balance-xor.

Task outcome:

# vinfra task show 3a21b5b8-fe5e-432a-b143-43f80ec51b70
+---------+---------------------------------------------------------------+
| Field   | Value                                                         |
+---------+---------------------------------------------------------------+
| details |                                                               |
| name    | backend.presentation.network.tasks.NetworkInterfaceChangeTask |
| result  | bond_type: balance-xor                                        |
|         | dhcp4: null                                                   |
|         | dhcp4_enabled: false                                          |
|         | dhcp6: null                                                   |
|         | dhcp6_enabled: false                                          |
|         | duplex: null                                                  |
|         | gw4: null                                                     |
|         | gw6: null                                                     |
|         | ifaces:                                                       |
|         | - eth2                                                        |
|         | - eth3                                                        |
|         | ignore_auto_routes_v4: true                                   |
|         | ignore_auto_routes_v6: true                                   |
|         | ipv4:                                                         |
|         | - 192.168.30.20/24                                            |
|         | ipv6: []                                                      |
|         | mac_addr: fa:16:3e:a7:fa:bc                                   |
|         | mtu: 1450                                                     |
|         | multicast: true                                               |
|         | name: bond0                                                   |
|         | node_id: db83dc60-e34a-43d3-06fe-0caeb5ddaae2                 |
|         | plugged: true                                                 |
|         | roles_set: ''                                                 |
|         | rx_bytes: 1326                                                |
|         | rx_dropped: 0                                                 |
|         | rx_errors: 0                                                  |
|         | rx_overruns: 0                                                |
|         | rx_packets: 17                                                |
|         | speeds:                                                       |
|         |   current: null                                               |
|         |   max: null                                                   |
|         | state: up                                                     |
|         | tx_bytes: 1586                                                |
|         | tx_dropped: 0                                                 |
|         | tx_errors: 0                                                  |
|         | tx_overruns: 0                                                |
|         | tx_packets: 21                                                |
|         | type: bonding                                                 |
| state   | success                                                       |
| task_id | 3a21b5b8-fe5e-432a-b143-43f80ec51b70                          |
+---------+---------------------------------------------------------------+