Editing
NGNET-Testing-HOWTO
(section)
From Linix VServer
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
= [[?action=find&find=NGNET-Testing-HOWTO|NGNET-Testing-HOWTO]] = <div id="toolbar-top"> [[Linux-VServer]] | [[RecentChanges]] | [http://linux-vserver.org/?action=prefs Preferences] | [http://tavi.sourceforge.net/FormattingRules FormattingRules] </div> ----- </div> <div id="body"> THIS DOCUMENT IS A WORK IN PROGRESS <span id="goal"></span> === Goal === Setup Linux-Vserver to use the future Network virtualization for testing purpose. While this new code is higly experimental and not yet integrated in util-vserver, we will have to use some dirty tricks. <span id="requirements"></span> === Requirements === * The latest 2.6 version of Linux kernel sources * The iptables sources * The latest Linux-Vserver devel patch (http://vserver.13thfloor.at/Experimental/) * The latest NGNET patch (http://vserver.13thfloor.at/Experimental/NGNET/) * The latest util-vserver tools (0.30.196 or higher) * Some knowledge on how Linux-Vserver works <span id="prepare-the-host-system"></span> === Prepare the host system === We assume here that you have a working platform running Linux-Vserver 1.9.x with alpha version of util-vserver. * First we will compile the 2.6 kernel corresponding to the latest ngnet patch foundable here (http://vserver.13thfloor.at/Experimental/NGNET/). Try to use a kernel configuration as close as possible to the following kernel configuration (http://vserver.13thfloor.at/Experimental/NGNET/kernel-ng8.config), especially about network stuff. * In the meantime we will compile iptables with the vnet patch (http://vserver.13thfloor.at/Experimental/NGNET/iptables-1.2.11-vnet.patch) and install it on the host system. * Also compile the *vnet* command (vnet-x.xx.tar.gz in http://vserver.13thfloor.at/Experimental/NGNET/) and install in on the host system. Once those things are done, you can try to boot your system with the newly compiled kernel. If you don't succeed here, try to get some help on the #vserver channel. <span id="configure-util-vserver"></span> === Configure util-vserver === We'll have to remove all the network handling of util-vserver and replace it by the vnet stuff. To do that, you will remove (or not add) the interfaces directory in each vserver configuration directory and add some new actions to the vshelper tool. Util-vserver is so kind that you can hook some code for vshelper directly in the configuration of your vserver. We will use this ability to bind some vnet device configuration. This for each vserver, put the following lines in /etc/vservers/<vserver_name>/apps/vshelper/startup: <pre class="code">vnet -x <xid> -n <vnid1> -d lo vnet -x <xid> -n <vnid2> -d eth0 -D en0 iptables -t vnet -A PREROUTING -d <vserver_ip> -j VNET --vnet <vnid2> iptables -t vnet -A OUTPUT -s <vserver_ip> -j VNET --vnet <vnid2></pre> And replace: * xid*: by the context id of the vserver * vnid1*: by a uniq 16 bits (0-65535) id of your choice * vnid2*: a different vid still uniq across all vservers * vserver_ip*: by the IP of the vserver Set the executable bit on this flag: <pre class="code">chmod 755 /etc/vservers/<vserver_name>/apps/vshelper/startup</pre> Feel free to enhance this script, it's really a first try. We could take some info in environment/args set by vshelper and compute some uniq ids and then put this script in /etc/vservers/.defaults/apps/vshelper/statup. I you do such a script, please edit this page! The en0 device of the vserver is binded to eth0 of the host. This really depend on your setup. You may change eth0 by something else if eth0 isn't the network device used for your vservers. TODO: clean vnids TODO: add caps <span id="configure-vserver-image"></span> === Configure vserver image === Now, you vserver is started with to devices not configured: lo and en0. It's now the work of the vserver to setup network devices. So you can use scripts provided by the distribution to setup network devices and IPs. Iptables rules allow only some ips to talk to the network, but you can setup any IPs you want on your vserver devices. </div> <div id="footer"> <div class="copyleft"> <br /> Permission is granted to copy, distribute and/or modify this document under the terms of the<br /> [http://www.fsf.org/licenses/fdl.txt GNU Free Documentation License], Version 1.2 or any later version published by the Free Software Foundation. </div> ----- <div id="toolbar-bottom"> [[NGNET-Testing-HOWTO?action=edit|Edit this document]] | [[NGNET-Testing-HOWTO?action=history|View document history]]<br /> </div> Document last modified Fri, 21 Jan 2005 13:05:51<br /> <div class="form"> <br /> Search: </div> </div>
Summary:
Please note that all contributions to Linix VServer may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Linix VServer:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Page actions
Page
Discussion
Read
Edit
History
Page actions
Page
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
About
Overview
Paper
News
Developers
Donations
Search
Getting Started
Downloads
FAQs
Documentation
Support
Participate
How to participate
Report a Bug
Communicate
Teams/Projects
Hall of Fame
Resources
Archives
Recent Wiki Changes
Pastebin
Related Projects
VServer Hosting
Happy VServer Users
Tools
What links here
Related changes
Special pages
Page information