parent
7e2f870bb6
commit
496e0a6505
@ -1,17 +1,17 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQJNBAABCgA3FiEEm8dazQnvu0U1Gdmc9s+lqZ57WVcFAmCWy8sZHGd6YW11ZGlv
|
||||
QGxpYnJlbWV4Lm9yZy5teAAKCRD2z6WpnntZV/T7D/9N+sJbmCQFm9Zegb+SmXYW
|
||||
2BUVqM9AUMZL73jgKXVS0HP7Zk++IZ6MpeAi3kCLMvQkc1iTohjVdr+eHBUbgdfZ
|
||||
oEr/5zjKEXi9jLnwZFHGxgGY0pLCANr8MVvCtBJ1IZZkH12HE6USyEkkkrkiNNqq
|
||||
bvQel5STTSEAawxiL5UuvzYgJM7OQoNb/XXdKF11xMzTPE8Mk9Jz0kY7MwLV8kJi
|
||||
EHHqMfxwSf6t3Ud9jtiahjZN9Zrtwh7CeJSdjOp6svMusF/27DlgIhyRl5RE2kwW
|
||||
kUHbnyJl9+IZ14m3dSqd/ZYIjNkOlclfnIOF+z1fxUehuNpuaGfO0oOEBF18/OLO
|
||||
sCb6DHokeHPhaVxiXiNRJTN4ISP1iXx3ZFHCnuKLXP5nzm6lagPY8hr3pvw9lK4E
|
||||
x8vTY0S3ijOYlNL5E5+Yprs3PYKq4xFaJFTiLMJS9wbUhqWn8sZn6vRsTQAwLBID
|
||||
qkPEPBra1bbhjkhKpzBRjlP9JhIzTWWvgH95Pj6dWCVf7fVkOuLj/ABNourdUeKw
|
||||
2IhjiIynUuPl+i/N3NeyMfbTz+MxnROg3YIP0stsMjZjzIB8roSdDSUgRjeJ6oju
|
||||
oRhyj7exE81eXxWzDuEcOhMnkHiA1ep2umn3H5ZCY+qekoO9boh/i06MpNyQ6+Y0
|
||||
9sVPTYqnhZrQlh6KCnnSoQ==
|
||||
=lPnt
|
||||
iQJNBAABCgA3FiEEm8dazQnvu0U1Gdmc9s+lqZ57WVcFAmCW5HkZHGd6YW11ZGlv
|
||||
QGxpYnJlbWV4Lm9yZy5teAAKCRD2z6WpnntZVwuuD/46kbvxePZPDB8jMA7wslUA
|
||||
a3/dzQkSZWCqUzRfllfo7W2pUuvrmFutVsdkrYn5nxDxmaE6bf1zRuqmDqyAjdWu
|
||||
Tpg5gTCHlTzX7IwmuzPVUzTUF48lduGfEC7L+C6cLpK5XM57OlChl5mrQ6PKkUXy
|
||||
QxqN1JBnwEFgkZjgOnlYZggiwekRd3+mDrAO3EA7SlP5tCH1qHppXyjYER3zdQnf
|
||||
9GZ4/gsYQk9tG2kOTSVO/6I8HfLXsoDZrPePw/oldvl2/V/zPDtXRM1FB2nk1PfH
|
||||
wS5HiTjgC5zyWnG4+9GleT52XD8E2IM6o7gQbIXbHePqJaMGqshrAm2Pa9ByoDfO
|
||||
6ba9D9hYjs8bF95CsDjBJIsaLyakA4O6kbu/o7xFMZhpMSc1f/K9UxWxUm4wWH7c
|
||||
TZwYhfI9kNOL0coA3/k2RZjTOEzS0cglVwr5fAdbxSNRE0v8S+2MvvHSgAaxHVoo
|
||||
ujRoRuxk+uXg69aUqYlcuFgyO1fXVLSiE3kEtvW8OSIERFDoTCftH6YNr5LsBWxx
|
||||
i8kVxebQ5kL20tE1Pg49SuapGqDA6/zqd8Bkw3xpsuqtbCXf9Vq7pGeeE91O/pJw
|
||||
9DjK+X1famRU+qxQkaI4B5joeHa+BTAIhmepXGD2z/fZukIjYqCjUvS2do40A3/N
|
||||
I2daZmHsAYlokHM5SM4a0A==
|
||||
=Tm+E
|
||||
-----END PGP SIGNATURE-----
|
||||
|
Binary file not shown.
@ -1,17 +1,17 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQJNBAABCgA3FiEEm8dazQnvu0U1Gdmc9s+lqZ57WVcFAmCWy8sZHGd6YW11ZGlv
|
||||
QGxpYnJlbWV4Lm9yZy5teAAKCRD2z6WpnntZVyzkEAC8Y59gJziOeZKFGVgy+ZVx
|
||||
yAQOhsdfxPufqHEYymcCLBopprAk++Icp2KsGXifFIBmkvJsYcrwKyfjf8GL+n1G
|
||||
Y3p5b4jfd1Ezjefd37Ty+caYbAVtC1k+8whsL1c4j/UqRM9/dJGYHKXgZtIHKlxa
|
||||
OtmPEK/4UQ+wjkJVwEyTciZE1+zIxW0MR5wv/hwjnpq+/+9UV6sq9uUGt3scFDes
|
||||
qJnvX33GSso4m0j9jwDP5sv2/BJcjVNwK1BSC4BESN7KeQ0sGVvBWRbxrPBRBaEi
|
||||
3+DG0IUpxnTJHkoRUu+a0cxQr7Q0Z5Nx+UPK0E3AIturBgZoFfEsV5DEUKJmOT36
|
||||
zx6FtcaY5O5pCixHHLL/EnrhctfGn9Df0NV5jptDYXptZg9CtFtCzZi1UhWSbQGZ
|
||||
Sh2ywAsrekg3ztevPTMqMXsTvDHQuqqCgt19npxBp1EP1pG3bSS8RrSbyuvRUYnm
|
||||
/XckncJfsOrVCkmOLYnZLSxAbguDQhoX+lEuY7oHCMqn/blKMUiB6ztygUoJ1+My
|
||||
ibE5wyS4gAYxiCQuwfoBHfpqb8kjkWNHtNiIKBUPzZaO+9Pn53Rvu3Dv8y4umRFg
|
||||
QQoCQDOyTQuuqdm0R57b6ecXWxgSgrYR6qFmyzRB+g/8hrWfLfbcNH/iM5HgpLvu
|
||||
wC+zulZIP+FATtb5ge56GQ==
|
||||
=1ceq
|
||||
iQJNBAABCgA3FiEEm8dazQnvu0U1Gdmc9s+lqZ57WVcFAmCW5HkZHGd6YW11ZGlv
|
||||
QGxpYnJlbWV4Lm9yZy5teAAKCRD2z6WpnntZV9vuD/9Y5t9vm3KT+hFe4/VR4KpX
|
||||
VJdeCw/LjxeZMyz3pJClzUbZSzE+PNN1wEeRkIad3gAAnLGa4TTNq34AwOwHHnwS
|
||||
NHmPei+yJiFI8ThRRHqwiDA6Bvyc6L5goxEXruu99C+WmtmhwF0skxSYQbOf9CF0
|
||||
IbhnpjfT0mA/gFTW8bumbk5NlmiNKRCrBU8Rw7QUmxP9GAkzPtWMBnwgB4O9lvy+
|
||||
axhNIi7heVvAwLAFsfQjKjfjf8Ba82SazmKRAuI77SW53hvz+7mtfTJlYViP5Z7C
|
||||
gOiELSGNWcLLHY9l3GdRPlVCMVGcYW3AcXqKapgsTOtKiFxlG90yQ2II/VI+mYVL
|
||||
9P61i0WtHZqp55XLQZqdXOA6NymD9qlDarDINXw2BIC13nd2fhE+4UsOblmYVg3h
|
||||
iSfq8gGLMgj5zdIQgVfrYj8e3TC09dONsJhYUH8rtW8u0RiEu5vUm5R9fkh+wsxP
|
||||
M4f8sIhomvROJbv7nCTPnLoZwyGIqzHrExkfQ7GqG8R50RMbvVRQinC82si0xqK3
|
||||
OhqfF13LZV4RaUll7D6FfhF0ssWwcyJu0Vf5JgDOUjsVRDUrPrxsPrOmiUoajwdS
|
||||
N9iecR5KNCWj5RrAirpQ4HJeSopH9QjKl7QArGllHiXayyvhZlWGT/REbnksBIB+
|
||||
RCFDWPDPzO2ngV/egeFFig==
|
||||
=muvK
|
||||
-----END PGP SIGNATURE-----
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,19 +0,0 @@
|
||||
# HOW TO EDIT THIS FILE:
|
||||
# The "handy ruler" below makes it easier to edit a package description. Line
|
||||
# up the first '|' above the ':' following the base package name, and the '|'
|
||||
# on the right side marks the last column you can put a character in. You must
|
||||
# make exactly 11 lines for the formatting to be correct. It's also
|
||||
# customary to leave one space after the ':'.
|
||||
|
||||
|-----handy-ruler------------------------------------------------------|
|
||||
vde: vde (virtual distributed ethernet)
|
||||
vde:
|
||||
vde: VDE is a virtual network that can be spawned over a set of physical
|
||||
vde: computer over the Internet.
|
||||
vde: VDE connects together: (1) real GNU-linux boxes (tuntap) (2) virtual
|
||||
vde: machines: UML-User Mode Linux, qemu, bochs, MPS.
|
||||
vde:
|
||||
vde:
|
||||
vde:
|
||||
vde: Homepage: https://github.com/virtualsquare/vde-2
|
||||
vde:
|
@ -1,19 +0,0 @@
|
||||
# HOW TO EDIT THIS FILE:
|
||||
# The "handy ruler" below makes it easier to edit a package description. Line
|
||||
# up the first '|' above the ':' following the base package name, and the '|'
|
||||
# on the right side marks the last column you can put a character in. You must
|
||||
# make exactly 11 lines for the formatting to be correct. It's also
|
||||
# customary to leave one space after the ':'.
|
||||
|
||||
|-----handy-ruler------------------------------------------------------|
|
||||
vde: vde (virtual distributed ethernet)
|
||||
vde:
|
||||
vde: VDE is a virtual network that can be spawned over a set of physical
|
||||
vde: computer over the Internet.
|
||||
vde: VDE connects together: (1) real GNU-linux boxes (tuntap) (2) virtual
|
||||
vde: machines: UML-User Mode Linux, qemu, bochs, MPS.
|
||||
vde:
|
||||
vde:
|
||||
vde:
|
||||
vde: Homepage: https://github.com/virtualsquare/vde-2
|
||||
vde:
|
@ -1,4 +0,0 @@
|
||||
VDE is a virtual network that can be spawned over a set of physical
|
||||
computer over the Internet.
|
||||
VDE connects together: (1) real GNU-linux boxes (tuntap) (2) virtual
|
||||
machines: UML-User Mode Linux, qemu, bochs, MPS.
|
@ -1,284 +0,0 @@
|
||||
=============================================================================
|
||||
This HOWTO originally appeared on:
|
||||
http://lists.gnu.org/archive/html/qemu-devel/2004-10/msg00067.html
|
||||
=============================================================================
|
||||
|
||||
Using VDE with Qemu HOWTO
|
||||
by Jim Brown
|
||||
5 Oct 2004
|
||||
Version 0.2
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Introduction
|
||||
Copyright
|
||||
What is qemu?
|
||||
What is VDE?
|
||||
|
||||
Configuring and Installing VDE
|
||||
Installation
|
||||
vdeq & vdeqemu
|
||||
|
||||
User-mode networking
|
||||
How to enable user-mode networking
|
||||
Firewall configuration
|
||||
|
||||
Slirp (rootless) networking
|
||||
What is slirp networking?
|
||||
How to enable slirp networking?
|
||||
|
||||
Setting up qemu
|
||||
How to set up the guest OS
|
||||
|
||||
Credits
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Introduction
|
||||
|
||||
Copyright
|
||||
|
||||
Copyright (c) 2004 Jim Brown.
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.2
|
||||
or any later version published by the Free Software Foundation;
|
||||
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
|
||||
Texts. A copy of the license is available at http://www.gnu.org/licenses/fdl.txt
|
||||
|
||||
What is qemu?
|
||||
|
||||
Qemu is a FAST! processor emulator by Fabrice Bellard, available at
|
||||
http://fabrice.bellard.free.fr/qemu/. It is capable of emulationg the x86 and
|
||||
PowerPC processors with support for other processors on the way. The original
|
||||
purpose of qemu was to allow running x86-specific Linux applications, such as
|
||||
WINE or DosEmu, on non-x86 systems. However, qemu has expanded into becoming
|
||||
a full-fledged emulator. On the x86 side, it is capable of running Linux,
|
||||
MS-DOS, Windows 95/98/Me, Windows NT/2k, Windows XP, Solaris, OpenBSD, and
|
||||
FreeBSD. See http://fabrice.bellard.free.fr/qemu/ossupport.html for the full
|
||||
listing.
|
||||
|
||||
This howto assumes that you have already installed and set up qemu.
|
||||
|
||||
What is VDE?
|
||||
|
||||
VDE is short for Virtual Distributed Ethernet. VDE, written by
|
||||
Renzo Davoli, is based off of uml_switch by Jeff Dike. It is available at
|
||||
http://sourceforge.net/projects/vde/. It has many uses, the main one providing
|
||||
support for networking with emulated computers. (Not just qemu, but support
|
||||
for user-mode linux and Bochs also exists). VDE must be set up and installed by
|
||||
root, but the programs which use it do not need root privligies.
|
||||
|
||||
This howto will walk you through the simple process of installing
|
||||
VDE and setting up qemu to use it.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Configuring and Installing VDE
|
||||
|
||||
Installation
|
||||
|
||||
You may obtain the source code at http://sourceforge.net/projects/vde/.
|
||||
The version of VDE which I used was 1.4.1, but this HOWTO should apply to all
|
||||
versions.
|
||||
|
||||
Once you have downloaded the source code, extract it. I assume you
|
||||
will have extracted it to /space/vde. Go into that directory, and simply type
|
||||
"make" followed by "make install". Now you should have vde_switch in /usr/bin.
|
||||
|
||||
vdeq & vdeqemu
|
||||
|
||||
Now cd into the qemu directory. Type "make". This will build vdeq.
|
||||
Qemu on its own only supports full networking with tuntap, which requires
|
||||
root priviliges or an exposed /dev/net/tun. There is a -user-net option, but
|
||||
that is not as useful as full networking. In order for qemu to use VDE, it must
|
||||
be passed the file descriptor for a tun device. Futhermore the tun device itself
|
||||
must already be configured to use VDE. vdeq sets this up and passes it to qemu
|
||||
via the -tun-fd switch.
|
||||
|
||||
There is no "make install". Instead, you just manually copy vdeq to
|
||||
/usr/bin. It might also be helpful to copy or link vdeq to vdeqemu. vdeq
|
||||
requires that the location of the qemu binary be passes to it as the first
|
||||
command line parameter, but vdeqemu only needs the options you want to pass to
|
||||
qemu. vdeqemu will locate the qemu binary itself (this requires that you install
|
||||
qemu system-wide or have the qemu directory in your PATH).
|
||||
|
||||
For example if you have:
|
||||
vdeq qemu -hda /mnt/myimage -m 64 -boot a
|
||||
|
||||
you can shorten this into
|
||||
|
||||
vdeqemu -hda /mnt/myimage -m 64 -boot a
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
User-mode Networking
|
||||
|
||||
How to enable user-mode networking
|
||||
|
||||
The following commands will need to be run as root:
|
||||
|
||||
# vde_switch -tap tap0 -daemon
|
||||
|
||||
If you need to run a sniffer, just in case you want to analyze the traffic,
|
||||
you can also run it like this:
|
||||
|
||||
# vde_switch -hub -tap tap0 -daemon
|
||||
|
||||
(The -hub option is not available for version 1.4.1 of VDE, you will need a
|
||||
later version. I don't know what the minimal version is but 1.5.1 does support
|
||||
this option.)
|
||||
|
||||
Then you must run this:
|
||||
|
||||
# ifconfig tap0 <ip>
|
||||
# chmod 755 /tmp/vde.ctl
|
||||
|
||||
The vde_switch command will run VDE in the background. The -tap tap0
|
||||
parameter tells VDE to set up the device tap0 using tuntap. -daemon runs
|
||||
vde_switch in the background. -hub tells VDE to broadcast the message to all
|
||||
segment, just like real hub that you use on real network.
|
||||
|
||||
<ip> is the ip address of the gateway you want to use for the guest
|
||||
OS(es). For example:
|
||||
|
||||
# ifconfig tap0 192.168.254.254
|
||||
|
||||
will make 192.168.254.254 the gateway between guest and host, and your
|
||||
guest OS(es) will belong to the subnet 192.168.254.0 with a netmask of 255.255.255.0
|
||||
and an ip address of 192.168.254.XXX (where you get to pick the XXX). You must have
|
||||
the IP of the qemu guest and the IP of the gateway on the same subnet! While it
|
||||
may be possible to have them on separate subnets, it will certainly be harder
|
||||
to configure (and you won't like the way your routing tables will look either).
|
||||
|
||||
[Sidebar: The "gateway" is actually the host OS itself on the tap0 interface.
|
||||
The host on the tap0 interface, aka 192.168.254.254, routes between the guest
|
||||
OS and the host's eth0 interface (which on is the real network). The host on the
|
||||
eth0 interface (ex. 192.168.0.2) can then route between the tap0 interface and
|
||||
the real network / the internet.]
|
||||
|
||||
(Note that you might be required to do this:
|
||||
|
||||
# ifconfig tap0 192.168.254.254 netmask 255.255.255.0
|
||||
|
||||
Normally ifconfig should pick the correct netmask for you, but if it doesn't
|
||||
for some reason then you will have to specify it manually. See ifconfig(8) for
|
||||
details.
|
||||
|
||||
)
|
||||
|
||||
Note that you must run this before you run your firewall. I found it helpful
|
||||
to put this into a script, and have the script load before the firewall does.
|
||||
|
||||
Firewall configuration
|
||||
|
||||
You will need to enable masquerading between tap0 and your local area
|
||||
network (for example, eth0). You will also need to enable masquerading between
|
||||
tap0 and ppp0 if you use a dialup connection to the internet. The commands
|
||||
|
||||
# echo "1" > /proc/sys/net/ipv4/ip_forward
|
||||
# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
|
||||
# iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
|
||||
|
||||
will allow you to enable this manually.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Slirp networking
|
||||
|
||||
What is slirp networking?
|
||||
|
||||
Slirp was an early program that existed before the masses knew of the internet.
|
||||
Back then, those who knew of it could access it only in one way: through a
|
||||
Unix shell account (or other such terminal account). This meant that one had to
|
||||
do all the things they wanted to in that terminal window. Back then, there were
|
||||
two dial up protocols: PPP and SLIP. PPP is now the standard but back then SLIP
|
||||
was more common (as it was cheaper).
|
||||
|
||||
Slirp was designed to turn those shell accounts into SLIP connections. It worked
|
||||
by converting SLIP packets into socket connections. What you had to do was to
|
||||
run slirp on the computer you had the shell account on, and then connect your
|
||||
SLIP driver/dialer to the terminal slirp was running on (normally this
|
||||
'terminal' was in fact a modem). Slirp would then interpret the data that SLIP
|
||||
sent and transfer the data between the user's computer and the internet. To
|
||||
the user, it looked like they were actually connected directly to the internet
|
||||
through a firewall.
|
||||
|
||||
Slirp is not used today (to the best of my knowledge) but the innovative idea it
|
||||
had is used by both qemu and vde. Instead of converting SLIP packets however,
|
||||
they convert ethernet packets. qemu's slirp networking is similar to vde's
|
||||
but it is simpler to use and also limited to a single qemu instance (you can
|
||||
not link multiple guest OSes together on the same network with slirp networking
|
||||
unless you use VDE).
|
||||
|
||||
How to enable slirp networking?
|
||||
|
||||
This is very similar to TUNTAP networking in the previous section, but the
|
||||
commands are slightly different. In addition, you do not need to set up
|
||||
routing or firewall rules.
|
||||
|
||||
First off, you load vde_switch (no parameters are required for this case,
|
||||
although you can pass the -unix parameter if you want to use a different
|
||||
socket - required if you already have tuntap networking on the default
|
||||
socket).
|
||||
|
||||
vde_switch
|
||||
|
||||
or
|
||||
|
||||
vde_switch -unix /tmp/unx.ctl
|
||||
|
||||
The latter is required if you are running both slirp and tuntap or multiple
|
||||
slirp networks (for that matter, if you are running multiple tuntap networks).
|
||||
More on that later.
|
||||
|
||||
Now you need the slirpvde command. slirpvde is the utilitry that provides the
|
||||
slirp functionality - it intercepts ethernet packets on the network and
|
||||
forwards them through the real network via emulation. To use it, you want
|
||||
to do this:
|
||||
|
||||
slirpvde -s /tmp/unx.ctl -n 192.168.2.0 -d
|
||||
|
||||
The -s tells slirpvde that vde_switch is running on /tmp/unx.ctl [this switch
|
||||
can be omitted if you called vde_switch by itself]. The -d switch tells
|
||||
slirpvde to emulate a DHCP server. This is not required but it allows for
|
||||
automatic configuration of the guest OS (it is basicly the same as qemu's
|
||||
builtin DHCP server). Depending on your needs, you may be better off running
|
||||
a real DHCP server in one of the guest OSes.
|
||||
|
||||
The last option, -n, tells slirpvde
|
||||
what subnet the network should be on (this is also used by the DHCP server to
|
||||
figure out what ip addresses to assign). The gateway ip when using slirpvde
|
||||
is X.X.X.2 (where X.X.X equals the first 3 parts of the subnet you passed to
|
||||
it via -n, in this example 192.168.2) and the default DNS server is X.X.X.3
|
||||
|
||||
You can not change the gateway ip to something other than .2 and the DNS ip
|
||||
to something other than .3 unless you change the source in slirpvde and
|
||||
recompile.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Setting up qemu
|
||||
|
||||
How to set up the guest OS
|
||||
|
||||
Set up the guest OS so that the default route is through the gateway
|
||||
ip, <ip> (for example 192.168.254.254). Also set up the subnet and netmask
|
||||
parameters as appropriate (for example 192.168.254.0 and 255.255.255.0).
|
||||
The guest OS should see the ethernet device and be able to use it to access
|
||||
the gateway. (Caveat: I haven't been able to do this for MS-DOS, and for Minix
|
||||
2.0.4 I had to apply a patch to qemu since Minix is broken. Uodate: Minix 2.0.4
|
||||
is still broken but a patch has been released to fix it. Using this patch,
|
||||
Minix works on a vanilla qemu.) Also don't forget to set up the IP of the guest
|
||||
OS itself (for example 192.168.254.1).
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Credits
|
||||
|
||||
This HOWTO relied heavily on the documentation that Renzo wrote for
|
||||
vde-1.4.1.
|
||||
Thanks to Mulyadi Santosa for helping with the first revision of
|
||||
this document, and to Renzo for his input. (P.S. Will add info for ale4net
|
||||
and slirpvde as soon as I figure out how to use it ;)
|
||||
|
||||
|
@ -1,199 +0,0 @@
|
||||
VDEv2: Virtual Distributed Ethernet.
|
||||
|
||||
(c) 2003/2004/2005/2006 Renzo Davoli
|
||||
Long long time ago based on uml-router Copyright 2002 Yon Uriarte and Jeff Dike
|
||||
qemu-vde-HOWTO is (c) by Jim Brown
|
||||
Notice: Virtual Distributed Ethernet is not related in any way with
|
||||
www.vde.com ("Verband der Elektrotechnik, Elektronik und Informationstechnik"
|
||||
i.e. the German "Association for Electrical, Electronic & Information
|
||||
Technologies").
|
||||
|
||||
Components of the VDE architecture:
|
||||
- VDE switches: virtual counterpart of ethernet switches.
|
||||
- VDE cables: virtual counterpart of a crossed-cable used to connect two switches.
|
||||
|
||||
- VDE 2 includes:
|
||||
- switch management both from console and from a "unix socket terminal"
|
||||
- VLAN 801.1q *almost* compatible
|
||||
- FSTP (fast spanning tree) already incomplete and currently not tested for 802.1d/w/s
|
||||
compatibility. under development. (vde_switch must be compiled with the FSTP flag on)
|
||||
|
||||
Using VDE:
|
||||
- All units connected to the VDE see each other as they were on a real ethernet.
|
||||
- A real Linux box can be connected to the VDE using a tap interface (TUNTAP)
|
||||
(packets can be further routed using standard linux methods).
|
||||
- It is possible to join two VDE switches -- also running on different
|
||||
real conputers -- using virtual VDE cables
|
||||
- UML (user-mode-linux) virtual machines can be connected to the VDE
|
||||
- MPS (MIPS emulated machines (c) Morsiani/Davoli) can be connected
|
||||
to the virtual VDE.
|
||||
|
||||
Examples of VDE uses:
|
||||
- With VDE it is possible to create a virtual network of UML machines running
|
||||
on several real computer
|
||||
- VDE can be used to create tunnels (even crossing masquerated networks)
|
||||
- VDE can provide mobility support. Changing a VDE cable with another does not
|
||||
affect the communications in place. The new VDE cable can use a completely
|
||||
different path on the real net. VDE supports also multiple concurrent VDE cables
|
||||
between a pair of VDE-switches during the hand-off. This eliminates when possible
|
||||
hich-ups of communications due to hand-offs.
|
||||
|
||||
HOWTO and basic command syntax (for a complete explanation RTM):
|
||||
|
||||
vde-switch [ -unix control-socket ] [ -tap tuntap-device ] [ -hub ] [-daemon]
|
||||
This command creates a VDE switch.
|
||||
-unix control-socket
|
||||
The control socket is the socket used for local processes to create a new
|
||||
connection. The default value is /tmp/vde.ctl.
|
||||
User-mode-linux default value is /tmp/uml.ctl, so if you want to use vde
|
||||
with UML you can: (1) use "-unix /tmp/uml.ctl" for vde-switch (2) use
|
||||
"eth0=daemon,,/tmp/vde.ctl" for UML
|
||||
-tap tuntap-device
|
||||
the vde-switch is connected to the specified tap interface.
|
||||
Ususally it is reserved for root as /dev/net/tun is not writable.
|
||||
(It is dangerous to have /dev/net/tun writable by ordinary users).
|
||||
-hub
|
||||
the vde-switch works as a hub (all packets are broadcast on all interfaces.
|
||||
-daemon
|
||||
the switch works as a daemon: it runs in background, it uses syslog
|
||||
for error management.
|
||||
|
||||
vde-plug [-p port] [socketname]
|
||||
A vde-cable is composed by two vde-plug and a "cable". A vde-plug connects its
|
||||
standard input and output to a switch.
|
||||
socketname is the control-socket of the switch the plug must be connected to
|
||||
(default value /tmp/vde.ctl).
|
||||
-p port. To use a specific port of the switch. The first available port is
|
||||
assaigned when not specified. It is possibl eto connect several cables to the
|
||||
same prot: Cables connected to the same port represent several path
|
||||
for the same destination.
|
||||
|
||||
dpipe cmd1 [arg1] = cmd2 [arg2]
|
||||
it is the double pipe command (it is here just becouse it is not provided by
|
||||
shells).
|
||||
cmd1 and cmd2 are executed, the stdout of cmd1 if pipe connected to the stdin of
|
||||
cmd2 and viceversa. (the symbol = is intended as a pair of communication pipes
|
||||
between the two processes.
|
||||
|
||||
HOW TO:
|
||||
- (1) SETUP A DAEMON:
|
||||
(as root)
|
||||
# vde_switch -tap tap0 -mod 777 -daemon
|
||||
# ifconfig tap0 192.168.0.254
|
||||
|
||||
if you want to have routing to the Internet you can use standard routing
|
||||
commands on the host machine e.g.:
|
||||
# echo "1" > /proc/sys/net/ipv4/ip_forward
|
||||
# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
|
||||
|
||||
for ipv6
|
||||
# echo "1" > /proc/sys/net/ipv6/conf/eth0/forwarding
|
||||
# radvd
|
||||
|
||||
radvd must be configured to broadcast the correct prefix for the tap0 subnet
|
||||
|
||||
----- example of /etc/radvd.conf file
|
||||
interface tap0
|
||||
{
|
||||
AdvSendAdvert on;
|
||||
MaxRtrAdvInterval 120;
|
||||
#put here your prefix.
|
||||
prefix 1111:2222:3333:4444::/64
|
||||
{
|
||||
AdvOnLink on;
|
||||
AdvAutonomous on;
|
||||
AdvRouterAddr on;
|
||||
|
||||
};
|
||||
};
|
||||
------ end of example
|
||||
|
||||
- (2) SETUP A SECOND DAEMON
|
||||
(no need for root access)
|
||||
|
||||
% vde_switch /tmp/my.ctl
|
||||
|
||||
(add - daemon if you want to run it in background)
|
||||
|
||||
- (3) CONNECT TWO LOCAL SWITCHES TOGETHER
|
||||
|
||||
% dpipe vde_plug = vde_plug /tmp/my.ctl
|
||||
(or
|
||||
% dpipe vde_plug /tmp/my.ctl = vde_plug
|
||||
)
|
||||
|
||||
connects the vde_switch with ctl socket /tmp/vde.ctl with the other using
|
||||
/tmp/my.ctl.
|
||||
|
||||
- (3) CONNECT TWO REMOTE SWITCHES TOGETHER
|
||||
|
||||
You need a tool to interconnect stdin stdout of two remote processes.
|
||||
e.g.
|
||||
|
||||
% dpipe vde_plug /tmp/my.ctl = ssh remote_machine vde_plug
|
||||
|
||||
connects the vde_switch with ctl socket /tmp/vde.ctl on the remote_machine
|
||||
with the local switch using /tmp/my.ctl.
|
||||
|
||||
It is possible to use other tools in place of ssh like netcat.
|
||||
In this latter case the communication is not secure.
|
||||
|
||||
- (4) CREATION OF TUNNELS.
|
||||
(it needs kernel support for policy routing)
|
||||
|
||||
Setup two daemon as described in (1).
|
||||
In this example 192.168.0.1 is the tap0 address on the server side.
|
||||
Route the traffic to the Internet on the tunnel server side.
|
||||
|
||||
On the tunnel client side:
|
||||
- in the example 100.200.201.202 is the IP address on eth0
|
||||
and 100.200.201.254 is the default gateway.
|
||||
- create a specific rule for the eth0 routing
|
||||
ip rule add from 100.200.201.202 table eth0-table
|
||||
(please note that eth0-table must be listed in /etc/iproute2/rt_tables)
|
||||
ip route del default via 100.200.201.254
|
||||
ip route add default via 100.200.201.254 table eth0-table
|
||||
the previous default route will be the def. route just for the
|
||||
packets originated with the eth0 inteface address.
|
||||
- connect the two vde-switch together:
|
||||
dpipe vde-plug = ssh -b 100.200.201.202 server-machine vde-plug
|
||||
- setup an appropriate IP address for tap0 interface (or get it by dhcp
|
||||
if set up on server side). (e.g. 192.168.0.10)
|
||||
- use tap0 as the default interface:
|
||||
ip route add default via 192.168.0.1
|
||||
|
||||
- (5) SUPPORT FOR MOBILITY
|
||||
|
||||
Create a tunnel like in 4 using a group number on the vde-cable:
|
||||
dpipe vde-plug -g 1 = ssh -b 100.200.201.202 server-machine vde-plug -g 1
|
||||
|
||||
Create a second tunnel (say on ppp0 addr. 100.100.101.102 gateway 100.100.101.254)
|
||||
# ip rule add from 100.100.101.102 table ppp0-table
|
||||
# ip route add default via 100.100.101.254 table ppp0-table
|
||||
|
||||
Connect the a second cable using the same group number:
|
||||
# dpipe vde-plug -g 1 = ssh -b 100.100.101.102 server-machine vde-plug -g 1
|
||||
Disconnect the first cable (kill the processes of the first cable)
|
||||
|
||||
All the traffic get rerouted on the new vde-cable (thus to another path
|
||||
on the rel network. Connections in place are unaffected by the change.
|
||||
Several cables of the same group can be in place during the handoff phase
|
||||
but note that this ends up in duplicated packets that can slow down
|
||||
the communication.
|
||||
|
||||
Please note also that the vde-switches do not manage (yet) the minimum spanning
|
||||
tree protocol thus a loop in the topology can lead to inconsistent MAC forward
|
||||
tables and to network saturation.
|
||||
|
||||
Copyright 2003/2004/2005/2006/2011 Renzo Davoli
|
||||
This product includes software developed by Danny Gasparovski and Fabrice
|
||||
Ballard (slirp support).
|
||||
Acknowlegments:
|
||||
Thanks to Marco Giordani, Leonardo Macchia for their useful help for debugging.
|
||||
Imported code by Danny Gasparovsky, Fabrice Ballard.
|
||||
Thanks to Giuseppe Della Bianca <bepi@adria.it> for many bug reports, and
|
||||
patch proposals.
|
||||
Thanks to Daniel P. Barrange <berrange at redhat dot com> for several patches
|
||||
and the management of group ownership.
|
||||
Code organization, bugfixes, autotool support Mattia Belletti.
|
||||
|
@ -1,204 +0,0 @@
|
||||
#!/bin/sh
|
||||
# $Id: rc.vdenetwork,v 1.7 2011/12/06 14:18:08 root Exp root $
|
||||
# Qemu environment preparation script
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
#
|
||||
# After running this startup script, run a QEMU virtual machine in this way:
|
||||
#
|
||||
# qemu-system-x86_64 \
|
||||
# -net vde,sock=/var/run/kvm0.ctl,vlan=0 -net nic,vlan=0 \
|
||||
# [qemu_option [qemu_option], ...]
|
||||
#
|
||||
# This will automatically connect the QEMU virtual machine to the VDE switch.
|
||||
#
|
||||
# ---------------------------------------------------------------------------
|
||||
#
|
||||
# Network type can be one of "route" "bridge" or "nat":
|
||||
# - In "route" mode, the script will expect that the 'routed' daemon is running
|
||||
# on the host (see /etc/rc.d/rc.inet2 to start 'routed'), and will not
|
||||
# create iptables NAT rules.
|
||||
# The virtual network will be routed on the LAN and will be accessible as a
|
||||
# separate network segment (make sure the IP range defined below does not
|
||||
# conflict with existing parts of your network!). The guests will use our
|
||||
# private dnsmasq server to obtain IP addresses.
|
||||
# - In "bridge" mode, the script will try to add the tap device to an existing
|
||||
# network bridge, and will not create iptables NAT rules.
|
||||
# The guests will be seen on the LAN as part of the network.
|
||||
# - In "nat" mode, the script will create iptables NAT rules. These hide the
|
||||
# virtual network behind an internal NAT router. The guests will have full
|
||||
# network access, but will be accessible only from the host.
|
||||
#
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
#NETWORKTYPE="route"
|
||||
#NETWORKTYPE="bridge"
|
||||
NETWORKTYPE="nat"
|
||||
|
||||
# Host interfaces that need to be NAT-ed (in case we're not bridging/routing):
|
||||
# Add more interfaces space-separated, like "eth+ wlan+"
|
||||
NAT_IFS="eth+"
|
||||
|
||||
# What is the bridge interface called if we are bridging?
|
||||
BR_DEV=br0
|
||||
|
||||
# What is the name of the tun/tap device we will be using?
|
||||
TAP_DEV=kvm0
|
||||
|
||||
start_tap() {
|
||||
# Load tun module
|
||||
/sbin/modprobe tun 2>/dev/null
|
||||
# Wait for the module to be loaded
|
||||
while ! /bin/lsmod |grep -q "^tun"; do echo Waiting for tun device;sleep 1; done
|
||||
|
||||
# Start tap switch
|
||||
vde_switch --tap ${TAP_DEV} --daemon --group kvm \
|
||||
--sock /var/run/${TAP_DEV}.ctl --pidfile /var/run/${TAP_DEV}_vde.pid \
|
||||
--mod 775 --mgmtmode 770 --mgmt /var/run/${TAP_DEV}-manage
|
||||
|
||||
sleep 1
|
||||
|
||||
# Change pipe permission:
|
||||
#chmod -R a+rwx /var/run/vde.ctl
|
||||
} # End start_tap
|
||||
|
||||
stop_tap() {
|
||||
# Bring tap interface down:
|
||||
ifconfig ${TAP_DEV} down
|
||||
|
||||
# Kill VDE switch:
|
||||
#pgrep -f vde_switch | xargs kill -TERM
|
||||
kill -HUP $(cat /var/run/${TAP_DEV}_vde.pid)
|
||||
|
||||
# Remove the control socket:
|
||||
#rmdir /var/run/vde.ctl
|
||||
} # End stop_tap
|
||||
|
||||
start_localdhcp() {
|
||||
# The IP configuration for the tap device that will be used for
|
||||
# the virtual machine network:
|
||||
|
||||
TAP_IP=10.111.111.254
|
||||
TAP_MASK=255.255.255.0
|
||||
TAP_BCAST=$(/bin/ipmask ${TAP_MASK} ${TAP_IP} | cut -f 1 -d ' ')
|
||||
|
||||
# Definitions for the LAN segment the Qemu virtual machines will be in.
|
||||
# These definitions will be fed to dnsmasq - this program will provide DNS
|
||||
# and DHCP to the Qemu LAN.
|
||||
|
||||
# The VM_IPLOW and VM_IPHIGH addresses must agree with the definitions for
|
||||
# the tap0 device above. These 'low' and 'high' values are the IP address
|
||||
# range for the DHCP server to use.
|
||||
|
||||
VM_DOMAIN=qemu.lan
|
||||
VM_IPLOW=10.111.111.128
|
||||
VM_IPHIGH=10.111.111.199
|
||||
VM_BCAST=${TAP_BCAST}
|
||||
VM_MASK=${TAP_MASK}
|
||||
|
||||
# For additional options to dnsmasq - the commented example specifies that
|
||||
# all DNS lookups for 'my.net' should go to 192.168.1.1;
|
||||
# On the second line you find a configuration for supporting network boot:
|
||||
#DNSMASQ_OPTIONS="--server /my.net/192.168.1.1 \
|
||||
# --dhcp-boot=/pxelinux.0,\"192.168.1.1\",192.168.1.1"
|
||||
DNSMASQ_OPTIONS=""
|
||||
|
||||
# Bring tap interface up
|
||||
ifconfig ${TAP_DEV} ${TAP_IP} broadcast ${TAP_BCAST} netmask ${TAP_MASK}
|
||||
|
||||
# Start dnsmasq, the DNS/DHCP server
|
||||
# for our Virtual Machines behind the tap0 interface.
|
||||
# The '--conf-file' option prevents this instance from reading the default
|
||||
# /etc/dnsmasq.conf settings. Also, binds to the tun interface, to keep it
|
||||
# from interfering with other dnsmasq/named processes running on the host's
|
||||
# primary interfaces.
|
||||
/usr/sbin/dnsmasq \
|
||||
--log-queries \
|
||||
--user=daemon \
|
||||
--dhcp-leasefile=/var/state/dhcp/qemu-dhcpd.leases \
|
||||
--dhcp-range=${VM_IPLOW},${VM_IPHIGH},${VM_MASK},${VM_BCAST},8h \
|
||||
--interface=${TAP_DEV} --except-interface=lo --bind-interfaces \
|
||||
--pid-file=/var/run/${TAP_DEV}_dnsmasq.pid --conf-file \
|
||||
--domain=${VM_DOMAIN} \
|
||||
$DNSMASQ_OPTIONS
|
||||
|
||||
} # End start_localdhcp
|
||||
|
||||
stop_localdhcp() {
|
||||
# Stop dnsmasq
|
||||
#pgrep -f dnsmasq | xargs kill -TERM
|
||||
kill -TERM $(cat /var/run/${TAP_DEV}_dnsmasq.pid) \
|
||||
&& rm -f /var/run/${TAP_DEV}_dnsmasq.pid
|
||||
} # End stop_localdhcp
|
||||
|
||||
start_route() {
|
||||
# We need a private dnsmasq instance in a routed configuration:
|
||||
start_localdhcp
|
||||
} # End start_route
|
||||
|
||||
stop_route() {
|
||||
# We need to stop our private dnsmasq instance in a routed configuration:
|
||||
stop_localdhcp
|
||||
} # End stop_route
|
||||
|
||||
start_nat() {
|
||||
# Start IP Forwarding
|
||||
echo "1" > /proc/sys/net/ipv4/ip_forward
|
||||
for NIC in ${NAT_IFS}; do
|
||||
iptables -t nat -A POSTROUTING -o ${NIC} -j MASQUERADE
|
||||
done
|
||||
|
||||
# We need a private dnsmasq instance in a NAT configuration:
|
||||
start_localdhcp
|
||||
|
||||
} # End start_nat
|
||||
|
||||
stop_nat() {
|
||||
# We need to stop our private dnsmasq in a NAT configuration:
|
||||
stop_localdhcp
|
||||
|
||||
# Delete the NAT rules
|
||||
for NIC in ${NAT_IFS}; do
|
||||
iptables -t nat -D POSTROUTING -o ${NIC} -j MASQUERADE
|
||||
done
|
||||
# Stop IP Forwarding
|
||||
echo "0" > /proc/sys/net/ipv4/ip_forward
|
||||
}
|
||||
|
||||
start_bridge() {
|
||||
# Connect our tap device from the bridge:
|
||||
/sbin/ifconfig $TAP_DEV down
|
||||
/sbin/ifconfig $TAP_DEV 0.0.0.0 promisc up
|
||||
/sbin/brctl addif $BR_DEV $TAP_DEV
|
||||
}
|
||||
|
||||
stop_bridge() {
|
||||
# Disconnect our tap device from the bridge:
|
||||
/sbin/brctl delif $BR_DEV $TAP_DEV
|
||||
}
|
||||
|
||||
# See how we were called.
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting VDE network for QEMU: "
|
||||
|
||||
start_tap
|
||||
start_$NETWORKTYPE
|
||||
echo
|
||||
;;
|
||||
stop)
|
||||
echo -n "Stopping VDE network for QEMU: "
|
||||
stop_$NETWORKTYPE
|
||||
stop_tap
|
||||
echo
|
||||
;;
|
||||
restart|reload)
|
||||
$0 stop
|
||||
sleep 1
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|reload}"
|
||||
exit 1
|
||||
esac
|
@ -1,19 +0,0 @@
|
||||
# HOW TO EDIT THIS FILE:
|
||||
# The "handy ruler" below makes it easier to edit a package description. Line
|
||||
# up the first '|' above the ':' following the base package name, and the '|'
|
||||
# on the right side marks the last column you can put a character in. You must
|
||||
# make exactly 11 lines for the formatting to be correct. It's also
|
||||
# customary to leave one space after the ':'.
|
||||
|
||||
|-----handy-ruler------------------------------------------------------|
|
||||
vde: vde (virtual distributed ethernet)
|
||||
vde:
|
||||
vde: VDE is a virtual network that can be spawned over a set of physical
|
||||
vde: computer over the Internet.
|
||||
vde: VDE connects together: (1) real GNU-linux boxes (tuntap) (2) virtual
|
||||
vde: machines: UML-User Mode Linux, qemu, bochs, MPS.
|
||||
vde:
|
||||
vde:
|
||||
vde:
|
||||
vde: Homepage: https://github.com/virtualsquare/vde-2
|
||||
vde:
|
@ -1,236 +0,0 @@
|
||||
#!/bin/sh
|
||||
# $Id: vde.SlackBuild,v 1.17 2011/12/06 14:18:37 root Exp root $
|
||||
# Copyright (c) 2004-2011 Eric Hameleers, Eindhoven, NL
|
||||
# All rights reserved.
|
||||
#
|
||||
# Permission to use, copy, modify, and distribute this software for
|
||||
# any purpose with or without fee is hereby granted, provided that
|
||||
# the above copyright notice and this permission notice appear in all
|
||||
# copies.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
# IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
||||
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
# SUCH DAMAGE.
|
||||
# -----------------------------------------------------------------------------
|
||||
#
|
||||
# Slackware SlackBuild script
|
||||
# ===========================
|
||||
# By: Eric Hameleers <alien@slackware.com>
|
||||
# For: vde
|
||||
# Descr: virtual distributed ethernet
|
||||
# URL: http://vde.sourceforge.net/
|
||||
# Needs:
|
||||
# Changelog:
|
||||
# 1.5.7-1: 16/dec/2004 by Eric Hameleers
|
||||
# * Initial build.
|
||||
# 1.5.7-2: 18/dec/2004 by Eric Hameleers
|
||||
# * Added uml README to the documentation
|
||||
# 1.5.7-3: 08/feb/2005 by Eric Hameleers
|
||||
# * Fixed incorrect link for vdeqemu; added rc.vdenetwork which
|
||||
# sets up the right environment for qemu, using dnsmasq.
|
||||
# If you already run a local nameserver, you'll have to edit out
|
||||
# parts of that file.
|
||||
# 1.5.9-1: 05/jul/2005 by Eric Hameleers
|
||||
# * New release. Changed the rc.vdenetwork script so that it will
|
||||
# run out of the box.
|
||||
# 20051213-1: 13/dec/2005 by Eric Hameleers
|
||||
# * Snapshot release of what will become 2.0.1. I need this for the
|
||||
# current CVS version of QEMU which changed the networking
|
||||
# parameters. VDE now comes with 'vdeoq' and 'vdeq' for the old
|
||||
# and the new interface respectively.
|
||||
# 2.0.1-1: 03/jan/2006 by Eric Hameleers <alien@slackware.com>
|
||||
# * New release, adapted to qemu >= 0.8
|
||||
# 2.0.2-1: 23/jul/2006 by Eric Hameleers <alien@slackware.com>
|
||||
# * New release.
|
||||
# 2.1.1-1: 22/aug/2006 by Eric Hameleers <alien@slackware.com>
|
||||
# * New release.
|
||||
# 2.1.6-1: 26/jul/2007 by Eric Hameleers <alien@slackware.com>
|
||||
# * Update.
|
||||
# 2.2.0.pre1-1: 02/Jun/2008 by Eric Hameleers <alien@slackware.com>
|
||||
# * Update.
|
||||
# 2.2.2-1: 01/sep/2008 by Eric Hameleers <alien@slackware.com>
|
||||
# * Update.
|
||||
# 2.3.1-1: 23/aug/2010 by Eric Hameleers <alien@slackware.com>
|
||||
# * Update.
|
||||
# 2.3.2-1: 06/dec/2011 by Eric Hameleers <alien@slackware.com>
|
||||
# * Update.
|
||||
#
|
||||
# Run 'sh vde.SlackBuild' to build a Slackware package.
|
||||
# The package (.tgz) and .txt file as well as build logs are created in /tmp .
|
||||
# Install it using 'installpkg'.
|
||||
#
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
# Set initial variables:
|
||||
#
|
||||
# A cargo del mantenimiento: Gerardo Zamudio <gzamudio@libremex.org.mx>
|
||||
# para Libre Expresión México, A.C
|
||||
#
|
||||
|
||||
PRGNAM=vde
|
||||
SRCVER=${SRCVER:-2.3.2}
|
||||
VERSION=$(echo $SRCVER | tr '-' '.')
|
||||
BUILD=${BUILD:-1}
|
||||
TAG=${TAG:-lem}
|
||||
|
||||
# Where do we look for sources?
|
||||
SRCDIR=$(cd $(dirname $0); pwd)
|
||||
|
||||
DOCS="COPYING* Changelog LICENSE README* VERSION doc/* \
|
||||
$SRCDIR/rc.vdenetwork $SRCDIR/Using_VDE_with_QEMU_HOWTO.txt"
|
||||
|
||||
# Place to build (TMP) package (PKG) and output (OUTPUT) the program:
|
||||
TMP=${TMP:-/tmp/build}
|
||||
PKG=$TMP/package-$PRGNAM
|
||||
OUTPUT=${OUTPUT:-/tmp}
|
||||
|
||||
SOURCE="$SRCDIR/${PRGNAM}2-${SRCVER}.tar.bz2"
|
||||
SRCURL="http://downloads.sourceforge.net/${PRGNAM}/${PRGNAM}2-${SRCVER}.tar.bz2"
|
||||
|
||||
##
|
||||
## --- with a little luck, you won't have to edit below this point --- ##
|
||||
##
|
||||
|
||||
# Automatically determine the architecture we're building on:
|
||||
if [ -z "$ARCH" ]; then
|
||||
case "$( uname -m )" in
|
||||
i?86) export ARCH=i486 ;;
|
||||
arm*) export ARCH=arm ;;
|
||||
# Unless $ARCH is already set, use uname -m for all other archs:
|
||||
*) export ARCH=$( uname -m ) ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
case "$ARCH" in
|
||||
i486) SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
||||
SLKLDFLAGS=""; LIBDIRSUFFIX=""
|
||||
;;
|
||||
x86_64) SLKCFLAGS="-O2 -fPIC"
|
||||
SLKLDFLAGS="-L/usr/lib64"; LIBDIRSUFFIX="64"
|
||||
;;
|
||||
*) SLKCFLAGS="-O2"
|
||||
SLKLDFLAGS=""; LIBDIRSUFFIX=""
|
||||
;;
|
||||
esac
|
||||
|
||||
# Exit the script on errors:
|
||||
set -e
|
||||
trap 'echo "$0 FAILED at line ${LINENO}" | tee $OUTPUT/error-${PRGNAM}.log' ERR
|
||||
# Catch unitialized variables:
|
||||
set -u
|
||||
P1=${1:-1}
|
||||
|
||||
# Save old umask and set to 0022:
|
||||
_UMASK_=$(umask)
|
||||
umask 0022
|
||||
|
||||
# Create working directories:
|
||||
mkdir -p $OUTPUT # place for the package to be saved
|
||||
mkdir -p $TMP/tmp-$PRGNAM # location to build the source
|
||||
mkdir -p $PKG # place for the package to be built
|
||||
rm -rf $PKG/* # always erase old package's contents
|
||||
rm -rf $TMP/tmp-$PRGNAM/* # remove the remnants of previous build
|
||||
rm -rf $OUTPUT/{configure,make,install,error,makepkg}-$PRGNAM.log
|
||||
# remove old log files
|
||||
|
||||
# Source file availability:
|
||||
if ! [ -f ${SOURCE} ]; then
|
||||
echo "Source '$(basename ${SOURCE})' not available yet..."
|
||||
# Check if the $SRCDIR is writable at all - if not, download to $OUTPUT
|
||||
[ -w "$SRCDIR" ] || SOURCE="$OUTPUT/$(basename $SOURCE)"
|
||||
if [ -f ${SOURCE} ]; then echo "Ah, found it!"; continue; fi
|
||||
if ! [ "x${SRCURL}" == "x" ]; then
|
||||
echo "Will download file to $(dirname $SOURCE)"
|
||||
wget -nv -T 20 -O "${SOURCE}" "${SRCURL}" || true
|
||||
if [ $? -ne 0 -o ! -s "${SOURCE}" ]; then
|
||||
echo "Downloading '$(basename ${SOURCE})' failed... aborting the build."
|
||||
mv -f "${SOURCE}" "${SOURCE}".FAIL
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "File '$(basename ${SOURCE})' not available... aborting the build."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$P1" == "--download" ]; then
|
||||
echo "Download complete."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# --- PACKAGE BUILDING ---
|
||||
|
||||
echo "++"
|
||||
echo "|| $PRGNAM-$VERSION"
|
||||
echo "++"
|
||||
|
||||
cd $TMP/tmp-$PRGNAM
|
||||
echo "Extracting the source archive(s) for $PRGNAM..."
|
||||
tar -xvf ${SOURCE}
|
||||
cd ${PRGNAM}2-${SRCVER}
|
||||
chown -R root:root .
|
||||
chmod -R u+w,go+r-w,a+X-s .
|
||||
|
||||
echo Building ...
|
||||
LDFLAGS="$SLKLDFLAGS" \
|
||||
CXXFLAGS="$SLKCFLAGS" \
|
||||
CFLAGS="$SLKCFLAGS" \
|
||||
./configure \
|
||||
--prefix=/usr \
|
||||
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
||||
--localstatedir=/var \
|
||||
--sysconfdir=/etc \
|
||||
--mandir=/usr/man \
|
||||
--program-prefix= \
|
||||
--program-suffix= \
|
||||
--build=$ARCH-slackware-linux \
|
||||
2>&1 | tee $OUTPUT/configure-${PRGNAM}.log
|
||||
|
||||
make 2>&1 | tee $OUTPUT/make-${PRGNAM}.log
|
||||
make DESTDIR=$PKG install 2>&1 | tee $OUTPUT/install-${PRGNAM}.log
|
||||
|
||||
# Add documentation:
|
||||
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
||||
cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION || true
|
||||
cat $SRCDIR/$(basename $0) > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
||||
rm -f $PKG/usr/doc/$PRGNAM-$VERSION/Makefile*
|
||||
chown -R root:root $PKG/usr/doc/$PRGNAM-$VERSION
|
||||
find $PKG/usr/doc -type f -exec chmod 644 {} \;
|
||||
|
||||
# Compress the man page(s):
|
||||
if [ -d $PKG/usr/man ]; then
|
||||
find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \;
|
||||
for i in $(find $PKG/usr/man -type l -name "*.?") ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
|
||||
fi
|
||||
|
||||
# Strip binaries (if any):
|
||||
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
|
||||
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
||||
|
||||
# Add a package description:
|
||||
mkdir -p $PKG/install
|
||||
cat $SRCDIR/slack-desc > $PKG/install/slack-desc
|
||||
if [ -f $SRCDIR/doinst.sh ]; then
|
||||
cat $SRCDIR/doinst.sh >> $PKG/install/doinst.sh
|
||||
fi
|
||||
|
||||
# Build the package:
|
||||
cd $PKG
|
||||
makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.tgz 2>&1 | tee $OUTPUT/makepkg-${PRGNAM}.log
|
||||
cd $OUTPUT
|
||||
md5sum ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.tgz > ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.tgz.md5
|
||||
cd -
|
||||
cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txt
|
||||
|
||||
# Restore the original umask:
|
||||
umask ${_UMASK_}
|
||||
|
@ -1,10 +0,0 @@
|
||||
PRGNAM="vde"
|
||||
VERSION="2.3.2"
|
||||
HOMEPAGE="https://github.com/virtualsquare/vde-2"
|
||||
DOWNLOAD="http://downloads.sourceforge.net/project/vde/vde2/2.3.2/vde2-2.3.2.tar.bz2"
|
||||
MD5SUM="46fbc5f97f03dc517aa3b2c9d9ea6628"
|
||||
DOWNLOAD_x86_64=""
|
||||
MD5SUM_x86_64=""
|
||||
REQUIRES=""
|
||||
MAINTAINER="Gerardo Zamudio"
|
||||
EMAIL="gzamudio@libremex.org.mx"
|
@ -1,46 +0,0 @@
|
||||
++========================================
|
||||
||
|
||||
|| Package: ./vde/pkg64/current/vde-2.3.2-x86_64-1lem.tgz
|
||||
||
|
||||
++========================================
|
||||
drwxr-xr-x root/root 0 2021-05-08 12:26 ./
|
||||
drwxr-xr-x root/root 0 2021-05-08 12:26 install/
|
||||
-rw-r--r-- root/root 808 2021-05-08 12:26 install/slack-desc
|
||||
drwxr-xr-x root/root 0 2021-05-08 12:26 usr/
|
||||
drwxr-xr-x root/root 0 2021-05-08 12:26 usr/doc/
|
||||
drwxr-xr-x root/root 0 2021-05-08 12:26 usr/doc/vde-2.3.2/
|
||||
-rw-r--r-- root/root 18003 2011-11-23 10:41 usr/doc/vde-2.3.2/COPYING
|
||||
-rw-r--r-- root/root 26436 2011-11-23 10:41 usr/doc/vde-2.3.2/COPYING.libvdeplug
|
||||
-rw-r--r-- root/root 3012 2011-11-23 10:41 usr/doc/vde-2.3.2/COPYING.slirpvde
|
||||
-rw-r--r-- root/root 8882 2011-11-23 10:41 usr/doc/vde-2.3.2/Changelog
|
||||
-rw-r--r-- root/root 7921 2011-11-23 10:41 usr/doc/vde-2.3.2/README
|
||||
-rw-r--r-- root/root 140 2011-11-23 10:41 usr/doc/vde-2.3.2/README.UML
|
||||
-rw-r--r-- root/root 747 2011-11-23 10:41 usr/doc/vde-2.3.2/README.VirtualBox
|
||||
-rw-r--r-- root/root 389 2011-11-23 10:41 usr/doc/vde-2.3.2/README.bochs
|
||||
-rw-r--r-- root/root 726 2011-11-23 10:41 usr/doc/vde-2.3.2/README.qemu
|
||||
-rw-r--r-- root/root 208 2011-11-23 10:41 usr/doc/vde-2.3.2/README.slirpvde
|
||||
-rw-r--r-- root/root 933 2011-11-23 10:41 usr/doc/vde-2.3.2/README.vde_over_ns
|
||||
-rw-r--r-- root/root 11325 2005-02-09 10:16 usr/doc/vde-2.3.2/Using_VDE_with_QEMU_HOWTO.txt
|
||||
-rw-r--r-- root/root 44824 2011-11-23 10:41 usr/doc/vde-2.3.2/VirtualBox-3.1.6_OSE_VDE.patch
|
||||
drwxr-xr-x root/root 0 2011-11-23 10:42 usr/doc/vde-2.3.2/bochs/
|
||||
-rw-r--r-- root/root 329 2011-11-23 10:41 usr/doc/vde-2.3.2/bochs/eth.cc.diff
|
||||
-rw-r--r-- root/root 10431 2011-11-23 10:41 usr/doc/vde-2.3.2/bochs/eth_vde.cc
|
||||
-rw-r--r-- root/root 777 2011-11-23 10:41 usr/doc/vde-2.3.2/freebsd_tap-HOWTO
|
||||
drwxr-xr-x root/root 0 2011-11-23 10:42 usr/doc/vde-2.3.2/libvdemgmt/
|
||||
-rw-r--r-- root/root 106 2011-11-23 10:41 usr/doc/vde-2.3.2/libvdemgmt/asyncrecv.rc
|
||||
-rw-r--r-- root/root 27 2011-11-23 10:41 usr/doc/vde-2.3.2/libvdemgmt/closemachine.rc
|
||||
-rw-r--r-- root/root 56 2011-11-23 10:41 usr/doc/vde-2.3.2/libvdemgmt/openmachine.rc
|
||||
-rw-r--r-- root/root 415 2011-11-23 10:41 usr/doc/vde-2.3.2/libvdemgmt/sendcmd.rc
|
||||
-rw-r--r-- root/root 6345 2020-05-23 23:52 usr/doc/vde-2.3.2/rc.vdenetwork
|
||||
-rw-r--r-- root/root 8427 2021-05-08 12:26 usr/doc/vde-2.3.2/vde.SlackBuild
|
||||
-rw-r--r-- root/root 1397 2011-11-23 10:41 usr/doc/vde-2.3.2/vde_autolink-HOWTO
|
||||
-rw-r--r-- root/root 233 2011-11-23 10:41 usr/doc/vde-2.3.2/vdecmd
|
||||
-rw-r--r-- root/root 11065 2011-11-23 10:41 usr/doc/vde-2.3.2/vdeqemu-HOWTO
|
||||
drwxr-xr-x root/root 0 2021-05-08 12:26 usr/include/
|
||||
-rw-r--r-- root/root 1775 2021-05-08 12:26 usr/include/libvdehist.h
|
||||
-rw-r--r-- root/root 4615 2021-05-08 12:26 usr/include/libvdemgmt.h
|
||||
-rw-r--r-- root/root 2665 2021-05-08 12:26 usr/include/libvdeplug.h
|
||||
-rw-r--r-- root/root 5634 2021-05-08 12:26 usr/include/libvdeplug_dyn.h
|
||||
-rw-r--r-- root/root 4220 2021-05-08 12:26 usr/include/libvdesnmp.h
|
||||
|
||||
|
@ -1,18 +0,0 @@
|
||||
PACKAGE NAME: vde-2.3.2-x86_64-1lem.tgz
|
||||
PACKAGE MIRROR: https://mirror.slackware.mx/libremex/slackbuilds
|
||||
PACKAGE LOCATION: ./vde/pkg64/current
|
||||
PACKAGE SIZE (compressed): 56 K
|
||||
PACKAGE SIZE (uncompressed): 210 K
|
||||
PACKAGE DESCRIPTION:
|
||||
vde: vde (virtual distributed ethernet)
|
||||
vde:
|
||||
vde: VDE is a virtual network that can be spawned over a set of physical
|
||||
vde: computer over the Internet.
|
||||
vde: VDE connects together: (1) real GNU-linux boxes (tuntap) (2) virtual
|
||||
vde: machines: UML-User Mode Linux, qemu, bochs, MPS.
|
||||
vde:
|
||||
vde:
|
||||
vde:
|
||||
vde: Homepage: https://github.com/virtualsquare/vde-2
|
||||
vde:
|
||||
|
@ -1,17 +0,0 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQJNBAABCgA3FiEEm8dazQnvu0U1Gdmc9s+lqZ57WVcFAmCWykoZHGd6YW11ZGlv
|
||||
QGxpYnJlbWV4Lm9yZy5teAAKCRD2z6WpnntZV/qzD/wKleGt9t9nZiolas5NEcfV
|
||||
pkwSMO6szX/ComGDgifQiWzJszapoZUhNSPMj90CmDMmXOSuc3ctwDF0RMt4w3hZ
|
||||
+NJodiwOUMyf6XrozP/AqTYIjamF+gXEVCDh0hKYabUtZPWsFwBu6gV/duvwid+F
|
||||
MZ0nLyEDJo8s+P+q0eR1axM0xSqCLlHoBjLes+5FHzOm2fh+kgwLgB21qOhNY0G6
|
||||
VZ4pAzUeYqHKwUvHkHygRqAgqjJjA6p5BNc2zl5ABi/bS76lSZJJ+Lt3NihSKhDC
|
||||
iO7kkvEnzKy4dvpt9Sj9NtN6JT/NmxA5Kn1KlMt1G2ipl2f0Xbvb1gnUuNSmIeNb
|
||||
mklijtWVhMprr6+2PrYd2YwXXzvrqP4G1ZCjvTJ9RA63c9+RckDeIo7dfrOr8IAp
|
||||
CxngU791hktfX094uwW/iHODO6YMJoBsLDQJlxH1BioJC8KidxRgeuyST96CsfeX
|
||||
m+zP/avgN4h6O+C/gLT6jXGL17r4TF/VGjZb3EiLQGGxIzuhdU2JmFnA3lwu+ZPY
|
||||
zOVHrENHCqlrynRckzAm0Ui1k7VOoeuL7RDRcAepJFxHcOvUeluvkU/Sx/8aigIF
|
||||
Z6sXZkXKV5dW7mXbYepKCM1/P+LzDEmK3ecfO8VMrC2PGmEdtMgpt8N39XA3fWhl
|
||||
eRRta1mUpyFG0x9KBEDC0Q==
|
||||
=bYb2
|
||||
-----END PGP SIGNATURE-----
|
@ -1 +0,0 @@
|
||||
ce63d20ab5959b6a98d30d37f448bbab vde-2.3.2-x86_64-1lem.tgz
|
@ -1,11 +0,0 @@
|
||||
vde: vde (virtual distributed ethernet)
|
||||
vde:
|
||||
vde: VDE is a virtual network that can be spawned over a set of physical
|
||||
vde: computer over the Internet.
|
||||
vde: VDE connects together: (1) real GNU-linux boxes (tuntap) (2) virtual
|
||||
vde: machines: UML-User Mode Linux, qemu, bochs, MPS.
|
||||
vde:
|
||||
vde:
|
||||
vde:
|
||||
vde: Homepage: https://github.com/virtualsquare/vde-2
|
||||
vde:
|
Loading…
Reference in new issue