Find the answer to your Linux question:
Results 1 to 1 of 1
Hi everybody, I'm having a heck of a time here and was hoping somebody could help me. I've got a server that I've installed OpenVZ on, and am using CentOS ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2011
    Posts
    1

    OpenVZ + CentOS, enabling internet access on containers


    Hi everybody,

    I'm having a heck of a time here and was hoping somebody could help me.

    I've got a server that I've installed OpenVZ on, and am using CentOS for it's containers.

    The hardware node can access the internet just fine, but the individual containers cannot access the internet at all.


    On the test container I created, I assigned eth1:12 to it using this command:

    Code:
    vzctl set 200 --netif_add eth1:12 --save
    I picked that specific eth because it has the IP assigned to it that I want for this container.

    ifconfig on the hardware node is showing the following:

    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:2296 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:343663 (335.6 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:193498 errors:0 dropped:0 overruns:0 frame:0
              TX packets:118297 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:257261410 (245.3 MiB)  TX bytes:11027923 (10.5 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
              inet addr:209.188.23.6  Bcast:209.188.23.255  Mask:255.255.255.0
              inet6 addr: fe80::218:51ff:febf:d5bd/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:0 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:0 (0.0 b)  TX bytes:0 (0.0 b)
    
    veth200.1 Link encap:Ethernet  HWaddr 00:18:51:99:67:40
              inet addr:209.188.23.6  Bcast:209.188.23.255  Mask:255.255.255.0
              inet6 addr: fe80::218:51ff:fe99:6740/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:0 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:0 (0.0 b)  TX bytes:0 (0.0 b)
    ifconfig in the container is resulting in the following:

    Code:
    eth1:12: error fetching interface information: Device not found
    Additionally, when setting up the container I did add the IP in question via:

    Code:
    vzctl set 200 --ipadd 184.95.42.141 --sav

    From what I've been reading online, it seems that I'm supposed to disable eth1:12 on the hardware node as OpenVZ will supposedly deal with it, and I tried that by entering:

    Code:
    ifconfig eth1:12 down
    But that didn't seem to do anything, so I brought it back online.

    Can somebody help me out here? I've been working on this for 2 days and haven't been able to get the container to be able to connect to the internet at all.



    EDIT: I followed the VETH guide on the openVZ website and now I've got the following for ifconfig on 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
    However still not internet access for the container, any ideas?
    Last edited by ChrisLittle; 04-24-2011 at 09:09 PM.

Posting Permissions

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