Skip to content
Emer NetworkingEmer Networking
Go back

AOS-CX Containers

Edit post link disabled per config.

What is a container?

A container is a lightweight, standalone, and executable software package that bundles an application’s code, runtime, system tools, libraries, and settings. The most common flavor of containers is a Docker image.

Typically, containers are used to deploy lightweight services such as Web Application Firewalls (WAF), Reverse Proxies such as NGINX & Traefik, or a simple DHCP/DNS server. You would normally run these services on a dedicated container host like a physical server. You can also run them on AOS-CX switches!

With the release of AOS-CX 10.16.x the underlying container manager is Docker. This provides a much richer and comprehensive ecosystem.

What does that mean for me?

In recent versions of AOS-CX code back to 10.13.x HPE Aruba Networking has added the ability to deploy containers on switches. While this is not very practical in all use cases. I have found a few instances where this could make a lot of sense.

  1. Network Monitoring: to collect metrics from other network devices. (Prometheus)
  2. API Gateway: Deploy a lightweight API server to automate tasks.
  3. Site replication: Deploy a lightweight replication service to copy files from one location to another without deploying a server at each location.
  4. Test services: This is what we will discuss today. A simple service to determine network connectivity or performance. Here will be deploying iPerf3.

iPerf is a tool for active measurements of the maximum achievable bandwidth on IP networks.

How do I get started?

First things first. You need a switch. Below is a table indicating what HPE ANW switches are supported.

Not supported on the 6300L variants

Next, we need to figure out the architecture that the switch we are going to use is running.

  • ARM-based platforms: 6300, 6400, 8100, and 8360
  • x86-based platforms: 8320, 8325, 10000, 8400, and 9300.

Now, we need to pull the appropriate image for the platform needed. We will be using an ARM-based image for an CX6300 switch using this repo: https://github.com/iitggithub/iperf-server

Terminal window
user@captzak:~$ docker pull --platform linux/arm iitgdocker/iperf-server:latest
<snipped>
user@captzak:~$ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
pihole/pihole latest 8d1797a6feca 6 weeks ago 76.2MB
iitgdocker/iperf-server latest d930c4cccc66 10 months ago 5.27MB
user@captzak:~$ docker save d930c4cccc66 -o arm_iperf.tar

Saving docker image as .tar

Note in step 3 I referenced the Image ID to select which image that I wanted to save. Now we have an image saved as a .tar file that we can use with our switch. You must also indicate the platform with the —platform option. Otherwise, Docker will pull the image compatible with the host you are running the command from. We can move on to the fun stuff.

Hosting the Image:

We now have our desired image, and we need to get our switch to download and deploy it. There is one slight hurdle you must overcome, and that is hosting the .tar file on an HTTP server. HTTPS is not yet supported so the easiest method I have found is to use Python’s native HTTP server module. If you’re on a Linux box, it is as simple as installing Python with apt install python3. Otherwise, you can download Python3 for Windows here: https://www.python.org/downloads/ or for MacOS with your favorite package manager.

Once Python is installed, navigate to the folder where your .tar file is stored and run:

