#!/bin/sh wire() { ip link add $1 \ type veth \ peer name $2 } set -x # Not using this... buildhub() { wire hub0 ep0 wire hub1 ep1 wire hub2 ep2 wire hub3 ep3 wire hub4 ep4 wire hub5 ep5 wire hub6 ep6 wire hub7 ep7 wire hub8 ep8 wire hub9 ep9 wire hubA epA wire hubB epB wire hubC epC wire hubD epD wire hubE epE wire hubF epF brctl addbr hub brctl addif hub hub0 brctl addif hub hub1 brctl addif hub hub2 brctl addif hub hub3 brctl addif hub hub4 brctl addif hub hub5 brctl addif hub hub6 brctl addif hub hub7 brctl addif hub hub8 brctl addif hub hub9 brctl addif hub hubA brctl addif hub hubB brctl addif hub hubC brctl addif hub hubD brctl addif hub hubE brctl addif hub hubF ip addr add 222.0.0.1 dev hub } # This is simpler... buildtaps() { ip tuntap add ep0 mode tap ip tuntap add ep1 mode tap ip tuntap add ep2 mode tap ip tuntap add ep3 mode tap ip tuntap add ep4 mode tap ip tuntap add ep5 mode tap ip tuntap add ep6 mode tap ip tuntap add ep7 mode tap ip tuntap add ep8 mode tap ip tuntap add ep9 mode tap ip tuntap add epA mode tap ip tuntap add epB mode tap ip tuntap add epC mode tap ip tuntap add epD mode tap ip tuntap add epE mode tap ip tuntap add epF mode tap } buildtaps ip addr add 80.99.99.99 dev ep0 ip addr add 81.99.99.99 dev ep1 ip addr add 82.99.99.99 dev ep2 ip addr add 83.99.99.99 dev ep3 ip addr add 84.99.99.99 dev ep4 ip addr add 85.99.99.99 dev ep5 ip addr add 86.99.99.99 dev ep6 ip addr add 87.99.99.99 dev ep7 ip addr add 88.99.99.99 dev ep8 ip addr add 89.99.99.99 dev ep9 ip addr add 90.99.99.99 dev epA ip addr add 91.99.99.99 dev epB ip addr add 92.99.99.99 dev epC ip addr add 93.99.99.99 dev epD ip addr add 94.99.99.99 dev epE ip addr add 95.99.99.99 dev epF