Network Interfaces
A network interface is a physical or virtual device on your system that communicates with other networking devices. It should be noted here that there is some outdated (and perhaps offensive) terminology referenced for bonded interfaces.
Basic Operations
The Basic operations for network interfaces are listing, viewing details, configuring, unconfiguring, updating, binding, and setting bond members. There’s a lot to do here.
List Network Interfaces
The network interfaces can be listed by calling the following route.
Request Object
+ URL /api/v2/network/interface + Method GET + Headers Content-Type: application/json token: ThisIsNotARealTokenGenerateYourOwnToken + Body {}
Response Object
Sending this should get you back a valid response, an array of each network interface in the system.
+ Headers X-Powered-By: OpenDrives Access-Control-Allow-Origin: * Content-Type: application/json; charset=utf-8 + Body [ { "link": "mgmt0", "class": "phys", "mtu": "1500", "state": "up", "phys": { "index": "2", "deleted": false, "name": "mgmt0", "flags": [ "BROADCAST", "MULTICAST", "UP", "LOWER_UP" ], "type": "ether", "mac": "00:25:90:fa:51:22", "brd": "ff:ff:ff:ff:ff:ff", "mtu": "1500", "qdisc": "mq", "state": "UP", "mode": "DEFAULT", "group": "default", "qlen": "1000" }, "settings": { "dev": "mgmt0", "speed": 1000, "transceiver": 0, "supported": 12520, "advertising": 12520, "phy_address": 0, "autoneg": 1, "maxtxpkt": 0, "maxrxpkt": 0, "port": "Twisted Pair", "duplex": "Full", "link_detected": true, "driver": { "name": "ixgbe", "version": "5.1.0-k", "fw_version": "0x80000314", "bus_info": "0000:03:00.0" } }, "config": { "mode": "dhcp", "slaves": "" }, "ipv4": { "type": "dhcp", "address": "192.168.7.76/24", "brd": "192.168.7.255", "scope": "global", "dynamic": "mgmt0" }, "status": "GOOD" }, { "link": "mgmt1", "class": "phys", "mtu": "1500", "state": "down", "phys": { "index": "3", "deleted": false, "name": "mgmt1", "flags": [ "NO-CARRIER", "BROADCAST", "MULTICAST", "UP" ], "type": "ether", "mac": "00:25:90:fa:51:23", "brd": "ff:ff:ff:ff:ff:ff", "mtu": "1500", "qdisc": "mq", "state": "DOWN", "mode": "DEFAULT", "group": "default", "qlen": "1000" }, "settings": { "dev": "mgmt1", "speed": "UNKNOWN", "transceiver": 0, "supported": 12520, "advertising": 12520, "phy_address": 0, "autoneg": 1, "maxtxpkt": 0, "maxrxpkt": 0, "port": "Twisted Pair", "duplex": "Unknown!", "link_detected": false, "driver": { "name": "ixgbe", "version": "5.1.0-k", "fw_version": "0x80000314", "bus_info": "0000:03:00.1" } }, "config": { "mode": "static", "address": "10.10.10.10", "netmask": "255.255.255.0", "mtu": "1500", "slaves": "" }, "ipv4": { "type": "static", "address": "10.10.10.10/24", "brd": "10.10.10.255", "scope": "global" }, "status": "WARNING" } ]
View Network Interface Details
A single network interface may be singled out for information as well.
Request Object
+ URL /api/v2/network/interface/$DEVICE_NAME/details + Method GET + Parameters device name (string, required, URL param) - the name of the network interface + Headers Content-Type: application/json token: ThisIsNotARealTokenGenerateYourOwnToken + Body {}
Response Object
Sending this should get you back a valid response, an array with just the network interface you’ve requested.
+ Headers X-Powered-By: OpenDrives Access-Control-Allow-Origin: * Content-Type: application/json; charset=utf-8 + Body [ { "link": "mgmt1", "class": "phys", "mtu": "1500", "state": "down", "phys": { "index": "3", "deleted": false, "name": "mgmt1", "flags": [ "NO-CARRIER", "BROADCAST", "MULTICAST", "UP" ], "type": "ether", "mac": "00:25:90:fa:51:23", "brd": "ff:ff:ff:ff:ff:ff", "mtu": "1500", "qdisc": "mq", "state": "DOWN", "mode": "DEFAULT", "group": "default", "qlen": "1000" }, "settings": { "dev": "mgmt1", "speed": "UNKNOWN", "transceiver": 0, "supported": 12520, "advertising": 12520, "phy_address": 0, "autoneg": 1, "maxtxpkt": 0, "maxrxpkt": 0, "port": "Twisted Pair", "duplex": "Unknown!", "link_detected": false, "driver": { "name": "ixgbe", "version": "5.1.0-k", "fw_version": "0x80000314", "bus_info": "0000:03:00.1" } }, "config": { "mode": "static", "address": "10.10.10.10", "netmask": "255.255.255.0", "mtu": "1500", "slaves": "" }, "ipv4": { "type": "static", "address": "10.10.10.10/24", "brd": "10.10.10.255", "scope": "global" }, "status": "WARNING" } ]
Configure a Network Interface
Network interfaces may be configured with a wide array of properties.
Request Object
+ URL /api/v2/network/interface/configure + Method POST + Parameters device (string, required, Body) - the name of the network interface to configure isdhcp (boolean, required, Body) - should we use dhcp configuration on this interface or not address (string, optional, Body) - this parameter is required if isdhcp is false, this is the address assigned to a static interface netmask (string, optional, Body) - the netmask to apply to a static interface mtu (string, optional, Body) - the mtu to specify for the static interface bond* (string, optional, Body) - any parameter starting with 'bond' will be directly passed through into the network interface's configuration file slave* (string, optional, Body) - any parameter starting with 'slave' will be directly passed through into the network interface's configuration file + Headers Content-Type: application/json token: ThisIsNotARealTokenGenerateYourOwnToken + Body { "device": "mgmt1", "isdhcp": false, "address": "192.168.12.12", "netmask": "255.255.255.0", "mtu": "1500", }
Response Object
Sending this will return to you the network interface you’ve configured.
+ Headers X-Powered-By: OpenDrives Access-Control-Allow-Origin: * Content-Type: application/json; charset=utf-8 + Body { "link": "mgmt1", "class": "phys", "mtu": "1500", "state": "down", "phys": { "index": "3", "deleted": false, "name": "mgmt1", "flags": [ "NO-CARRIER", "BROADCAST", "MULTICAST", "UP" ], "type": "ether", "mac": "00:25:90:fa:51:23", "brd": "ff:ff:ff:ff:ff:ff", "mtu": "1500", "qdisc": "mq", "state": "DOWN", "mode": "DEFAULT", "group": "default", "qlen": "1000" }, "settings": { "dev": "mgmt1", "speed": "UNKNOWN", "transceiver": 0, "supported": 12520, "advertising": 12520, "phy_address": 0, "autoneg": 1, "maxtxpkt": 0, "maxrxpkt": 0, "port": "Twisted Pair", "duplex": "Unknown!", "link_detected": false, "driver": { "name": "ixgbe", "version": "5.1.0-k", "fw_version": "0x80000314", "bus_info": "0000:03:00.1" } }, "config": { "mode": "static", "address": "192.168.12.12", "netmask": "255.255.255.0", "mtu": "1500" }, "ipv4": { "type": "inet", "address": "192.168.12.12/24", "brd": "192.168.12.255", "scope": "global" }, "status": "WARNING" }
Up or Down a Network Interface
While a network interface is configured, you may 'up' the interface to make it available and connected with the network outside the Atlas System, or 'down' the interface, to make it unavailable.
Request Object
+ URL /api/v2/network/interface/$DEVICE_NAME/update + Method POST + Parameters device (string, required, URL param) - the name of the network interface to update state (string, required, Body) - one of 'up' or 'down' + Headers Content-Type: application/json token: ThisIsNotARealTokenGenerateYourOwnToken + Body { "state": "up" }
Unconfigure a Network Interface
You can remove the configuration of a network interface and return it to a non-functional state.
Bond Manipulation
You can pair multiple interfaces up to have them work in unison as a bond.
Create a Network Bond
A Network bond allows multiple interfaces to work as one.
Request Object
+ URL /api/v2/network/interface/bind + Method POST + Parameters isdhcp (boolean, required, Body) - should we use dhcp configuration on this interface or not address (string, optional, Body) - this parameter is required if isdhcp is false, this is the address assigned to a static interface netmask (string, optional, Body) - the netmask to apply to a static interface mtu (string, optional, Body) - the mtu to specify for the static interface slaves (string, required, Body) - a comma separated string if interface names to use in the bond bond_mode: (number, required, Body) - The mode of the bond. Defaults to 4 bond_lacp_rate: (number, required, Body) - The lacp rate of the bond. Defaults to 1 bond_miimon: (number, required, Body) - The miimon of the bond. Defaults to 100 bond_updelay: (number, required, Body) - The updelay of the bond. Defaults to 200 bond_downdelay: (number, required, Body) - The downdelay of the bond. Defaults to 200 bond_xmit_hash_policy: (number, required, Body) - The transmission hash policy of the bond. Defaults to 'layer3+4' + Headers Content-Type: application/json token: ThisIsNotARealTokenGenerateYourOwnToken + Body { "address":"10.40.1.76", "netmask":"255.255.255.0", "mtu":9000, "slaves":"qsfp06p0,qsfp06p1,qsfp84p0", "bond_mode":4, "bond_lacp_rate":"1", "bond_miimon":100, "bond_updelay":200, "bond_downdelay":200, "bond_xmit_hash_policy":"layer3+4" }
Response Object
Sending this will return to you the network interface you’ve configured.
+ Headers X-Powered-By: OpenDrives Access-Control-Allow-Origin: * Content-Type: application/json; charset=utf-8 + Body { "link": "bond0", "class": "phys", "mtu": "9000", "state": "down", "phys": { "index": "11", "deleted": false, "name": "bond0", "flags": [ "NO-CARRIER", "BROADCAST", "MULTICAST", "MASTER", "UP" ], "type": "ether", "mac": "00:07:43:38:54:20", "brd": "ff:ff:ff:ff:ff:ff", "mtu": "9000", "qdisc": "noqueue", "state": "DOWN", "mode": "DEFAULT", "group": "default", "qlen": "1000" }, "settings": { "dev": "bond0", "speed": "UNKNOWN", "transceiver": 0, "supported": 0, "advertising": 0, "phy_address": 0, "autoneg": 0, "maxtxpkt": 0, "maxrxpkt": 0, "port": "Other", "duplex": "Unknown!", "link_detected": false, "driver": { "name": "bonding", "version": "3.7.1", "fw_version": "2", "bus_info": "" } }, "config": { "mode": "static", "address": "10.40.1.76", "netmask": "255.255.255.0", "mtu": "9000", "slaves": "qsfp06p0 qsfp06p1 qsfp84p0", "bond_mode": "4", "bond_lacp_rate": "1", "bond_miimon": "100", "bond_xmit_hash_policy": "layer3+4", "bond-downdelay": "200", "bond-updelay": "200" }, "ipv4": { "type": "inet", "address": "10.40.1.76/24", "brd": "10.40.1.255", "scope": "global" }, "status": "WARNING" }
Re-Select Bond Members
You can reselect the members of a bond with this route.
Request Object
+ URL /api/v2/network/interface/slaves + Method POST + Parameters device (string, required, Body) - the name of the network bond to reconfigure slaves (string, required, Body) - a comma separated string if interface names to use in the bond + Headers Content-Type: application/json token: ThisIsNotARealTokenGenerateYourOwnToken + Body { "dev": "bond0", "slaves": "qsfp06p0,qsfp84p0" }