Project

General

Profile

hub.sh

Sven Eckelmann, 11/02/2015 04:27 PM

Download (377 Bytes)

 
1
#! /bin/sh
2
USER="$(whoami)"
3
BRIDGE=br0
4
ETH=eth0
5

    
6
sudo ip link add "${BRIDGE}" type bridge
7
for i in `seq 1 2`; do
8
	sudo ip tuntap add dev tap$i mode tap user "$USER"
9
	sudo ip link set tap$i up
10
	sudo ip link set tap$i master "${BRIDGE}"
11
done
12

    
13
sudo ip link set "${BRIDGE}" up
14

    
15
sudo ip addr flush dev "${ETH}"
16
sudo ip link set "${ETH}" master "${BRIDGE}"
17
sudo dhclient "${BRIDGE}"