#!/bin/bash kvm /storage/kvm/etch-pooh.img -m 82 \ -net nic,macaddr=52:54:00:12:34:52 \ -net socket,mcast=230.0.0.1:54321 & sleep 2 kvm /storage/kvm/etch-prasatko.img -m 82 \ -net nic,macaddr=52:54:00:12:34:53 \ -net socket,mcast=230.0.0.1:54321 & sleep 2 kvm /storage/kvm/lenny-kralicek.img -m 82 \ -net nic,macaddr=52:54:00:12:34:54 \ -net socket,mcast=230.0.0.1:54321 & sleep 2 # nastavi tap0 tunctl -t tap0 ip addr add 192.168.68.1/29 dev tap0 ip link set dev tap0 up ip route add 192.168.69.0/24 via 192.168.68.2 # udela router echo 1 >/proc/sys/net/ipv4/ip_forward iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE kvm /storage/kvm/etch-krystufek.img -m 82 \ -net nic,vlan=0,macaddr=52:54:00:12:34:51 \ -net socket,vlan=0,mcast=230.0.0.1:54321 \ -net nic,vlan=1,macaddr=52:54:00:12:34:50 \ -net tap,vlan=1,ifname=tap0,script=no \ -net nic,vlan=2,macaddr=52:54:00:12:34:49 \ -net user,vlan=2 # uz nebude routovat iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE echo 0 >/proc/sys/net/ipv4/ip_forward # zrusi tap0 ip link set dev tap0 down ip addr del 192.168.68.1/29 dev tap0 tunctl -d tap0