Skip to content

Instantly share code, notes, and snippets.

@mrozo
mrozo / iperf3_loopback.sh
Last active January 17, 2025 20:06 — forked from pkorpine/iperf3_loopback.sh
Create external loopback between two network interfaces
#!/bin/sh
# Scripted from http://serverfault.com/questions/127636/force-local-ip-traffic-to-an-external-interface
DEV_0="ens6f0"
DEV_1="ens6f1"
MAC_0=`ifconfig $DEV_0 | tr -s '\t' ' ' | grep -oE 'ether[ ]+([0-9a-f]{2}:)+[0-9a-f]{2}' | cut -d ' ' -f2`
MAC_1=`ifconfig $DEV_1 | tr -s '\t' ' ' | grep -oE 'ether[ ]+([0-9a-f]{2}:)+[0-9a-f]{2}' | cut -d ' ' -f2'`
IP_0="192.168.100.1"
IP_1="192.168.101.1"
FAKE_0="192.168.102.1"