OpenVZ howto network issue

Discussion in 'HOWTO-Related Questions' started by zinnium, Dec 24, 2011.

  1. zinnium

    zinnium New Member

    I am using the "Installing And Using OpenVZ On Debian Squeeze (AMD64)" by Falko.

    The install guide worked 100% and I am only having the trouble trying to get my networking setup.

    I have set all 5 IPs and my nameservers up but the system will not connect out to the internet. The 5 IPs are set to the main OS and should forward to the device as well.

    my /etc/network/interfaces looks as follows minus the text added

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    auto lo
    iface lo inet loopback

    # Auto generated venet0 interface
    auto vented
    iface venet0 inet static
    address 127.0.0.1
    netmask 255.255.255.255
    broadcast 0.0.0.0
    up route add -net 192.0.2.1 netmask 255.255.255.255 dev venet0
    auto venet0:0
    iface venet0:0 inet static
    address 201.94.247.146
    netmask 255.255.255.255
    broadcast 0.0.0.0
    gateway 192.0.2.1

    auto venet0:1
    iface venet0:1 inet static
    address 201.94.247.147
    netmask 255.255.255.255
    broadcast 0.0.0.0

    auto venet0:2
    iface venet0:2 inet static
    address 201.94.247.148
    netmask 255.255.255.255
    broadcast 0.0.0.0

    auto venet0:3
    iface venet0:3 inet static
    address 201.94.247.149
    netmask 255.255.255.255
    broadcast 0.0.0.0

    auto venet0:4
    iface venet0:4 inet static
    address 201.94.247.150
    netmask 255.255.255.255
    broadcast 0.0.0.0
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    The netmask is incorrect and I need to fix that. Broadcast is also incorrect.
     
  2. zinnium

    zinnium New Member

    I think this is a common problem.

    I had been trying to find the answer for 4 hours now, and I keep finding users who issued a similar questions to this same issue. No one has ever answered the question though.
     
  3. zinnium

    zinnium New Member

    anyone???

    I am just trying to connect out.
     
  4. zinnium

    zinnium New Member

    I am still working on this:

    I think the issues lay inside the /etc/vz/vz.conf file. I am doing reading on this, but here is my default /etc/vz/vz.conf that came installed when I installed openvz

    ## Global parameters
    VIRTUOZZO=yes
    LOCKDIR=/var/lib/vz/lock
    DUMPDIR=/var/lib/vz/dump
    VE0CPUUNITS=1000

    ## Logging parameters
    LOGGING=yes
    LOGFILE=/var/log/vzctl.log
    LOG_LEVEL=0
    VERBOSE=0

    ## Disk quota parameters
    DISK_QUOTA=yes
    VZFASTBOOT=no

    # Disable module loading. If set, vz initscript do not load any modules.
    #MODULES_DISABLED=yes

    # The name of the device whose IP address will be used as source IP for CT.
    # By default automatically assigned.
    #VE_ROUTE_SRC_DEV="eth0"


    # Controls which interfaces to send ARP requests and modify APR tables on.
    NEIGHBOUR_DEVS=all

    ## Fail if there is another machine in the network with the same IP
    ERROR_ON_ARPFAIL="no"

    ## Template parameters
    TEMPLATE=/var/lib/vz/template

    ## Defaults for containers
    VE_ROOT=/var/lib/vz/root/$VEID
    VE_PRIVATE=/var/lib/vz/private/$VEID
    CONFIGFILE="basic"
    DEF_OSTEMPLATE="centos-5"

    ## Load vzwdog module
    VZWDOG="no"

    ## IPv4 iptables kernel modules
    IPTABLES="ipt_REJECT ipt_tos ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length"
    ## Enable IPv6
    IPV6="no"

    ## IPv6 ip6tables kernel modules
    IP6TABLES="ip6_tables ip6table_filter ip6table_mangle ip6t_REJECT"
     
  5. zinnium

    zinnium New Member

    Whats odd is that according to everything I read, this should have worked right out of the box if I followed falko's instructions.

    However there is a lot of users who have this off issue of the system failing out of the box. My issues seem to be quite common, but there is no one out there who has listed a solution.
     
  6. zinnium

    zinnium New Member

  7. falko

    falko Super Moderator Howtoforge Staff

    I've never had any networking issues with OpenVZ. I see you use

    Code:
    # Controls which interfaces to send ARP requests and modify APR tables on.
    NEIGHBOUR_DEVS=all
    so normally everything should be working. :confused:

    Did you ask your provider if they need a special network setup for their data centers?
     
  8. zinnium

    zinnium New Member

    @Falko,

    thats exactly it... Everything says your setup is 100% proper.

    i am going to uninstall fail2ban. I am wondering if thats causing it.
     
  9. falko

    falko Super Moderator Howtoforge Staff

    Please let us know if you find a solution. :)
     
  10. wagoo

    wagoo New Member

    I just encountered the same thing, and after a bit of head-scratching got things working. I suspect your problem is this:

    I also configured the spare IP I wanted to use in the host OS as a virtual eth0:X interface.. as soon as I removed it from /etc/network/interfaces and rebooted (you may not need to reboot, but I seem to recall downing an eth0:X interface took eth0 with it last time I tried)... then the container picked up that IP no problem, and networking from inside started to work.

    I assumed, the host OS would do all the routing but did need to have that IP assigned to it.. but seems like that was the thing getting in the way. :) Hope this helps with your problem too.
     
  11. zinnium

    zinnium New Member

    OK... I am tying right now.
     
  12. zinnium

    zinnium New Member

    @Wagoo

    that works 100%... ???

    That makes no sense at all. If I follow the entire directions on the OpenVZ wiki and Falko's info; we should be able to simply setup the networking on the host and recycle the IPs on to the containers. All the documentation clearly says that is 100% workable.
     
  13. falko

    falko Super Moderator Howtoforge Staff

    Wait - did you add the IPs that you want to use in your containers to the /etc/network/interfaces file on the host? If so, this might be the problem. No network configuration is needed for these IPs on the host - just allocate them to your containers, and you're done.
     

Share This Page