Difference between revisions of "util-vserver:Cheatsheet"

From Linux-VServer

Jump to: navigation, search
(util-vserver cheatsheet: typo fixing, beautification, some additional command lines)
Line 3: Line 3:
 
ok,
 
ok,
  
here is my cheatsheet for util-vserver. I figured a lot by hand so i would like to share some here. This is a draft:
+
here is my cheatsheet for util-vserver. I figured a lot by hand so i would like to share some here. This is a draft:
  
 +
== How to add an IP address to a guest ==
  
 
+
# create the address on the host: <pre>ifconfig eth0:10 172.16.0.145/12</pre> or <pre>ip addr add dev eth0 172.16.0.145/12</pre> or even <pre>ip addr add dev dummy0 172.16.0.145/12</pre>
==HOT ADD AN ADRESS TO A GUEST:==
+
# add the adress:<pre>naddress --nid guestname --add --ip 172.16.0.145 --bcast 172.31.255.255</pre>
 
+
#* Depending on what you use the vserver for, you may not want the broadcast thing at all; you can also use a /32 mask for the IP in this case.
# create the address on the host:   <br/>       '''ifconfig eth0:10 172.16.0.145/12'''<br/>
+
# add the ip to the config directory to make it stick if you restart  
# add the adress:<br/>       '''naddress --nid guestname --add --ip 172.16.0.145 --bcast 172.31.255.255'''
+
# enter the guest and verify services that need to listen on the ip, restart if necessary (for me it was not).
# add the ip to the config directory to make it sticjk if you restart  
+
# enter the guest and verify services that need to listen to the ip, restart fi necessary (for me it was not).
+

Revision as of 00:19, 29 October 2008

util-vserver cheatsheet

ok,

here is my cheatsheet for util-vserver. I figured a lot by hand so i would like to share some here. This is a draft:

How to add an IP address to a guest

  1. create the address on the host:
    ifconfig eth0:10 172.16.0.145/12
    or
    ip addr add dev eth0 172.16.0.145/12
    or even
    ip addr add dev dummy0 172.16.0.145/12
  2. add the adress:
    naddress --nid guestname --add --ip 172.16.0.145 --bcast 172.31.255.255
    • Depending on what you use the vserver for, you may not want the broadcast thing at all; you can also use a /32 mask for the IP in this case.
  3. add the ip to the config directory to make it stick if you restart
  4. enter the guest and verify services that need to listen on the ip, restart if necessary (for me it was not).
Personal tools