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!
=== 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>
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