Mailinglist Archive: opensuse (1185 mails)

< Previous Next >
[opensuse] A KVM with two NICs - how to?
  • From: Arun Khan <knura9@xxxxxxxxx>
  • Date: Wed, 19 May 2010 19:39:15 +0530
  • Message-id: <AANLkTik-qJPJ_VCtoPrLaSapDiMm6XgqAjhUX_Ffm2YA@xxxxxxxxxxxxxx>
OS: OS 11.2 (64 bit) with stock kernel and 6GB RAM. br0 is defined
and bound to eth0, tap0, tap1. br0 is 192.168.1.69.

I have a script to start a KVM with two network interfaces. The
content of which is:

<kvm script>
qemu-kvm -vga cirrus -m 512 -boot d -cdrom
/mnt/transcend-1TB/ISO/debian/debian-testing-amd64-DVD-1.iso -hda
$KVM_DIR/vdisks/debian.vdd -hdd $KVM_DIR/vdisks/ba11_swap.vdd -net
nic,model=rtl8139,macaddr=${nic_mac_addr0} -net
tap,ifname=tap0,script=no,downscript=no -net
nic,model=rtl8139,macaddr=${nic_mac_addr1} -net
tap,ifname=tap1,script=no,downscript=no
</kvm script>

Where ${nic_mac_addr?} is generated by another script to give unique
MAC address to each interface.

This VM will act as a gateway to a set of other VMs that are on the
same VLAN. The idea is that NIC associated with tap0 will be on the
192.168.1.x network (and do NAT/Proxy) and NIC associated with tap1
will be 172.16.0.1/16 and be the gateway to other VMs.

The above script does not work. I am trying to install Debian
Testing as a guest OS directly from the ISO file. KVM initializes and
boots from the ISO file and shows the Debian installer screen. As
soon as I select an install option things break loose. The KVM SDL
window gets locked. The LEDs on all my ethernet switches start
flashing. I am not able to connect to other hosts on the LAN and the
same is true vice versa.

To see what is going on the LAN, I opened a terminal and started up
tcpdump. Doing CTRL-C has no effect. Traffic starts flowing only
after I "pkill -9 qemu-kvm" After the qemu-kvm process is killed then
I get some output on the tcpdump window (see below)

Any suggestion/pointers on how to setup a KVM with multiple NICs would
be appreciated.

<tcpdump>
# tcpdump -i eth0
tcpdump: WARNING: eth0: no IPv4 address assigned
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
^C

^C^C^C^C
^C^C^C^C^C^C^C^C^C17:46:35.002711 IP 192.168.1.35.mdns >
224.0.0.251.mdns: 0*- [0q] 2/0/0[|domain]

1 packets captured
2368261 packets received by filter
2355108 packets dropped by kernel
</tcpdump>

-- Arun Khan
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups