Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


OpenVZ Network connectivity issues on the VM's
New on LowEndTalk? Please Register and read our Community Rules.

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:

  1. 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.

  2. 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.

    Thanked by 1PremiumN
  • AlexanderMAlexanderM Member, Top Host, Host Rep
    edited February 2016

    Have you added the DNS resolvers?

    vzctl set 101 --nameserver 8.8.8.8 --nameserver 4.2.2.2 --save

    Alexander

    Thanked by 1PremiumN
  • PremiumNPremiumN Member
    edited February 2016

    @AutoSnipe said:
    vzctl set 101 --nameserver 8.8.8.8 --nameserver 8.8.4.4 --save;

    re-enter, and it should be working.

    @AlexanderM said:
    Have you added the DNS resolvers?

    vzctl set 101 --nameserver 8.8.8.8 --nameserver 8.8.4.4 --save

    Alexander

    Already tried this, no luck

  • Check firewall rules also.

  • @sdglhm said:
    Check firewall rules also.

    iptables has been turned off completely

  • Are you by any chance on ovh ?

    Thanked by 1PremiumN
  • mike0000mike0000 Member
    edited February 2016

    @PremiumN Did you enable IPv4 forwarding in sysctl?

    Edit: just saw that pinging IPs works. Nevermind...

    Thanked by 1PremiumN
  • linuxthefishlinuxthefish Member
    edited February 2016

    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:

    net.ipv4.ip_forward = 1
    net.ipv6.conf.default.forwarding = 1
    net.ipv6.conf.all.forwarding = 1
    net.ipv4.conf.default.proxy_arp = 0
    net.ipv4.conf.all.rp_filter = 1
    kernel.sysrq = 1
    net.ipv4.conf.default.send_redirects = 1
    net.ipv4.conf.all.send_redirects = 0
    net.ipv6.conf.all.proxy_ndp = 1
    net.ipv4.ip_forward=1

    And make sure "cat /etc/resolv.conf" inside the container lists the DNS servers you are using.

    Thanked by 1PremiumN
  • @sdglhm said:
    Are you by any chance on ovh ?

    No

    @mikeyur said:
    PremiumN Did you enable IPv4 forwarding in sysctl?

    Yes

    net.ipv4.ip_forward = 1

  • NEIGHBOR_DEVS set to all

  • This is what I use for sysctl.conf on OpenVZ nodes:

    net.ipv4.ip_forward = 1
    > net.ipv6.conf.default.forwarding = 1
    > net.ipv6.conf.all.forwarding = 1
    > net.ipv4.conf.default.proxy_arp = 0
    > net.ipv4.conf.all.rp_filter = 1
    > kernel.sysrq = 1
    > net.ipv4.conf.default.send_redirects = 1
    > net.ipv4.conf.all.send_redirects = 0
    > net.ipv6.conf.all.proxy_ndp = 1
    > net.ipv4.ip_forward=1

    I pretty much have the same config

    And make sure "cat /etc/resolv.conf" inside the container lists the DNS servers you are using.

    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?

  • @mikeyur said:
    Have you tried a different template?

    Yes, tried centos and ubuntu templates. Same issue

  • PremiumNPremiumN Member
    edited February 2016

    @sdglhm said:
    Could you paste your network configuration on vm?

    Contents of /etc/vz/conf/101.conf:

        http://pastie.org/private/cpcqzgcnxxfre0bdqo6xha
    

    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.

  • @linuxthefish said:
    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

  • @PremiumN said:
    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.

  • @linuxthefish said:
    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:/#

  • linuxthefishlinuxthefish Member
    edited February 2016

    PremiumN said: root@test:/# host google.com 8.8.8.8

    ;; 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

  • @PremiumN said:
    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.

  • @PremiumN said:
    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).

    Thanked by 1PremiumN
  • @linuxthefish said:
    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.

    Ok so i did this, dns does work on the main node.

    The issue is still not fixed :/

    Thanked by 1linuxthefish
  • 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

Sign In or Register to comment.