Editing DHCP

Jump to: navigation, 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.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
[[Category: Networking]]
+
Assumes you have set up vzbr0, as described on [[Virtual Ethernet device]]
 
 
The following article describes how to use DHCP from inside a container. Note that it requires [[veth]] device.
 
 
 
== Set up ==
 
Assumes you have set up vzbr0, as described on [[Virtual Ethernet device]].
 
  
 
<pre>
 
<pre>
vzctl create 144 --ostemplate centos-4-i386-minimal
+
  402  vzctl create 144 --ostemplate centos-4-i386-minimal
vzctl start 144
+
  404  vzctl start 144
vzyum 144 install dhcp
+
  405  vzyum 144 install dhcp
vzctl set 144 --netif_add eth0 --save
+
  408  vzctl set 144 --netif_add eth0 --save
brctl show
+
  409  brctl show
 
+
  412  brctl addif vzbr0 veth144.0
brctl addif vzbr0 veth144.0
+
  413  ifconfig vzbr0
ifconfig vzbr0
+
  414  cat /proc/sys/net/ipv4/conf/vzbr0/forwarding  
cat /proc/sys/net/ipv4/conf/vzbr0/forwarding  
+
  415  cat /proc/sys/net/ipv4/conf/vzbr0/proxy_arp  
cat /proc/sys/net/ipv4/conf/vzbr0/proxy_arp  
+
  417  echo 1 > /proc/sys/net/ipv4/conf/vzbr0/forwarding  
echo 1 > /proc/sys/net/ipv4/conf/vzbr0/forwarding  
+
  418  echo 1 > /proc/sys/net/ipv4/conf/vzbr0/proxy_arp  
echo 1 > /proc/sys/net/ipv4/conf/vzbr0/proxy_arp  
 
 
</pre>
 
</pre>
  
 
Instructions largely borrowed from http://oob.freeshell.org/nzwireless/dhcpd.html
 
Instructions largely borrowed from http://oob.freeshell.org/nzwireless/dhcpd.html
  
== Sample DHCPD.conf ==
+
== Sample DHCPD.conf
 
<pre>
 
<pre>
 
# Sample /etc/dhcpd.conf
 
# Sample /etc/dhcpd.conf
Line 63: Line 57:
 
</pre>
 
</pre>
  
<pre>
+
</pre>
 
Host$ cp /etc/sysconfig/network /vz/root/144/etc/sysconfig/network
 
Host$ cp /etc/sysconfig/network /vz/root/144/etc/sysconfig/network
 
</pre>
 
</pre>
 
<pre>
 
vz144$ service dhcpd start
 
</pre>
 
 
== External links ==
 
* http://www.cpqlinux.com/dhcpd.html - create static IPs, debugging etc.
 
* http://mailman.vyatta.com/pipermail/vyatta-users/2007-September/001858.html - not configured to listen on any interfaces
 
* http://forum.openvz.org/index.php?t=msg&goto=22072& - diagnosis
 
* http://www.google.ca/search?q=DHCPDARGS+brctl - searches for help on getting a virtual bridge to work with DHCPD
 
* http://www.linuxfoundation.org/en/Net:Bridge - great explanation of bridging
 

Please note that all contributions to OpenVZ Virtuozzo Containers Wiki may be edited, altered, or removed by other contributors. If you don't want your writing to be edited mercilessly, then don't submit it here.
If you are going to add external links to an article, read the External links policy first!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)
Retrieved from "https://wiki.openvz.org/DHCP"