veth: No Connection between host and guest [message #16289] |
Thu, 30 August 2007 13:21 |
Barzille
Messages: 5 Registered: August 2007
|
Junior Member |
|
|
Hello there,
I am comparing different vm solutions for performance and security aspects and now I want to try out openVZ.
My system is the following:
Ubuntu 7.04 as Host with 2.6.18-028stab035.1-ovz-smp kernel. I installed ubuntu-6.06-i386-minimal template as guest.
Because I want to have an IP Adress for each VE in my LAN and internet access I decided to use veth devices. I performed the following steps mentioned in the wiki:
1. vzctl create 101 --ostemplate ubuntu....
2. vzctl set 101 --hostname guest1 --save
3. vzctl set 101 --netif_add eth0,onerandommacaddress,veth101.0,anotherrandommacaddress --save
4. After that I used the script for persistent veth connection and added those two lines in my config file. VETH_IP_ADDRESS = 192.168.160.94 and CONFIG_CUSTOMIZED="yes"
5. In my host system and in the guest are forwarding, proxy_arp and ip_forward enabled for veth101.0 (host) and eth0 (guest)
6. (guest) /etc/resolve.conf has the same entries as in the file at host
7. I added a default route in guestsystem: /sbin/ip route add default dev eth0
8. and now, there's no connection via ping neither to the host, nor to the internet and vice versa
Any hints?
Thank you
[Updated on: Thu, 30 August 2007 14:30] Report message to a moderator
|
|
|
Re: veth: No Connection between host and guest [message #16294 is a reply to message #16289] |
Thu, 30 August 2007 14:58 |
khorenko
Messages: 533 Registered: January 2006 Location: Moscow, Russia
|
Senior Member |
|
|
Hello,
1) venet is quite suitable to the configuration you described: an IP Adress for each VE in my LAN and internet access, and in this case you don't have to write additional scripts/customize configs.
So venet configuration is much less error prone.
Might be it makes sense to try venet approach?
2) if you still want to use veth, could you please first try to do all the staff manually without making the configuration persistent. In this case you can post the exact commands you typed and we might see something wrong. Please, post here exact commands you do and their outputs.
Thank you.
P.S. also `ip a l` and `ip r l` outputs both in the HN and the VE are appreciated (after the configuration completed).
If your problem is solved - please, report it!
It's even more important than reporting the problem itself...
|
|
|
|
Re: veth: No Connection between host and guest [message #16302 is a reply to message #16296] |
Fri, 31 August 2007 06:55 |
khorenko
Messages: 533 Registered: January 2006 Location: Moscow, Russia
|
Senior Member |
|
|
Barzille wrote on Thu, 30 August 2007 19:10 | Hi,
is it possible to give my ve's ipaddresses with venet, so that they can be used as static machines? For example as Webserver, as Mailserver, as ...? If the answer is yes, then it will do it for my purpose.
|
Yes, using venet you can assign IPs to VEs and use them as you asked.
(just for clarification - if you are going to make VEs accessible from the internet you have to assign them public IPs like to any standalone node or have the deal with source based routing/NAT/etc.)
How to add an IP to venet device: http://wiki.openvz.org/Venet
Differences between veth and venet: http://wiki.openvz.org/Differences_between_venet_and_veth
Also please check your sysctl configuration, this might be the reason of your network failures (especially 'ip_forward' sysctl): http://wiki.openvz.org/Quick_installation#sysctl
Hope this helps.
--
Konstantin.
If your problem is solved - please, report it!
It's even more important than reporting the problem itself...
|
|
|
|
Re: veth: No Connection between host and guest [message #16307 is a reply to message #16305] |
Fri, 31 August 2007 09:36 |
khorenko
Messages: 533 Registered: January 2006 Location: Moscow, Russia
|
Senior Member |
|
|
[HN]# ip a l
...
1: venet0: <BROADCAST,POINTOPOINT,NOARP,UP> mtu 1500 qdisc noqueue
link/void
...
Well, you see venet is not an ethernet device, and in particular it doesn't allow arp packets to go through it (NOARP flag), so it's ok to stay venet0.proxy_arp 0, this shouldn't influence on the system in any case.
If your problem is solved - please, report it!
It's even more important than reporting the problem itself...
|
|
|
|
Re: veth: No Connection between host and guest [message #16315 is a reply to message #16313] |
Fri, 31 August 2007 13:37 |
khorenko
Messages: 533 Registered: January 2006 Location: Moscow, Russia
|
Senior Member |
|
|
Barzille wrote on Fri, 31 August 2007 16:34 | But with 0 it's not working, it has to be 1 in order to have network access.
|
It's very strange and i'd be appreciated if you post here the command (with the output) which doesn't work with proxy_arp on venet0 disabled and works if proxy_arp is "enabled".
Quote: | But my question is how to make it 1 by default at every start up of the virtual machine?
|
For example you can put
echo 1 > /proc/sys/net/ipv4/conf/venet0/proxy_arp
to the /etc/rc.d/rc.local script inside a VE.
If your problem is solved - please, report it!
It's even more important than reporting the problem itself...
|
|
|
|