OpenVZ Forum


Home » General » Support » Doubts configuring DHCP server inside a CT
Doubts configuring DHCP server inside a CT [message #32866] Fri, 05 September 2008 12:13 Go to next message
Santi is currently offline  Santi
Messages: 7
Registered: April 2006
Junior Member
Dear Srs,

I have make a P2V of a Debian Sarge server.. and now I need to install a DHCP inside the CT, I'am following this manual:

http://wiki.openvz.org/DHCP

# vzctl set 3001 --netif_add eth0 --save
Saved parameters for VE 3001

# grep NET /etc/vz/conf/3001.conf 
NETIF="ifname=eth0,mac=00:18:51:87:DB:73,host_ifname=veth3001.0,host_mac=00:18:51:88:37:14"

# brctl show
bridge name     bridge id               STP enabled     interfaces

# brctl addif vzbr0 veth3001.0
bridge vzbr0 does not exist!


I get this error, show I add vzbr0 manually:

# brctl addbr vzbr0

# brctl show
bridge name     bridge id               STP enabled     interfaces
vzbr0           8000.001851883714       no              veth3001.0


Now I get a new error following the tutorial:

# cat /proc/sys/net/ipv4/conf/vzbr0/forwarding 
cat: /proc/sys/net/ipv4/conf/vzbr0/forwarding: No such file or directory


Forcing a "vzbr0 0" I can set forwarding and proxy_arp:

# ifconfig vzbr0 0

# cat /proc/sys/net/ipv4/conf/vzbr0/forwarding 
1

# cat /proc/sys/net/ipv4/conf/vzbr0/proxy_arp 
0
# echo 1 > /proc/sys/net/ipv4/conf/vzbr0/proxy_arp


This is what a I see in the CT:
# vzctl enter 3001

# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:18:51:87:DB:73  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

venet0    Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:127.0.0.1  P-t-P:127.0.0.1  Bcast:0.0.0.0  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)


eth0 has no IP address, so I give a PUBLIC IP address:

# ifconfig eth0 x.y.70.144 netmask 255.255.255.0 up
# route add default gw x.y.70.1 eth0


But I can't see any host from the CT.. so I delete all venet0 routes:

# route -n | egrep venet0
192.0.2.1       0.0.0.0         255.255.255.255 UH    0      0        0 venet0
0.0.0.0         192.0.2.1       0.0.0.0         UG    0      0        0 venet0

# ifdown venet0


But still I can see any external hosts..

What may be wrong?? eth0 inside the CT can have a public IP? Thanks!!

--
Santi Saez
http://woop.es

[Updated on: Fri, 05 September 2008 12:13]

Report message to a moderator

Re: Doubts configuring DHCP server inside a CT [message #32964 is a reply to message #32866] Thu, 11 September 2008 12:46 Go to previous message
Santi is currently offline  Santi
Messages: 7
Registered: April 2006
Junior Member

Dear Srs,

I have still problems to set up a DHCP server inside a CT :-/

Some questions about veth devices in OpenVZ:

- I want to set up a veth for a CT, I need a dedicated NIC for each CT? For example, hardware node has two NICs: eth0 and eth1. eth0 has public IP and is connected to internet, I want to enable veth for a CT, can I use eth0 or I sould use eth1?

- After enabling veth for a CT I try to setup the *public* IP inside the CT into the eth0 device, using ifconfig and route but I can ping the CT, can I use *public* IP inside the CT veth? According to the Wiki it's use a private IP..

Thanks!
Previous Topic: [solved] tcprcvbuf not enough?
Next Topic: [solved] Installation of KnowledgeTree onto OpenVZ
Goto Forum:
  


Current Time: Tue Aug 06 20:37:32 GMT 2024

Total time taken to generate the page: 0.04237 seconds