cd c:\temp
python -m http.server
Serving HTTP on :: port 8000 (http://[::]:8000/) ...

To test if your server is running you can open a browser and navigate to http://localhost:8000 . If you get a directory listing, your server is up and running and you can move on to the switch configuration.

Switch Configuration:

On the switch there are three things needed.

  1. Define the container.
  2. Define container location which is our self-hosted server.
  3. Map the appropriate ports between the host and container along with the correct VRF.
conf t
container iperf
image-location http://192.168.2.132:8000/arm_iperf.tar vrf default allow-unsigned
network vrf default
port-map host-port 5201 container-port 5201 protocol tcp
port-map host-port 5201 container-port 5201 protocol udp
exit
enable

A few notes:

  1. The ‘allow-unsigned’ keyword is crucial. If it is not indicated, then only HPE-signed images are allowed to run. (Ours is not signed.)
  2. The image location is hosted on my machine, port 8000, with HTTP (not HTTPS). Confirm your machine firewall is allowing TCP/8000.
  3. iPerf typically runs on ports 5201 (UDP/TCP). Since these are not switch-protected ports I kept it simple and reused them.
  4. Lastly, you must enable the container. With AOS-CX 10.16.x the enable command is equivalent to start/stop of the underlying Docker container.

Two things should happen after you issue the ‘enable’ command. You will see the download attempt from the ‘server-side’ CLI then you should see the container status move to operational as shown below.

Serving HTTP on :: port 8000 (http://[::]:8000/) ...
::1 - - [16/Sep/2025 10:39:03] "GET /arm_iperf.tar HTTP/1.1" 200 -
6300# show container iperf
Container : iperf
Container status : operational
Manifest status : missing
Manifest status reason : The container image does not include a manifest file
Image status : allowed without signature
Image location VRF : default
Image location URL : http://192.168.2.132:8000/arm_iperf.tar
CPU limit : 10%
Memory limit : 256MB
VRFs : default
Environment variables :
Encrypted environment variables:
Network:
VRF name : default
Port map :
5201:5201/tcp
5201:5201/udp

SUCCESS!

Let’s Test

user@captzak:~$ iperf3 -c 192.168.199.81
Connecting to host 192.168.199.81, port 5201
[ 5] local 172.24.106.19 port 46630 connected to 192.168.199.81 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 4.67 MBytes 39.2 Mbits/sec 415 81.7 KBytes
[ 5] 1.00-2.00 sec 3.21 MBytes 27.0 Mbits/sec 314 20.7 KBytes
[ 5] 2.00-3.00 sec 2.86 MBytes 24.0 Mbits/sec 214 21.9 KBytes
[ 5] 3.00-4.00 sec 3.21 MBytes 26.9 Mbits/sec 190 40.2 KBytes
[ 5] 4.00-5.00 sec 3.57 MBytes 30.0 Mbits/sec 305 57.3 KBytes
[ 5] 5.00-6.00 sec 3.57 MBytes 30.0 Mbits/sec 381 20.7 KBytes
[ 5] 6.00-7.00 sec 2.86 MBytes 24.0 Mbits/sec 138 69.5 KBytes
[ 5] 7.00-8.00 sec 3.57 MBytes 30.0 Mbits/sec 369 26.8 KBytes
[ 5] 8.00-9.00 sec 2.86 MBytes 24.0 Mbits/sec 201 4.88 KBytes
[ 5] 9.00-10.00 sec 3.57 MBytes 30.0 Mbits/sec 356 9.75 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 34.0 MBytes 28.5 Mbits/sec 2883 sender
[ 5] 0.00-9.99 sec 33.1 MBytes 27.8 Mbits/sec receiver

Successful Test

You now have the ability to test network performance across your network to a central location without having to a dedicated iperf3 appliance.

Additional Information:

The well-versed users may know that all AOS-CX switches already have iperf built-in. However, this requires you to drop to the Linux shell of the device which is a manual process. Furthermore, iperf, used in this manner, is not persistent between reboots. Containers will always try to start and stay running as long as the ‘enable’ command is provided in its configuration.

You can also configure containers via the API if the device is hosted by Aruba Central.

curl -X 'POST' \
'https://internal-ui.central.arubanetworks.com/network-config/v1alpha1/containers' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"instance": [
{
"name": "string",
"description": "string",
"vrfs": [
"string"
],
"environment-variables": [
{
"variable": "string",
"value": "string"
}
],
"encrypted-environment-variables": [
{
"encrypted-env-type": "PLAIN_TEXT",
"variable": "string",
"value-plaintext": "string",
"value-ciphertext": "string"
}
],
"runtime-constraints": {
"cpu": 10,
"memory": 256
},
"image-location-url": "string",
"image-location-vrf": "string",
"allow-unsigned-image": false
}
]
}'

Back to top
Edit post link disabled per config.

Previous Post
Clearpass w/ SSH & DUO MFA
Next Post
HPE Juniper Wired 802.1X Authentication with ClearPass
EOF