From: paolo pedaletti <paolo.pedaletti@gmail.com>
To: kvm@vger.kernel.org
Subject: networking setup problem
Date: Wed, 16 Jul 2008 11:09:44 +0200 [thread overview]
Message-ID: <487DBAD8.4000909@gmail.com> (raw)
Hi,
I hope this is the right ml to submit my problem.
Abstract: I can't setup 2 different network inside my VMs, one public
and one private.
Scheme:
eth0 ---------
---------| proxy |---eth1
| --------- |
H| |
O| eth0 --------- |
S|--------| web |--|eth1
T| --------- |
| |
| eth0 --------- |
|--------| db |---eth1
---------
this is a "classic" LAMP, sparse on 3 VM
1) front end, proxy (apache2 in reverse with mod-security)
2) application server, web (apache2 + php5)
3) database (mysql5)
(it's a test/backup environment)
each VM must have 2 network card:
eth0 on the local network, in bridge with the host physical eth0
eth1 on the virtual private network, for internal communications between
them
saying that, ... it doesn't work :-(
(linux ubuntu 8.04 2.6.24-19-generic, kvm-62)
these are the command lines:
kvm -name PROXY
-net nic,vlan=0,macaddr=00:18:BE:EF:17:2A,model=rtl8139
-net tap,vlan=0,ifname=tap0,script=./qemu-ifup.sh
-net nic,vlan=1,macaddr=00:18:BE:EF:17:2B,model=rtl8139
-net user,vlan=1,ifname=dmz0,script=./qemu-ifup.sh
-drive index=0,media=disk,if=scsi,file=./ubuntu-server.PROXY.root,boot=on
-drive index=1,media=disk,if=scsi,file=./ubuntu-server.PROXY.home
-drive index=2,media=disk,if=scsi,file=./ubuntu-server.PROXY.swap
kvm -name WEBAPP
-net nic,vlan=0,macaddr=00:18:BE:EF:17:1A,model=rtl8139
-net tap,vlan=0,ifname=tap0,script=./qemu-ifup.sh
-net nic,vlan=1,macaddr=00:18:BE:EF:17:1B,model=rtl8139
-net user,vlan=1,ifname=dmz0,script=./qemu-ifup.sh
-drive index=0,media=disk,if=scsi,file=./ubuntu-server.WEB.root,boot=on
-drive index=1,media=disk,if=scsi,file=./ubuntu-server.WEB.home
-drive index=2,media=disk,if=scsi,file=./ubuntu-server.WEB.swap
kvm -name DB
-net nic,vlan=0,macaddr=00:18:BE:EF:17:0A,model=rtl8139
-net tap,vlan=0,ifname=tap0,script=./qemu-ifup.sh
-net nic,vlan=1,macaddr=00:18:BE:EF:17:0B,model=rtl8139
-net user,vlan=1,ifname=dmz0,script=./qemu-ifup.sh
-drive index=0,media=disk,if=scsi,file=./ubuntu-server.DB.root,boot=on
-drive index=1,media=disk,if=scsi,file=./ubuntu-server.DB.home
-drive index=2,media=disk,if=scsi,file=./ubuntu-server.DB.swap
$ cat /etc/qemu-ifup
-----------------8<-----------------8<----------------8<--------------
#!/bin/sh
set -x
echo "Executing $0"
case $1 in
tap*) echo "tun network"
BRIDGE=br0
if [ -z "$(ifconfig $BRIDGE)" ] ; then
/usr/sbin/brctl addbr $BRIDGE
dhclient $BRIDGE
fi
/usr/sbin/tunctl -u `whoami` -t $1
echo "Bringing up $1 for bridged mode..."
/sbin/ifconfig $1 0.0.0.0 promisc up
/sbin/ip link set $1 up
sleep 0.5s
echo "Adding $1 to br0..."
/usr/sbin/brctl addif $BRIDGE $1
;;
dmz*) echo "dmz network"
BRIDGE=br1
if [ -z "$(ifconfig $BRIDGE)" ] ; then
/usr/sbin/brctl addbr $BRIDGE
dhclient $BRIDGE
fi
/usr/sbin/tunctl -u `whoami` -t $1
echo "Bringing up $1 for bridged mode..."
/sbin/ifconfig $1 0.0.0.0 promisc up
/sbin/ip link set $1 up
sleep 0.5s
echo "Adding $1 to $BRIDGE..."
/usr/sbin/brctl addif $BRIDGE $1
;;
*) echo "Error: no interface specified or interface '$1' invalid"
exit 1
esac
-----------------8<-----------------8<----------------8<--------------
eth0 works for all the VM, eth1 doesn't.
constrain: no dhcp, all static ip
any suggestion?
thank you in advance.
--
Paolo Pedaletti
next reply other threads:[~2008-07-16 9:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-16 9:09 paolo pedaletti [this message]
2008-07-16 14:00 ` networking setup problem Uri Lublin
2008-07-20 23:56 ` Paolo Pedaletti
2008-07-21 5:07 ` David Mair
2008-07-21 5:22 ` Lynn Kerby
2008-07-21 16:23 ` David Mair
2008-07-21 5:14 ` Lynn Kerby
2008-07-21 6:43 ` paolo pedaletti
2008-07-17 0:02 ` David Mair
2008-07-20 23:52 ` Paolo Pedaletti
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=487DBAD8.4000909@gmail.com \
--to=paolo.pedaletti@gmail.com \
--cc=kvm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox