Skip to contentSkip to conversation

Two network interfaces ?

Qemu-devel Aziz Kezzou 4 participants 5 messages Apr 24, 2005 – Apr 26, 2005

lore
Share & tools
lore
#0 lore raw

Hi all,
I am using QEMU with tun/tap on a linux host.
I would like to have qemu emulate two network interfaces for the guest (FreeBSD).

Any hints on how to do that ?
Thks,
-aziz

#2 lore raw
Quoted 14 lines

-nics 2

Quoted 10 lines · Aziz Kezzou

Hi all,
I am using QEMU with tun/tap on a linux host.
I would like to have qemu emulate two network interfaces for the guest (FreeBSD).

Any hints on how to do that ?
Thks,
-aziz

Thanks, I just figured out how to do this ;-)
Here is my /etc/qemu-ifup script in case someone reads this thread :
===================================================
#!/bin/sh
if [ "$1" = "tun0" ]
then
sudo /sbin/ifconfig $1 192.168.0.1
else
sudo /sbin/ifconfig $1 192.168.1.1
fi
====================================================

Greetings,
-aziz

#3 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

| Thanks, I just figured out how to do this ;-)
| Here is my /etc/qemu-ifup script in case someone reads this thread :

A little more generic, if you want more nics or use more than 1 VM.

#!/bin/sh
INTERF="$1"
NUM=$(echo $INTERF | sed 's/[^0-9]//g')
sudo /sbin/ifconfig $INTERF 192.168.$NUM.1

- --
Flavio Visentin

|                     \|||/
|                    @/0.0\@
|                     \ - /
+------------------oOOo---oOOo------------------

There are only 10 types of people in this world:
those who understand binary, and those who don't.

GPG Key: http://www.zipman.it/gpgkey.asc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCbVlbusUmHkh1cnoRApcSAJ0dEQo3OuAuHFps/1NuT46LX3PMnACfYuHG vILcsQOj8lFN9ViCAZNL58c=
=g/cM
-----END PGP SIGNATURE-----

#4 lore raw
Quoted 5 lines · Flavio Visentin

| Thanks, I just figured out how to do this ;-)
| Here is my /etc/qemu-ifup script in case someone reads this thread :

A little more generic, if you want more nics or use more than 1 VM.

VDE (http://vde.sf.net) is IMHO the best way to do multiple VMs. Whether it's suitable for the OP is anybody's guess.

Ross