With Qemu, 2 nics per machine, one for internet, other for LAN.
Ssh on 1002x ports.
As root:
Code:
ip link add virt-br0 type bridge
ip link set virt-br0 up
ip tuntap add tap0 mode tap group netdev
ip tuntap add tap1 mode tap group netdev
ip tuntap add tap2 mode tap group netdev
ip link set tap0 up
ip link set tap1 up
ip link set tap2 up
# connect tun/tap interfaces with bridge
ip link set tap0 master virt-br0
ip link set tap1 master virt-br0
ip link set tap2 master virt-br0
As user:
Code:
#Machine 1
qemu-system-x86_64 -name PC-1 -m 2048 -smp cpus=1 -enable-kvm -netdev user,ipv6=off,id=net0,hostfwd=tcp::10021-:22 -device e1000,netdev=net0 -netdev tap,id=net1,ifname=tap0,script=no,downscript=no -device e1000,netdev=net1,mac=52:54:00:00:00:00 m1.img
#Machine 2
qemu-system-x86_64 -name PC-2 -m 2048 -smp cpus=1 -enable-kvm -netdev user,ipv6=off,id=net0,hostfwd=tcp::10022-:22 -device e1000,netdev=net0 -netdev tap,id=net1,ifname=tap1,script=no,downscript=no -device e1000,netdev=net1,mac=52:54:00:00:00:01 m2.img
#Machine 3
qemu-system-x86_64 -name PC-3 -m 2048 -smp cpus=1 -enable-kvm -netdev user,ipv6=off,id=net0,hostfwd=tcp::10023-:22 -device e1000,netdev=net0 -netdev tap,id=net1,ifname=tap2,script=no,downscript=no -device e1000,netdev=net1,mac=52:54:00:00:00:02 m3.img