LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware network scripts inside OpenVZ container (http://www.linuxquestions.org/questions/slackware-14/slackware-network-scripts-inside-openvz-container-4175423257/)

yenn 08-21-2012 01:00 PM

Slackware network scripts inside OpenVZ container
 
I'm trying to run Slackware inside OpenVZ container with bridged network. The network itself works, but only if I set it manually, which means I have to start VM and then enable networking inside VM every (re)start. Apparently Slackware rc.inet1 script(s) arent't executed, which is strange because Debian init scripts works without a glitch.

Anyone encountered this issue?

Didier Spaier 08-21-2012 01:58 PM

Simplest things first. Did you check that /etc/rc.d/rc.inet1 be executable?

yenn 08-21-2012 05:19 PM

Yes, rc.inet1 is executable and it is actually executed during boot.

After hour or so fiddling with init scripts I figured out that problem is somewhere else. There are two network interfaces (besides loopback) - venet0 (NAT) and eth0 (bind to bridge) - and rc.inet1 recognize first network interface (venet0) as eth0, therefore assign IP address to this interface. I'm curious why because of the comment in /etc/rc.d/rc.inet1.conf
Code:

# If IFNAME[interface] is unset or empty, it is assumed you're configuring eth<interface>.
And /etc/rc.d/rc.inet1
Code:

. /etc/rc.d/rc.inet1.conf

MAXNICS=${MAXNICS:-6}

i=0
while [ $i -lt $MAXNICS ];
do
  IFNAME[$i]=${IFNAME[$i]:=eth${i}}
  i=$(($i+1))
done

However, workaround is simple:
Code:

# /etc/rc.d/rc.inet1.conf
# prepend this to NIC definition
IFNAME[0]="eth0"

IPADDR[0]="a.a.a.a"
NETMASK[0]="n.n.n.n"

And by the way, if anyone is interested, Slackware 13.37 minimal template for OpenVZ isn't very good. Missing wget, slackpkg and messed routes in /etc/rc.d/rc.inet1 take some time to get working minimal system. If you want to run Slackware inside OpenVZ, create your own template.


All times are GMT -5. The time now is 03:32 AM.