OpenVZ Forum


Home » General » Support » **SOLVED** DHCP server problem inside centos 5.2 VE
**SOLVED** DHCP server problem inside centos 5.2 VE [message #32094] Mon, 21 July 2008 06:26 Go to next message
jiadar is currently offline  jiadar
Messages: 4
Registered: July 2008
Junior Member
I am having trouble running a DHCP server inside a VE. The host node is Centos 5.2 kernel 2.6.18-53.1.19.el5.028stab053.14 and kernel 2.6.24-ovz005.1 on an x86_64 SMP machine.

Except for DHCP, all other TCP network services I have tested (ssh, http, ping) work to and from the host node and container; and also work to/from any other host on my network and the container. I have not tested any other broadcast services (smb, wins, etc).

My firewall is disabled, iptables shows accept with no rules, SELinux is disabled, and my routes seem to be correct. The guest is also running Centos 5.2 which I created with mach, then modified following the instructions in the wiki. I've tried this with a bridge and without, the same results are obtained. The DHCP packets come into VE0 eth0, but never go to the veth interface, and subsequently never make it inside the container.

I've looked at every post I could find concerning DHCP. I don't think a firewall is blocking things. I don't know if it is a problem with my template, as everything else works great. I would appreciate any help and suggestions.

Attached file contains the specific details, tcpdumps, and other diagnostic evidence.

[Updated on: Thu, 24 July 2008 19:23]

Report message to a moderator

Re: DHCP server problem inside centos 5.2 VE [message #32111 is a reply to message #32094] Mon, 21 July 2008 16:42 Go to previous messageGo to next message
jiadar is currently offline  jiadar
Messages: 4
Registered: July 2008
Junior Member
I just tried a DHCP server in a newly created VE with my template, and a newly created VE using the centos-4-x86_64-default template as provided by openvz.. Same result as above.
Re: DHCP server problem inside centos 5.2 VE [message #32127 is a reply to message #32111] Tue, 22 July 2008 10:58 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hi,

to let broadcast packets go through veth you should unite eth0 and veth109.0 into the bridge.

P.S. Could you please also show "iptables -t nat -L", "iptables -t mangle -L".
Re: DHCP server problem inside centos 5.2 VE [message #32145 is a reply to message #32127] Tue, 22 July 2008 21:28 Go to previous messageGo to next message
jiadar is currently offline  jiadar
Messages: 4
Registered: July 2008
Junior Member
[root@VE0 ~]# iptables -t mangle -L

Chain PREROUTING (policy ACCEPT)
target prot opt source destination

Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Chain POSTROUTING (policy ACCEPT)
target prot opt source destination

root@VE0 ~]# iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target prot opt source destination

Chain POSTROUTING (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

[Updated on: Tue, 22 July 2008 21:28]

Report message to a moderator

solution [message #32191 is a reply to message #32094] Thu, 24 July 2008 19:23 Go to previous messageGo to next message
jiadar is currently offline  jiadar
Messages: 4
Registered: July 2008
Junior Member
I've solved this. Apparently, red hat insists that you follow their
convention for creating the bridge. Creating the bridge by using brctl
directly does not work. The following configurations solve the
problem.

1. Create a file /etc/sysconfig/network-scripts/ifcfg-br0

Put in the IP information that was in your primary physical ethernet
device. Change the device from "eth0" to "br0" and type from "ether"
to "Bridge".

2. Modify the /etc/sysconfig/network-scripts/ifcfg-eth0

Modify your primary ethernet interface to be a member of the bridge
with no IP information. Set it to use the bridge.

3. Add a file for each of your veth devices. For instance, for
vethX.0, add a file /etc/sysconfig/network-scripts/ifcfg-vethX.0.

This file is almost the same as eth0. You will add the vethX.0 device
to the bridge.

My actual configuration files are below:

================ifcfg-br0=================
DEVICE=br0
BOOTPROTO=static
BROADCAST=10.0.129.255
IPADDR=10.0.129.4
IPV6INIT=yes
IPV6_AUTOCONF=yes
NETMASK=255.255.255.0
NETWORK=10.0.129.0
ONBOOT=yes
GATEWAY=10.0.129.1
TYPE=Bridge


================ifcfg-eth0=================
DEVICE=eth0
TYPE=ether
BRIDGE=br0
ONBOOT=yes


================ifcfg-veth109.0=================
DEVICE=veth109.0
ONBOOT=yes
STARTMODE=onboot
BRIDGE=br0

================brctl show br0==================
bridge name bridge id STP enabled interfaces
br0 8000.0018510bd235 no veth109.0
eth0
================route -n==================
Destination Gateway Genmask Flags Metric Ref
Use Iface
10.0.129.0 0.0.0.0 255.255.255.0 U 0 0
0 br0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0
0 br0
0.0.0.0 10.0.129.1 0.0.0.0 UG 0 0
0 br0

Re: solution [message #33837 is a reply to message #32191] Thu, 13 November 2008 18:31 Go to previous messageGo to next message
luisdev is currently offline  luisdev
Messages: 11
Registered: July 2008
Junior Member
Good info, thanks.

I would add the following:

- You may have to add the HWADDR parameter with the MAC address to the eth0 configuration script at HN.

- If you have a DROP policy in your iptables FORWARD chain add the following rule to /etc/sysconfig/iptables:

-A FORWARD -p udp --dport bootps -j ACCEPT


- If your VE is also CentOS make sure there is a /etc/sysconfig/network-scripts/ifcfg-eth0 configuration script similar to this:

DEVICE=eth0
ONBOOT=yes
IPADDR=10.0.0.101
NETMASK=255.0.0.0



Re: solution [message #39402 is a reply to message #33837] Fri, 16 April 2010 09:13 Go to previous messageGo to next message
samuthiram is currently offline  samuthiram
Messages: 2
Registered: April 2010
Junior Member
No Message Body

sam

[Updated on: Fri, 16 April 2010 16:10]

Report message to a moderator

Re: DHCP server problem inside centos 5.2 VE [message #39411 is a reply to message #32145] Fri, 16 April 2010 16:12 Go to previous message
samuthiram is currently offline  samuthiram
Messages: 2
Registered: April 2010
Junior Member
hi am new in openvz, can anyone tell me how to configure dhcp vps on dhcp host node.( should configure both vps and host node with dhcp network ).

sam
Previous Topic: SLM MODE is in OVZ or only virtuozo?
Next Topic: Is it possible to access eth0 device from container
Goto Forum:
  


Current Time: Thu Jul 25 22:17:57 GMT 2024

Total time taken to generate the page: 0.03299 seconds