[Pkg-vsquare-changes] r100 - vde2/trunk/debian
Filippo Giunchedi
filippo at alioth.debian.org
Fri May 4 13:51:46 UTC 2007
Author: filippo
Date: 2007-05-04 13:51:46 +0000 (Fri, 04 May 2007)
New Revision: 100
Modified:
vde2/trunk/debian/README.Debian
Log:
updated README.Debian with improved/corrected HOWTOs
Modified: vde2/trunk/debian/README.Debian
===================================================================
--- vde2/trunk/debian/README.Debian 2007-05-04 13:44:23 UTC (rev 99)
+++ vde2/trunk/debian/README.Debian 2007-05-04 13:51:46 UTC (rev 100)
@@ -21,16 +21,25 @@
iface vde0 inet manual
vde2-switch -
- will start a vde_switch on virtual interface vde0 at every boot, see ifup(8).
+ starts a vde_switch on virtual interface vde0 at every boot, see ifup(8).
In this case vde0 is used for future reference, for example management
socket can be accessed from /var/run/vde2/vde0.mgmt
* vde2-slirp -|<parameters>
Start slirp interface connected to the VDE switch with slirpvde command.
- The additional parameter might be -dhcp for DHCP
- server or -netaddr to specify the network address (default 10.0.2.0).
+ The additional parameter might be -dhcp for DHCP server
+ or -netaddr to specify the network address (default 10.0.2.0).
Call `slirpvde --help' for description.
+ Please note that slirp is a virtual router for VDE, it is commonly used
+ as a mean to connect the virtual network to the outside world.
+ Slirp does not require root access, kernel ip forwarding or iptables
+ configuration. Tap requires root access, provide any kind of routing
+ as it were a real interface and it is faster.
+ Do not use tap and slirp together in the same VDE LAN provided
+ you know exactly what you are doing. If you set up a slirp with dhcp
+ on a tap and you autoconfigure the interface it will become the
+ default route for the entire system.
* vde2-plug <dpipe_arg2>
@@ -75,13 +84,13 @@
vde2-switch -
If vde2-slirp option is used, the connection works without NAT. The VDE can
- be also started with non-root privileges:
+ be also started with non-root privileges on the remote machine:
On local system:
iface tap0 inet dhcp
vde2-switch -
- pre-up ssh user at remote.machine.org LD_PRELOAD=/usr/lib/vde2/libvdetap.so vde_switch -s /tmp/vde.ctl -p /tmp/vde_switch.pid -d
+ pre-up ssh user at remote.machine.org vde_switch -s /tmp/vde.ctl -p /tmp/vde_switch.pid -d
pre-up sleep 1
pre-up ssh user at remote.machine.org slirpvde -D -s /tmp/vde.ctl -p /tmp/slirpvde.pid -d
vde2-plug ssh user at remote.machine.org vde_plug /tmp/vde.ctl
@@ -95,30 +104,22 @@
The VDE is very useful for connecting the QEMU virtual machines.
- In this example each QEMU's systems have two interfaces. The first is
- external interface with internet access and DHCP autoconfiguration. The
- second interface is for internal networking, so virtual systems can access
- each others and will be available from host system.
+ In the first example we use VDE as a standard VLAN connected to a
+ tap interface.
- Enabling the VDE networking.
+ Enabling the VDE networking using tap.
- 1. Configure tap1 and tap2 interface:
+ 1. Configure tap0
- auto tap1
- iface tap1 inet dhcp
- vde2-switch -
- vde2-slirp -dhcp
-
- auto tap2
- iface tap2 inet static
+ auto tap0
+ iface tap0 inet static
address 10.0.3.1
netmask 255.255.255.0
vde2-switch -
- 2. Start interfaces:
+ 2. Start the interface:
- # ifup tap1
- # ifup tap2
+ # ifup tap0
3. Add the user to vde2-net group:
@@ -139,15 +140,11 @@
debian1# cat > /etc/network/interfaces << END
auto lo
- iface lo inet loopback
auto eth0
- iface eth0 inet dhcp
-
- auto eth1
- iface eth1 inet static
- address 10.0.3.101
- netmask 255.255.255.0
- broadcast 10.0.3.255
+ iface eth0 inet static
+ address 10.0.3.101
+ netmask 255.255.255.0
+ broadcast 10.0.3.255
END
debian2# cat > /etc/network/interfaces << END
@@ -155,13 +152,10 @@
iface lo inet loopback
auto eth0
- iface eth0 inet dhcp
-
- auto eth1
- iface eth1 inet static
- address 10.0.3.102
- netmask 255.255.255.0
- broadcast 10.0.3.255
+ iface eth0 inet static
+ address 10.0.3.102
+ netmask 255.255.255.0
+ broadcast 10.0.3.255
END
5. Check if the systems are available:
@@ -169,10 +163,65 @@
# ping 10.0.3.101
# ping 10.0.3.102
+ 6. Configure the routing/masquerading/bridging on the host computer
+ for tap0 as you do on any other interface.
+
+ QEMU-Slirp
+
+ 1. Configure vde0
+
+ auto vde0
+ iface vde0 inet manual
+ vde2-switch -
+ vde2-slirp -dhcp
+
+ 2. Start the interface:
+
+ # ifup vde0
+
+ 3. Add the user to vde2-net group:
+
+ # adduser <user> vde2-net
+
+ 3. Start the QEMUs with different MAC addresses:
+
+ $ vdeq qemu -m 660 -net nic,vlan=1,macaddr=52:54:00:12:01:00
+ -net vde,vlan=1,sock=/var/run/vde2/vde0.ctl
+ -boot c -hda Debian1.img
+
+ $ vdeq qemu -m 660 -net nic,vlan=1,macaddr=52:54:00:12:02:00
+ -net vde,vlan=1,sock=/var/run/vde2/vde0.ctl
+ -boot c -hda Debian2.img
+
+ 4. Configure the network inside QEMUs' virtual systems:
+
+ debian1# cat > /etc/network/interfaces << END
+ auto lo
+ iface lo inet loopback
+ auto eth0
+ iface eth0 inet dhcp
+ END
+
+ debian2# cat > /etc/network/interfaces << END
+ auto lo
+ iface lo inet loopback
+ auto eth0
+ iface eth0 inet dhcp
+ END
+
+ 5. Check if the systems can reach their default route:
+ debian1# ping 10.0.2.2
+ debian2# ping 10.0.2.2
+ 6: Try a service on a remote system
+ debian1# ssh your.main.server
+
+The virtual system are on the same network but they are on a masqueraded
+network.
+
+
You can also start the VDE networking without root privileges:
- $ LD_PRELOAD=/usr/lib/vde2/libvdetap.so vde_switch -s /tmp/vde1.ctl -d
- $ nohup slirpvde -s /tmp/vde1.ctl -dhcp &
+ $ vde_switch -s /tmp/vde1.ctl -d
$ vdeq qemu -net nic,vlan=1,macaddr=52:54:00:12:01:00
-net vde,vlan=1,sock=/tmp/vde1.ctl
-boot c -hda Debian1.img
@@ -182,13 +231,31 @@
In this case the networking is available only inside virtual machines.
+ It is possible to start a slirpvde server before the Qemu machines:
+ $ vde_switch -s /tmp/vde1.ctl -d
+ $ nohup slirpvde -s /tmp/vde1.ctl -dhcp &
+ $ vdeq qemu -net nic,vlan=1,macaddr=52:54:00:12:01:00
+ -net vde,vlan=1,sock=/tmp/vde1.ctl
+ -boot c -hda Debian1.img
+ $ vdeq qemu -net nic,vlan=1,macaddr=52:54:00:12:02:00
+ -net vde,vlan=1,sock=/tmp/vde1.ctl
+ -boot c -hda Debian2.img
+ These machines can auto-configure their interfaces using the dhcp server
+ on slirpvde and have access to the "outside world".
+ Slirp emulates a masqueraded subnetwork: TCP-IP client programs work
+ transparently while port forwarding is needed for server access
+ (see slirpvde man page for further details).
+
Management console
-----------------
You can connect to remote console with unixterm command:
$ unixterm /var/run/vde2/tap0.mgmt
+
+ where tap0 is the name of the interface.
+ -- Piotr Roszatycki <dexter at debian.org> Thu, 14 Dec 2006 10:22:19 +0100
+ -- Renzo Davoli <renzo at cs.unibo.it> Fri Apr 20 19:33:27 +0200
- -- Piotr Roszatycki <dexter at debian.org> Thu, 14 Dec 2006 10:22:19 +0100
More information about the Pkg-vsquare-changes
mailing list