Skip to content

Instantly share code, notes, and snippets.

@xros
Last active February 19, 2025 23:48
Show Gist options
  • Save xros/5fe1a7d3f67fb99eecfacc847f953c56 to your computer and use it in GitHub Desktop.
Save xros/5fe1a7d3f67fb99eecfacc847f953c56 to your computer and use it in GitHub Desktop.
iperf3 network testing for VMs using private (internal) switch in Synology DSM

TD;DR

Summary

I found Synology DSM 7.2.2 supports internal(private) vSwitch with IPv6 support ONLY (without using a physical switch). No IPv4! (I assume Synology won't like users to use internal(private) vSwitch because it costs lots of CPU)

Here's how-to

add the same private switch to debian vm A (as server) and debian vm B (as client)

Add this to /etc/network/interfaces to server A and client B. ens4 is the virtual private switch on DSM.

# The 2nd network interface
allow-hotplug ens4
iface ens4 inet dhcp

restart the network

systemctl restart networking.service

Check the new network ens4

ip addr

Output

3: ens4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 02:11:32:2e:aa:02 brd ff:ff:ff:ff:ff:ff
    altname enp0s4
    inet6 fe80::11:32ff:fe2e:aa02/64 scope link 
       valid_lft forever preferred_lft forever

On server A (it's ethernet interface is ens4 and IPv6 is fe80::11:32ff:fe24:9f2e)

iperf3 -s --bind fe80::11:32ff:fe24:9f2e%ens4

Above we bind specific IPv6(server side) on specific interface(server side)

On client B (it's ethernet interface is ens4 and IPv6 is fe80::11:32ff:fe2e:aa02)

iperf3 --client --bind fe80::11:32ff:fe2e:aa02%ens4 --client fe80::11:32ff:fe24:9f2e%ens4

Above we bind specific IPv6(client side) on specific interface(client side) to reach specific IPv6(server side) on specific interface(client side)

You will get this on client B

Connecting to host fe80::11:32ff:fe24:9f2e%ens4, port 5201
[  5] local fe80::11:32ff:fe2e:aa02 port 41314 connected to fe80::11:32ff:fe24:9f2e port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec   962 MBytes  8.06 Gbits/sec    0   3.02 MBytes       
[  5]   1.00-2.00   sec   826 MBytes  6.94 Gbits/sec    1   3.02 MBytes       
[  5]   2.00-3.00   sec   910 MBytes  7.63 Gbits/sec    0   3.02 MBytes       
[  5]   3.00-4.00   sec   718 MBytes  6.01 Gbits/sec    0   3.02 MBytes       
[  5]   4.00-5.00   sec   769 MBytes  6.46 Gbits/sec    0   3.02 MBytes       
[  5]   5.00-6.00   sec   841 MBytes  7.05 Gbits/sec    0   3.02 MBytes       
[  5]   6.00-7.00   sec   909 MBytes  7.62 Gbits/sec    0   3.02 MBytes       
[  5]   7.00-8.00   sec   791 MBytes  6.64 Gbits/sec    0   3.02 MBytes       
[  5]   8.00-9.00   sec   871 MBytes  7.31 Gbits/sec    0   3.02 MBytes       
[  5]   9.00-10.00  sec   728 MBytes  6.10 Gbits/sec    1   3.02 MBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  8.13 GBytes  6.98 Gbits/sec    2             sender
[  5]   0.00-10.00  sec  8.13 GBytes  6.98 Gbits/sec                  receiver

So VMs on the DSM virtual private switch (VirtIO) works on IPv6 (internal).

I haven't found a method to make it work on Internet IPv4 since it doesn't get a IPv4 address, such as 10.0.0.x or 172.0.x.x

Useful info about using iperf3 with IPv6 esnet/iperf#618 (comment)

Network info from Synology https://kb.synology.com/en-br/DSM/help/Virtualization/network?version=7

After I tested the performance, I found when starting iperf3 test on client vm and server vm, the host CPU (on NAS) usage reached to more than 90%, maybe that's why Synology won't add IPv4 vSwitch support, which means you can use internal vSwitch IPv6 but not recommanded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment