Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2011
    Location
    Vancouver, Canada
    Posts
    329

    OpenVZ + CentOS = containers can't access the internet

    I'm hoping somebody can help me here, I've been trying to make this work for 2 days now.

    I have a CentOS server setup that has OpenVZ, and I've created a CentOS container for it.

    The hardware node can connect to the internet just fine. The container cannot.

    ifconfig for the hardware node
    Code:
    eth0      Link encap:Ethernet  HWaddr 00:25:90:0A:BE:70
              inet addr:172.24.57.131  Bcast:172.24.57.255  Mask:255.255.255.128
              inet6 addr: fe80::225:90ff:fe0a:be70/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:4248 errors:0 dropped:0 overruns:0 frame:0
              TX packets:23 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:633986 (619.1 KiB)  TX bytes:1690 (1.6 KiB)
              Interrupt:169 Memory:fb5e0000-fb600000
    
    eth1      Link encap:Ethernet  HWaddr 00:25:90:0A:BE:71
              inet addr:184.95.42.2  Bcast:184.95.42.15  Mask:255.255.255.240
              inet6 addr: fe80::225:90ff:fe0a:be71/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:198989 errors:0 dropped:0 overruns:0 frame:0
              TX packets:122216 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:257730710 (245.7 MiB)  TX bytes:12020061 (11.4 MiB)
              Interrupt:177 Memory:fb6e0000-fb700000
    
    eth1:1    Link encap:Ethernet  HWaddr 00:25:90:0A:BE:71
              inet addr:184.95.42.3  Bcast:184.95.42.15  Mask:255.255.255.240
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              Interrupt:177 Memory:fb6e0000-fb700000
    
    eth1:2    Link encap:Ethernet  HWaddr 00:25:90:0A:BE:71
              inet addr:184.95.42.4  Bcast:184.95.42.15  Mask:255.255.255.240
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              Interrupt:177 Memory:fb6e0000-fb700000
    
    eth1:3    Link encap:Ethernet  HWaddr 00:25:90:0A:BE:71
              inet addr:184.95.42.5  Bcast:184.95.42.15  Mask:255.255.255.240
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              Interrupt:177 Memory:fb6e0000-fb700000
    
    eth1:4    Link encap:Ethernet  HWaddr 00:25:90:0A:BE:71
              inet addr:184.95.42.6  Bcast:184.95.42.15  Mask:255.255.255.240
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              Interrupt:177 Memory:fb6e0000-fb700000
    
    eth1:5    Link encap:Ethernet  HWaddr 00:25:90:0A:BE:71
              inet addr:184.95.42.7  Bcast:184.95.42.15  Mask:255.255.255.240
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              Interrupt:177 Memory:fb6e0000-fb700000
    
    eth1:6    Link encap:Ethernet  HWaddr 00:25:90:0A:BE:71
              inet addr:184.95.42.8  Bcast:184.95.42.15  Mask:255.255.255.240
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              Interrupt:177 Memory:fb6e0000-fb700000
    
    eth1:7    Link encap:Ethernet  HWaddr 00:25:90:0A:BE:71
              inet addr:184.95.42.9  Bcast:184.95.42.15  Mask:255.255.255.240
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              Interrupt:177 Memory:fb6e0000-fb700000
    
    eth1:8    Link encap:Ethernet  HWaddr 00:25:90:0A:BE:71
              inet addr:184.95.42.10  Bcast:184.95.42.15  Mask:255.255.255.240
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              Interrupt:177 Memory:fb6e0000-fb700000
    
    eth1:9    Link encap:Ethernet  HWaddr 00:25:90:0A:BE:71
              inet addr:184.95.42.11  Bcast:184.95.42.15  Mask:255.255.255.240
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              Interrupt:177 Memory:fb6e0000-fb700000
    
    eth1:10   Link encap:Ethernet  HWaddr 00:25:90:0A:BE:71
              inet addr:184.95.42.12  Bcast:184.95.42.15  Mask:255.255.255.240
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              Interrupt:177 Memory:fb6e0000-fb700000
    
    eth1:11   Link encap:Ethernet  HWaddr 00:25:90:0A:BE:71
              inet addr:184.95.42.13  Bcast:184.95.42.15  Mask:255.255.255.240
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              Interrupt:177 Memory:fb6e0000-fb700000
    
    eth1:12   Link encap:Ethernet  HWaddr 00:25:90:0A:BE:71
              inet addr:184.95.42.14  Bcast:184.95.42.15  Mask:255.255.255.240
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              Interrupt:177 Memory:fb6e0000-fb700000
    
    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:72 errors:0 dropped:0 overruns:0 frame:0
              TX packets:72 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:9258 (9.0 KiB)  TX bytes:9258 (9.0 KiB)
    
    venet0    Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
              inet6 addr: fe80::1/128 Scope:Link
              UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
              RX packets:2 errors:0 dropped:0 overruns:0 frame:0
              TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:80 (80.0 b)  TX bytes:88 (88.0 b)
    
    veth200.0 Link encap:Ethernet  HWaddr 00:18:51:BF:D5:BD
              inet6 addr: fe80::218:51ff:febf:d5bd/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:4 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:7 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:312 (312.0 b)  TX bytes:0 (0.0 b)
    ifconfig for the container
    Code:
    eth0      Link encap:Ethernet  HWaddr 00:18:51:EA:E2:E1
              inet addr:184.95.42.2  Bcast:0.0.0.0  Mask:255.255.255.255
              inet6 addr: fe80::218:51ff:feea:e2e1/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:0 (0.0 b)  TX bytes:312 (312.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:40 errors:0 dropped:0 overruns:0 frame:0
              TX packets:40 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:3180 (3.1 KiB)  TX bytes:3180 (3.1 KiB)
    
    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:2 errors:0 dropped:0 overruns:0 frame:0
              TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:88 (88.0 b)  TX bytes:80 (80.0 b)
    
    venet0:0  Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
              inet addr:184.95.42.14  P-t-P:184.95.42.14  Bcast:184.95.42.14  Mask:255.255.255.255
              UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
    The above is a result of using the VETH guide found here: http://wiki.openvz.org/Virtual_Ethernet_device

    The error I'm getting from the container when trying to access the web is:

    Code:
    [[email protected] /]# ping google.com
    ping: unknown host google.com
    
    [[email protected] /]# wget http://www.google.com/
    --2011-04-24 14:05:15--  http://www.google.com/
    Resolving www.google.com... failed: Temporary failure in name resolution.
    wget: unable to resolve host address `www.google.com'
    Can somebody point me in the right direction here? I've been doing a lot of Google searching and finding people have run into the same problem, but I haven't found a solution posted anywhere.

  2. #2
    Join Date
    Aug 2010
    Location
    Indiana
    Posts
    150
    To start off with, the IP address are bound to eth1. When you are using a server for VPS hosting, this can not be. You will to unbind these IP address then you will be able to access the net from the VPS. To do this, you will need to delete records for eth1:1 thru eth1:12. These can be found in /etc/sysconfig/network-scripts/. Once you have those deleted, you will need to restart the network service by running this command, service network restart.

    I also see that you have the VPS assigned the same IP address as eth1. If this is the main IP address that is used to access the server form the web, I would change that. What I mean by that is you can't assign that IP address to a VPS as it is bound to a eth device.
    Brian Oliver - COO
    XFuse Solutions, LLC
    Fusing Superior Support with Superior Web Solutions
    http://www.xfusesolutions.com

  3. #3
    Join Date
    Jan 2011
    Location
    Vancouver, Canada
    Posts
    329
    Thanks, I temporary unbound the eth1:12 device and then added a nameserver to the VPS and it finally worked.

    Now I just have to get yum working lol.

    Thanks

  4. #4
    Join Date
    Aug 2010
    Location
    Indiana
    Posts
    150
    Quote Originally Posted by Christian Little View Post
    Thanks, I temporary unbound the eth1:12 device and then added a nameserver to the VPS and it finally worked.

    Now I just have to get yum working lol.

    Thanks
    What is the error that you are getting with yum?
    Brian Oliver - COO
    XFuse Solutions, LLC
    Fusing Superior Support with Superior Web Solutions
    http://www.xfusesolutions.com

Similar Threads

  1. Problem with OpenVZ Containers
    By BLundy-Tegatai in forum VPS Hosting
    Replies: 4
    Last Post: 08-26-2010, 07:54 PM
  2. Replies: 7
    Last Post: 02-17-2010, 03:07 PM
  3. Awknet OpenVZ containers
    By sspt in forum VPS Hosting Offers
    Replies: 0
    Last Post: 06-20-2009, 03:56 PM
  4. OpenVZ containers :: Free IPv6 :: 21$/mo plus 50% credit
    By sspt in forum VPS Hosting Offers
    Replies: 4
    Last Post: 01-05-2009, 12:33 PM
  5. Resell Internet Access from Statewide Internet
    By Benjamin in forum Other Offers & Requests
    Replies: 4
    Last Post: 01-31-2003, 12:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •