#!/bin/sh #export NETIO_NETMAP=/root/NETMAP /root/check_netmap.pl local_id=$(echo `head -n 1 /root/NETMAP` | cut -d ":" -f1) remote_id=$(echo `head -n 1 /root/NETMAP` | cut -d ":" -f2 | cut -d " " -f2) cd /root/ /root/wrapper -m /root/i86bi_linuxl2-upk9-ms.M -p 6000 -- -s 0 $local_id & sleep 5 for dir in /sys/class/net/*; do interface=$(echo $dir | cut -d "/" -f5) if [[ $interface == eth* ]]; then lastchr=${interface#${interface%?}} /usr/sbin/tunctl -t tap$lastchr /sbin/ifconfig $interface 0.0.0.0 promisc up /sbin/ifconfig tap$lastchr 0.0.0.0 promisc up /usr/sbin/brctl addbr br$lastchr /usr/sbin/brctl stp br$lastchr off /usr/sbin/brctl setfd br$lastchr 1 /usr/sbin/brctl sethello br$lastchr 1 /usr/sbin/brctl addif br$lastchr $interface /usr/sbin/brctl addif br$lastchr tap$lastchr /sbin/ifconfig br$lastchr up /root/iou2net.pl -t tap$lastchr -n /root/NETMAP -p $remote_id & ((remote_id++)) fi done