All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
OpenVZ Network connectivity issues on the VM's
Sorry if this is a noob question. Im trying to learn some stuff with OpenVZ.
I installed openvz and kernel, created user 101, assigned it a DEDICATED IP address (using this tutorial: https://lowendbox.com/blog/tutorial-getting-started-with-openvz/)
Now the problem is, when i enter the VM 101 (vzctl enter 101), there seems to be a connection issue because:
When i try to ping google.com, it says "ping: unknown host google.com"
NOTE: Pinging to 8.8.8.8 or any of the server IP's work just fine.When i try to run "yum update", i see the following error
"Loaded plugins: fastestmirror
Setting up Update Process
Determining fastest mirrors
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os&infra=stock error was
14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"
Error: Cannot find a valid baseurl for repo: base"
Please note that on the master node, i do not have any of these problems. The problems exist within the VM's
It seems like an easy solution, but i just cannot figure it out. I also tried installing the OpenVZ Web panel and creating a VM from the interface itself, but it made no difference.
Thanks!!
Comments
vzctl set 101 --nameserver 8.8.8.8 --nameserver 8.8.4.4 --save;
re-enter, and it should be working.
Have you added the DNS resolvers?
vzctl set 101 --nameserver 8.8.8.8 --nameserver 4.2.2.2 --save
Alexander
Already tried this, no luck
Check firewall rules also.
iptables has been turned off completely
Are you by any chance on ovh ?
@PremiumN Did you enable IPv4 forwarding in sysctl?
Edit: just saw that pinging IPs works. Nevermind...
If you have dig preinstalled, try "dig google.com @8.8.8.8" and see if you get an answer. This is what I use for sysctl.conf on OpenVZ nodes:
And make sure "cat /etc/resolv.conf" inside the container lists the DNS servers you are using.
No
Yes
net.ipv4.ip_forward = 1
NEIGHBOR_DEVS? https://openvz.org/Man/vz.conf.5
NEIGHBOR_DEVS set to all
This is what I use for sysctl.conf on OpenVZ nodes:
I pretty much have the same config
yes, it as the nameservers 8.8.8.8 and 8.8.4.4
Have you tried a different template?
Have you tried turning it off and on. ;-)
Could you paste your network configuration on vm?
Yes, tried centos and ubuntu templates. Same issue
Contents of /etc/vz/conf/101.conf:
Contents of /etc/vz/vz.conf:
http://pastie.org/private/gjrel2b67hfpb5p90obulg
Did you try running "dig google.com @8.8.8.8" and seeing if it returns DNS records? I think some ubuntu templates have dig already installed.
dig command is not installed by default. Cannot use yum install either on the vms
Give "host google.com 8.8.8.8" a try, should be on the ubuntu template if not on CentOS.
root@test:/# host google.com 8.8.8.8 ;; connection timed out; no servers could be reached root@test:/#
;; connection timed out; no servers could be reached
root@test:/#
It's not something stupid like your host blocking port 53 outbound on the non main IP or forcing you to use their DNS servers? CC/HVH has a habit of blocking UDP ports and not telling you in tickets.
What dedi host are you using? A workaround for now could be to run a DNS resolver on the main server, and allow recursive for the extra /27 or whatever you have containers on.
@linuxthefish ill contact HVH and see if they've blocked it
Change the main IP of your server to the IP you are currently using for the container and see if dns continues to work on the main node.
Very strange issue, openvz is one of those things you type 3 commands to set it up and it just works!
Apparently they are not blocking anything.
I usely run the feathur slave installer for openvz it works perfectly (no need to install the master unless you want feathur itself).
Ok so i did this, dns does work on the main node.
The issue is still not fixed
So @linuxthefish managed to fix it for me. THANKS!!
Apparently, he disabled some unwanted iptable rules and deleted some ifcfg files in /etc/sysconfig/network-scripts