Network

Display network devices

This page applies to:

  • HAProxy ALOHA 17.0 and newer
  • Does not apply to HAProxy
  • Does not apply to HAProxy Enterprise

You can use the HAProxy Data Plane API to display network devices on your load balancer. You’ll call the API endpoint /services/network/devices.

List network devices Jump to heading

To list network devices, make a GET request to the devices endpoint:

nix
curl -X GET \
--user admin:admin \
"http://localhost:5555/v3/services/network/devices"
nix
curl -X GET \
--user admin:admin \
"http://localhost:5555/v3/services/network/devices"
output
json
[
{
"hwaddress": "",
"ip4config": {
"adresses": [
{
"address": "127.0.0.1",
"prefix": 9
}
]
},
"ip6config": {
"adresses": [
{
"address": "::1",
"prefix": 128
}
]
},
"mtu": 65536,
"name": "lo",
"state": "unmanaged",
"type": "loopback"
},
{
"activeconnectionuuid": "46c50848-a49c-4b27-975a-9b53ef16fa6c",
"hwaddress": "00:0c:29:a5:ad:4f",
"ip4config": {
"adresses": [
{
"address": "192.168.56.45",
"prefix": 24
}
]
},
"ip6config": {
"adresses": [
{
"address": "fe80::20c:29ff:fea5:ad4f",
"prefix": 64
}
]
},
"mtu": 1500,
"name": "eth0",
"state": "activated",
"type": "ethernet"
}
]
output
json
[
{
"hwaddress": "",
"ip4config": {
"adresses": [
{
"address": "127.0.0.1",
"prefix": 9
}
]
},
"ip6config": {
"adresses": [
{
"address": "::1",
"prefix": 128
}
]
},
"mtu": 65536,
"name": "lo",
"state": "unmanaged",
"type": "loopback"
},
{
"activeconnectionuuid": "46c50848-a49c-4b27-975a-9b53ef16fa6c",
"hwaddress": "00:0c:29:a5:ad:4f",
"ip4config": {
"adresses": [
{
"address": "192.168.56.45",
"prefix": 24
}
]
},
"ip6config": {
"adresses": [
{
"address": "fe80::20c:29ff:fea5:ad4f",
"prefix": 64
}
]
},
"mtu": 1500,
"name": "eth0",
"state": "activated",
"type": "ethernet"
}
]

Display a single network device Jump to heading

To display a single network device, make a GET request to the devices endpoint and pass the device’s name in the URL path. Below, we display the loopback interface, lo:

nix
curl -X GET \
--user admin:admin \
"http://localhost:5555/v3/services/network/devices/lo"
nix
curl -X GET \
--user admin:admin \
"http://localhost:5555/v3/services/network/devices/lo"
output
json
{
"hwaddress": "",
"ip4config": {
"adresses": [
{
"address": "127.0.0.1",
"prefix": 9
}
]
},
"ip6config": {
"adresses": [
{
"address": "::1",
"prefix": 128
}
]
},
"mtu": 65536,
"name": "lo",
"state": "unmanaged",
"type": "loopback"
}
output
json
{
"hwaddress": "",
"ip4config": {
"adresses": [
{
"address": "127.0.0.1",
"prefix": 9
}
]
},
"ip6config": {
"adresses": [
{
"address": "::1",
"prefix": 128
}
]
},
"mtu": 65536,
"name": "lo",
"state": "unmanaged",
"type": "loopback"
}

Do you have any suggestions on how we can improve the content of this page?