,dopo aver tentato almeno 20 guide inutili...
ecco la soluzione
Codice: Seleziona tutto
#!/bin/sh
USER=1000
IP=$(/sbin/ifconfig eth0 | awk '/inet addr:/ {print substr($2, 6)}')
BCAST=$(/sbin/ifconfig eth0 | awk '/inet addr:/ {print substr($3, 7)}')
NETMASK=$(/sbin/ifconfig eth0 | awk '/inet addr:/ {print substr($4, 6)}')
DEFGW=$(/sbin/route -n | awk '/^0\.0\.0\.0/ {print $2}')
echo "IP=$IP, BCAST=$BCAST, NETMASK=$NETMASK, DEFGW=$DEFGW"
start_tap()
{
TAP="tap$1"
/sbin/ifconfig $TAP 1>/dev/null 2>/dev/null
if [ $? -ne 0 ]; then
echo "Creating device $TAP..."
TAP=$(tunctl -b -t $TAP -u $USER)
/sbin/ifconfig $TAP 0.0.0.0 promisc up
fi
}
/sbin/modprobe tun
/sbin/modprobe bridge
echo "Setting up bridge br0..."
brctl addbr br0
/sbin/ifconfig eth0 0.0.0.0 promisc up
/sbin/ifconfig br0 $IP netmask $NETMASK broadcast $BCAST up
brctl stp br0 off
brctl setfd br0 1
brctl sethello br0 1
brctl addif br0 eth0
for i in 0 1 2 3 4; do
start_tap $i
brctl addif br0 tap$i
done
/sbin/route add default gw $DEFGWeseguito lo script avviate nel sistema ospite
la configurazione rete usando un ip valido
della vostra stessa sottorete(es se voi avete
192.168.0.2 metterete 192.168.0.3 o.4)
a breve aggiorno la guida sul mio sito.
p.s=sto testando win2008 sotto kvm,una scheggia
rispetto a vbox e vmware!!

