44 lines · bash
1#!/bin/bash2# SPDX-License-Identifier: GPL-2.03#4# Topology for Bond mode 1,5,6 testing5#6# +-------------------------------------+7# | bond0 |8# | + | Server9# | eth0 | eth1 eth2 | 192.0.2.1/2410# | +-------------------+ | 2001:db8::1/2411# | | | | |12# +-------------------------------------+13# | | |14# +-------------------------------------+15# | | | | |16# | +---+---------+---------+---+ | Gateway17# | | br0 | | 192.0.2.254/2418# | +-------------+-------------+ | 2001:db8::254/2419# | | |20# +-------------------------------------+21# |22# +-------------------------------------+23# | | | Client24# | + | 192.0.2.10/2425# | eth0 | 2001:db8::10/2426# +-------------------------------------+27 28source bond_topo_2d1c.sh29 30setup_prepare()31{32 gateway_create33 server_create34 client_create35 36 # Add the extra device as we use 3 down links for bond037 local i=238 ip -n ${s_ns} link add eth${i} type veth peer name s${i} netns ${g_ns}39 ip -n ${g_ns} link set s${i} up40 ip -n ${g_ns} link set s${i} master br041 ip -n ${s_ns} link set eth${i} master bond042 tc -n ${g_ns} qdisc add dev s${i} clsact43}44