OpenVZ Forum


Home » General » Support » Changed gentoo-add_ip.sh to work with baselayout-vserver-1.11.14-r3
Changed gentoo-add_ip.sh to work with baselayout-vserver-1.11.14-r3 [message #1851] Wed, 01 March 2006 09:13 Go to next message
steffen.zieger is currently offline  steffen.zieger
Messages: 43
Registered: February 2006
Location: Germany, Stuttgart
Member
Hello,

I've fixed the gentoo-add_ip.sh to work again with baselayout-vserver-1.11.14-r3.
Also I've fixed a hardcoded venet0 where it wasn't necessary.

Here is a diff:
--- gentoo-add_ip.sh.orig       2006-03-01 09:46:27.806261592 +0100
+++ gentoo-add_ip.sh    2006-03-01 09:48:43.808586096 +0100
@@ -37,7 +37,7 @@
        rc-update del net.eth0 &>/dev/null
        ln -sf /etc/init.d/net.lo /etc/init.d/net.${VENET_DEV}
        rc-update add net.lo boot &>/dev/null
-       rc-update add net.venet0 default &>/dev/null
+       rc-update add net.${VENET_DEV}  default &>/dev/null
        if ! grep -qe "^config_eth" ${IFCFG} 2>/dev/null; then
                return 0
        fi
@@ -54,7 +54,7 @@
        fix_net
        put_param3 ${IFCFG} "config_${VENET_DEV}" ""
        # add fake route
-       put_param3 ${IFCFG} "routes_${VENET_DEV}" "-net ${FAKEGATEWAYNET}/24"
+       put_param3 ${IFCFG} "routes_${VENET_DEV}" "-net ${FAKEGATEWAYNET} netmask 255.255.255.255 dev ${VENET_DEV}"
        add_param3 ${IFCFG} "routes_${VENET_DEV}" "default via ${FAKEGATEWAY}"
        # Set up /etc/hosts
        if [ ! -f ${HOSTFILE} ]; then


At the moment, I'm trying to get an gentoo-template for productivity to work.
I'm in the last steps. There is only one problem left with disk quota.

HAND,
Steffen
Re: Changed gentoo-add_ip.sh to work with baselayout-vserver-1.11.14-r3 [message #1858 is a reply to message #1851] Wed, 01 March 2006 16:02 Go to previous messageGo to next message
disaster is currently offline  disaster
Messages: 158
Registered: February 2006
Senior Member
Hello!

I've tried your patch but my gentoo VPS installation still does not work. After starting - it is still not started... any idea?

Thanks!

Stefan

[Updated on: Wed, 01 March 2006 16:19]

Report message to a moderator

Re: Changed gentoo-add_ip.sh to work with baselayout-vserver-1.11.14-r3 [message #1862 is a reply to message #1858] Wed, 01 March 2006 22:03 Go to previous messageGo to next message
steffen.zieger is currently offline  steffen.zieger
Messages: 43
Registered: February 2006
Location: Germany, Stuttgart
Member
Hello,

If you start your gentoo-vps, are there any errors shown?

What does vzlist show, after you've run vzctl VPSID start?

I can make a archive of my gentoo-vps, if you want to try with it, but at the moment, there is a problem with disk quota, as it says, that there is no space left on device.
If I check the free space with df, it says, there are 4GB left on device!?!

HAND,
Steffen
Re: Changed gentoo-add_ip.sh to work with baselayout-vserver-1.11.14-r3 [message #1870 is a reply to message #1851] Thu, 02 March 2006 08:11 Go to previous messageGo to next message
disaster is currently offline  disaster
Messages: 158
Registered: February 2006
Senior Member
vzctl start 61
Starting VPS ...
VPS is unmounted
VPS is mounted
Adding IP address(es): 85.158.177.248
Setting CPU limit: 30
Setting CPU units: 1500
Set hostname: vps2.vpsdns.de
File resolv.conf was modified
Setting quota ugidlimit: 2000
VPS start in progress...


vzlist shows nothing about VPS ID 61 Sad
Re: Changed gentoo-add_ip.sh to work with baselayout-vserver-1.11.14-r3 [message #1871 is a reply to message #1870] Thu, 02 March 2006 08:16 Go to previous messageGo to next message
steffen.zieger is currently offline  steffen.zieger
Messages: 43
Registered: February 2006
Location: Germany, Stuttgart
Member
Hello,

try to use a VPSID above 100.

HTH,
Steffen
Re: Changed gentoo-add_ip.sh to work with baselayout-vserver-1.11.14-r3 [message #1872 is a reply to message #1851] Thu, 02 March 2006 08:27 Go to previous messageGo to next message
disaster is currently offline  disaster
Messages: 158
Registered: February 2006
Senior Member
I've deleted my not working image yesterday Sad so i'll wait till somebody release one... Sad
Re: Changed gentoo-add_ip.sh to work with baselayout-vserver-1.11.14-r3 [message #1873 is a reply to message #1872] Thu, 02 March 2006 08:31 Go to previous messageGo to next message
steffen.zieger is currently offline  steffen.zieger
Messages: 43
Registered: February 2006
Location: Germany, Stuttgart
Member
If you've got the time, try to create a vps with your gentoo-template using before. I'm sure it works, if you're using an VPSID above 100.

HAND,
Steffen
Re: Changed gentoo-add_ip.sh to work with baselayout-vserver-1.11.14-r3 [message #1874 is a reply to message #1851] Thu, 02 March 2006 15:16 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

Steffen,

Thanks for the patch!

Can you explain why you add ' netmask 255.255.255.255' instead of '/24' in fake gateway route like? Other changes are obvious and really needed, but this one is the one I do not understand.

Hopefully we will release a fixed vzctl soon; for now you can take a look at the bugs #110 and #111.


Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: Changed gentoo-add_ip.sh to work with baselayout-vserver-1.11.14-r3 [message #1875 is a reply to message #1874] Thu, 02 March 2006 16:08 Go to previous messageGo to next message
steffen.zieger is currently offline  steffen.zieger
Messages: 43
Registered: February 2006
Location: Germany, Stuttgart
Member
Hello,

because if there is /24, the gentoo-vserver-init-script (to be correct: route is complaining) is complaining about an unknown device or something like that.

man route:
route add -net 192.56.76.0 netmask 255.255.255.0 dev eth0
              adds a route to the network 192.56.76.x via "eth0". The Class C netmask  modi-
              fier  is  not really necessary here because 192.* is a Class C IP address. The
              word "dev" can be omitted here.


Don't know for sure, if it is really needed, but if it's missing, it's not working Smile

HTH,
Steffen
Re: Changed gentoo-add_ip.sh to work with baselayout-vserver-1.11.14-r3 [message #1876 is a reply to message #1875] Thu, 02 March 2006 16:30 Go to previous messageGo to next message
steffen.zieger is currently offline  steffen.zieger
Messages: 43
Registered: February 2006
Location: Germany, Stuttgart
Member
Hello,

here is the error message if I'm having only
-net 191.255.255.1 dev venet0
in /etc/conf.d/net on gentoo:
+ [[ -net 191.255.255.1/24 dev venet0 == *:* ]]
+ /sbin/route add -net 191.255.255.1/24 dev venet0
route: netmask doesn't match route address
Usage: route [-nNvee] [-FC] [<AF>]           List kernel routing tables
       route [-v] [-FC] {add|del|flush} ...  Modify routing table for AF.

       route {-h|--help} [<AF>]              Detailed usage syntax for specified AF.
       route {-V|--version}                  Display version/author and exit.

        -v, --verbose            be verbose
        -n, --numeric            don't resolve names
        -e, --extend             display other/more information
        -F, --fib                display Forwarding Information Base (default)
        -C, --cache              display routing cache instead of FIB

  <AF>=Use '-A <af>' or '--<af>'; default: inet
  List of possible address families (which support routing):
    inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25)
    netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP)
    x25 (CCITT X.25)
+ eend 4
+ local retval=4
+ shift
+ _eend 4 eerror ''
+ local retval=4 efunc=eerror msg
+ shift 2
+ [[ 4 == 0 ]]
+ [[ -n '' ]]
+ msg='[ !! ]'
+ [[ yes == yes ]]                                                                                                                                                                                                                                                          [ !! ]' echo -e '                                                                                                                                                                                                                                                                 [ !! ]
+ return 4
+ LAST_E_CMD=eend
+ return 4
+ for x in '"${routes[@]}"'
+ x='default gw 191.255.255.1'
+ ebegin 'default gw 191.255.255.1'
+ local 'msg=default gw 191.255.255.1' dots spaces=
+ [[ no == yes ]]
+ [[ -n '' ]]
+ msg='default gw 191.255.255.1 ...'
+ einfon 'default gw 191.255.255.1 ...'
+ [[ no == yes ]]
+ [[ yes != yes ]]
+ echo -ne ' *     default gw 191.255.255.1 ...'
 *     default gw 191.255.255.1 ...+ LAST_E_CMD=einfon
+ return 0
+ [[ yes == yes ]]
+ echo

+ LAST_E_LEN=35
+ LAST_E_CMD=ebegin
+ return 0
+ [[ default gw 191.255.255.1 == *:* ]]
+ /sbin/route add default gw 191.255.255.1
SIOCADDRT: Network is unreachable
+ eend 7


It's working with
-net 191.255.255.1 netmask 255.255.255.255 dev venet0
as you can see here:
+ return 0
+ [[ -net 191.255.255.1 netmask 255.255.255.255 dev venet0 == *:* ]]
+ /sbin/route add -net 191.255.255.1 netmask 255.255.255.255 dev venet0
+ eend 0



HTH,
Steffen

PS: The way my patch is working, it's done for debian too.
debian-add_ip.sh:
up route add -net ${FAKEGATEWAY} netmask 255.255.255.255 dev ${VENET_DEV}

[Updated on: Thu, 02 March 2006 16:32]

Report message to a moderator

Re: Changed gentoo-add_ip.sh to work with baselayout-vserver-1.11.14-r3 [message #1944 is a reply to message #1876] Thu, 09 March 2006 16:00 Go to previous messageGo to next message
steffen.zieger is currently offline  steffen.zieger
Messages: 43
Registered: February 2006
Location: Germany, Stuttgart
Member
Am I missing something or is this already fixed in vzctl-3.0.0-2?

I couldn't find anything about this issue in the announcement, but it seems to me, as it is fixed.

Thanks for clarifying,
Steffen

[Updated on: Thu, 09 March 2006 16:00]

Report message to a moderator

Re: Changed gentoo-add_ip.sh to work with baselayout-vserver-1.11.14-r3 [message #1946 is a reply to message #1944] Thu, 09 March 2006 16:25 Go to previous messageGo to next message
steffen.zieger is currently offline  steffen.zieger
Messages: 43
Registered: February 2006
Location: Germany, Stuttgart
Member
Sorry for the noise, it isn't solved in 3.0.0-2.

But I've got another issue. Don't worry, it's on the same subject.

If the route is added like this:
/sbin/route add -net 191.255.255.0 netmask 255.255.255.255 dev venet0

it isn't working. The route is probably added, but the default gateway couldn't be added.

Here is the error:
+ /sbin/route add default gw 191.255.255.1
SIOCADDRT: Network is unreachable


If I'm changing the first mentioned line to the following:
/sbin/route add -net 191.255.255.1 netmask 255.255.255.255 dev venet0

it's working as expected.

Patch for gentoo-add_ip.sh
--- gentoo-add_ip.sh.orig       2006-03-09 17:18:49.632621776 +0100
+++ gentoo-add_ip.sh    2006-03-09 17:20:27.096804968 +0100
@@ -22,7 +22,6 @@
 VENET_DEV=venet0

 FAKEGATEWAY=191.255.255.1
-FAKEGATEWAYNET=191.255.255.0

 IFCFG_DIR=/etc/conf.d
 IFCFG=${IFCFG_DIR}/net
@@ -37,7 +36,7 @@
        rc-update del net.eth0 &>/dev/null
        ln -sf /etc/init.d/net.lo /etc/init.d/net.${VENET_DEV}
        rc-update add net.lo boot &>/dev/null
-       rc-update add net.venet0 default &>/dev/null
+       rc-update add net.${VENET_DEV} default &>/dev/null
        if ! grep -qe "^config_eth" ${IFCFG} 2>/dev/null; then
                return 0
        fi
@@ -54,7 +53,7 @@
        fix_net
        put_param3 ${IFCFG} "config_${VENET_DEV}" ""
        # add fake route
-       put_param3 ${IFCFG} "routes_${VENET_DEV}" "-net ${FAKEGATEWAYNET}/24"
+       put_param3 ${IFCFG} "routes_${VENET_DEV}" "-net ${FAKEGATEWAY} netmask 255.255.255.255 dev ${VENET_DEV}"
        add_param3 ${IFCFG} "routes_${VENET_DEV}" "default via ${FAKEGATEWAY}"
        # Set up /etc/hosts
        if [ ! -f ${HOSTFILE} ]; then


Patch for debian-add_ip.sh
--- debian-add_ip.sh.orig       2006-03-09 17:18:59.885063168 +0100
+++ debian-add_ip.sh    2006-03-09 17:20:40.979694448 +0100
@@ -22,7 +22,6 @@
 VENET_DEV=venet0
 LOOPBACK=lo
 FAKEGATEWAY=191.255.255.1
-FAKEGATEWAYNET=191.255.255.0
 CFGFILE=/etc/network/interfaces
 HOSTFILE=/etc/hosts



Patch for slackware-9-add_ip.sh
--- slackware-9.x_add_ip.sh.orig        2006-03-09 17:19:13.631973320 +0100
+++ slackware-9.x_add_ip.sh     2006-03-09 17:20:51.514092976 +0100
@@ -23,7 +23,6 @@
 VENET_DEV=venet0

 FAKEGATEWAY=191.255.255.1
-FAKEGATEWAYNET=191.255.255.0

 IFCFG_DIR=/etc/rc.d
 IFCFG=${IFCFG_DIR}/rc.inet1


Patch for slackware-add_ip.sh
--- slackware-add_ip.sh.orig    2006-03-09 17:19:23.728438424 +0100
+++ slackware-add_ip.sh 2006-03-09 17:21:03.118328864 +0100
@@ -23,7 +23,6 @@
 VENET_DEV=venet0

 FAKEGATEWAY=191.255.255.1
-FAKEGATEWAYNET=191.255.255.0

 IFCFG_DIR=/etc/rc.d
 IFCFG=${IFCFG_DIR}/rc.inet1.conf


I've removed the unused ${FAKEGATEWAYNET} where I've found it.

The released patch for gentoo-add_ip.sh fixes all reported errors of me.

HTH,
Steffen

PS: The noise I've made was louder than I've thought
Re: Changed gentoo-add_ip.sh to work with baselayout-vserver-1.11.14-r3 [message #1948 is a reply to message #1944] Thu, 09 March 2006 16:34 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

Hmm if my memory serves me well it will be finally fixed in vzctl-3.0.0-3 (due next week). And it is probably already fixed in Gentoo ebuild for vzctl as well.

Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: Changed gentoo-add_ip.sh to work with baselayout-vserver-1.11.14-r3 [message #1978 is a reply to message #1948] Fri, 10 March 2006 16:13 Go to previous messageGo to next message
Jason Stubbs is currently offline  Jason Stubbs
Messages: 18
Registered: March 2006
Location: Japan
Junior Member
I ran across the same problem but fixed it in baselayout-vserver-1.11.14-r3 itself. It's actually broken in baselayout-1.11.14 as well. baselayout-1.12.* appears to do things properly although I haven't actually tested it yet. I pushed this to Hollow but I'm not sure if he's included it or not yet. I'll follow up on it tomorrow with him or (on of) the baselayout maintainer(s) tomorrow.

--- lib/rcscripts/net.modules.d/ifconfig.orig	2006-03-01 18:43:39.682268472 +0900
+++ lib/rcscripts/net.modules.d/ifconfig	2006-03-01 18:43:52.476323480 +0900
@@ -278,9 +278,9 @@
 		ebegin "${x}"
 		# Support adding IPv6 addresses easily
 		if [[ ${x} == *:* && ${x} != *'-A inet6'* ]]; then
-			/sbin/route add -A inet6 ${x} &>${devnull}
+			/sbin/route add -A inet6 ${x} dev ${iface} &>${devnull}
 		else
-			/sbin/route add ${x} &>${devnull}
+			/sbin/route add ${x} dev ${iface} &>${devnull}
 		fi
 		eend $?
 	done

Re: Changed gentoo-add_ip.sh to work with baselayout-vserver-1.11.14-r3 [message #1980 is a reply to message #1978] Fri, 10 March 2006 16:20 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

By looking into your code I wonder what if 'dev NNN' will already be given in the route command? It needs to be backward-compatible IMO, so check if there is no 'dev NNN' then add it.

Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: Changed gentoo-add_ip.sh to work with baselayout-vserver-1.11.14-r3 [message #1983 is a reply to message #1980] Sat, 11 March 2006 03:38 Go to previous messageGo to next message
Jason Stubbs is currently offline  Jason Stubbs
Messages: 18
Registered: March 2006
Location: Japan
Junior Member
Specifying something like routes_venet0=( "default via 191.255.255.1 dev venet0" ) was never supported. It will break when iproute2 is installed and it will break with baselayout-1.12.*. The device name is given in the variable name. It's just a bug in baselayout-1.11's ifconfig support module that the device name isn't passed to the route command automatically.

[Updated on: Sat, 11 March 2006 03:38]

Report message to a moderator

Re: Changed gentoo-add_ip.sh to work with baselayout-vserver-1.11.14-r3 [message #1984 is a reply to message #1983] Sat, 11 March 2006 09:53 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

Quote:

It will break when iproute2 is installed

Well, ip command accepts dev argument. Or is there something in iproute2 networking module that adds dev automatically?

Still, the final question is: how do we make it work? We have added 'dev venet0' argument because of the bug in baselayout (and baselayout-vserver), now baselayout will be fixed and we will again change the poor script to remove 'dev venet0'. Looks like no way to fix it so it will work in all cases, with all (recent) baselayouts.

This is bad. Sad


Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: Changed gentoo-add_ip.sh to work with baselayout-vserver-1.11.14-r3 [message #1985 is a reply to message #1984] Sat, 11 March 2006 10:27 Go to previous messageGo to next message
Jason Stubbs is currently offline  Jason Stubbs
Messages: 18
Registered: March 2006
Location: Japan
Junior Member
UPDATE: It seems the patch didn't get lost. It's been sitting in subversion and awaiting a release. I've asked that baselayout-vserver get a bump with the patch included until baselayout itself is ready for another release. The bug can be tracked at http://bugs.gentoo.org/show_bug.cgi?id=125786


The following snippet is from the baselayout's iproute2 module:

iproute2_post_start() {
        local iface=${1} ifvar=$( interface_variable ${1} ) routes e r

        # Make sure interface is marked UP
        iproute2_up ${iface}

        eval routes=( \"\$\{routes_${ifvar}\[@\]\}\" )

        # Test for old style ipaddr variable
        if [[ -z ${routes} ]]; then
                eval routes=( \"\$\{iproute_${ifvar}\[@\]\}\" )
        fi

        [[ -z ${routes} ]] && return 0

        # Set routes with ip route -- this might also include default route
        einfo "Adding routes"
        eindent
        for x in "${routes[@]}"; do
                # Support net-tools routing too
                x=${x//gw/via}
                x=${x//-A inet6}

                einfo "${x}"
                e=$( ip route append dev ${iface} ${x} 2>&1 )
                case "${e}" in
                        'RTNETLINK answers: File exists'|'')
                                eend 0
                                ;;
                        *) printf '%s\n' "${e}" >&2
                                eend 1
                                ;;
                esac
        done
        eoutdent

        return 0
}


The routes variables takes on the value of whatever routes_venet0 is so with a value of ( "default via 191.255.255.1 dev venet0" ) the command would end up being `ip route append dev venet0 default via 191.255.255.1 dev venet0`. The same thing will happen with either the iproute2 module or ifconfig module with the newer baselayout version.

In my opinion, I would say it the best course of action would be to leave vzctl as it is for the moment. I opened a bug with Gentoo today (as I should have done in the first place) as my 'verbal' report seems to have got lost. It shouldn't take too long for a newer version to come out. Either hollow or uberlord on irc.freenode.net could give you a better idea on the timeline.

[Updated on: Sat, 11 March 2006 12:31]

Report message to a moderator

Re: Changed gentoo-add_ip.sh to work with baselayout-vserver-1.11.14-r3 [message #1986 is a reply to message #1985] Sat, 11 March 2006 14:33 Go to previous messageGo to next message
steffen.zieger is currently offline  steffen.zieger
Messages: 43
Registered: February 2006
Location: Germany, Stuttgart
Member
So, updating to baselayout-1.12 will 'fix' the error with dev venet0, but there is no backwards compatibility.

For example, vzctl will be updated to fix this error, it's not working with baselayout-1.12. If vzctl is not fixing this error, it's not working with baselayout-1.11.

What about telling the baselayout-vserver people on gentoo, trying to fix this bug with a check, if there is 'dev venet0' added in the routes-line and printing out a message to the user?
So it is the user, who is responsible for fixing it in /etc/conf.d/net (removing dev venet0 in case of baselayout-1.12).

Another way of fixing this is checking via emerge which baselayout-version is installed before adding the ip. I think it should be possible to check via vzctl exec VPSID 'emerge -s baselayout-vserver |grep installed |cut -d: -f 2|cut -d" " -f 2' and doing the needed things in gentoo-add_ip.sh.

Maybe there is an easier way of doing the same, I'm trying to get it to work.

HTH,
Steffen
Re: Changed gentoo-add_ip.sh to work with baselayout-vserver-1.11.14-r3 [message #1987 is a reply to message #1986] Sat, 11 March 2006 15:03 Go to previous messageGo to next message
Jason Stubbs is currently offline  Jason Stubbs
Messages: 18
Registered: March 2006
Location: Japan
Junior Member
Is a version of vzctl with the modified gentoo-add_ip.sh released yet? If not, it's not too late. I'm sure that Hollow will put together a new set of stages once a fixed version of baselayout-vserver is released. Once that's done there'll be no problems from there on out and it will be compatible with older versions of vzctl as well. Is there any reason why vzctl must work with broken versions of baselayout-vserver?
Re: Changed gentoo-add_ip.sh to work with baselayout-vserver-1.11.14-r3 [message #1988 is a reply to message #1987] Sat, 11 March 2006 15:09 Go to previous messageGo to next message
steffen.zieger is currently offline  steffen.zieger
Messages: 43
Registered: February 2006
Location: Germany, Stuttgart
Member
A 'fixed' version of vzctl is not released yet.

Sure, there is no need, that vzctl has to work with broken baselayout-vserver-versions, but there is a need of displaying a message, if the user of an gentoo-template has fixed this error with adding dev venet0 to network-configuration.

So, if there are users using gentoo in OpenVZ in a productive environment (as I do) they should get informed, I think.

HAND,
Steffen
Re: Changed gentoo-add_ip.sh to work with baselayout-vserver-1.11.14-r3 [message #1989 is a reply to message #1988] Sat, 11 March 2006 16:02 Go to previous messageGo to next message
Jason Stubbs is currently offline  Jason Stubbs
Messages: 18
Registered: March 2006
Location: Japan
Junior Member
Heh.. I think that we might just look at things from a different perspective. As nothing has been officially released, I personally wouldn't go out on a limb. People in production should be testing upgrades before rolling them out - especially after modifying parts of the previously installed packages.

Also, if compatibility is the biggest concern, there's no way to figure out what version of baselayout-vserver is installed long term. Parsing emerge output is unsafe as there's no guarantees it won't change, nor are there guarantees that the parameters given to emerge won't change. There isn't even a guarantee that the name "baselayout-vserver" won't change.

From my point of view, the best/most that can be done for the long term is to put the information into the release notes if there are any. Something to the effect of "Issues with Gentoo VPS networking have to been resolved. All users are advised to upgrade to vzctl-3.0.0-3 and baselayout-vserver-1.11.14-r4."

baselayout-vserver-1.11.14-r4 has just been released by the way. It should be hitting the mirrors soon.

[Updated on: Sat, 11 March 2006 16:02]

Report message to a moderator

Re: Changed gentoo-add_ip.sh to work with baselayout-vserver-1.11.14-r3 [message #1990 is a reply to message #1989] Sat, 11 March 2006 17:52 Go to previous messageGo to next message
steffen.zieger is currently offline  steffen.zieger
Messages: 43
Registered: February 2006
Location: Germany, Stuttgart
Member
So, we have to wait until baselayout-vserver-1.11.14-r4 is marked stable and telling people, that they should change their network-config (this is, because of some people want to have a useable gentoo-template). No problem.

I've updated to the new baselayout-vserver and it works.
Here is a new patch to gentoo-add_ip.sh:
--- gentoo-add_ip.sh.orig       2006-03-01 09:46:27.000000000 +0100
+++ gentoo-add_ip.sh    2006-03-11 18:47:52.805755280 +0100
@@ -22,7 +22,6 @@
 VENET_DEV=venet0

 FAKEGATEWAY=191.255.255.1
-FAKEGATEWAYNET=191.255.255.0

 IFCFG_DIR=/etc/conf.d
 IFCFG=${IFCFG_DIR}/net
@@ -37,7 +36,7 @@
        rc-update del net.eth0 &>/dev/null
        ln -sf /etc/init.d/net.lo /etc/init.d/net.${VENET_DEV}
        rc-update add net.lo boot &>/dev/null
-       rc-update add net.venet0 default &>/dev/null
+       rc-update add net.${VENET_DEV}  default &>/dev/null
        if ! grep -qe "^config_eth" ${IFCFG} 2>/dev/null; then
                return 0
        fi
@@ -54,7 +53,7 @@
        fix_net
        put_param3 ${IFCFG} "config_${VENET_DEV}" ""
        # add fake route
-       put_param3 ${IFCFG} "routes_${VENET_DEV}" "-net ${FAKEGATEWAYNET}/24"
+       put_param3 ${IFCFG} "routes_${VENET_DEV}" "-net ${FAKEGATEWAY} netmask 255.255.255.255"
        add_param3 ${IFCFG} "routes_${VENET_DEV}" "default via ${FAKEGATEWAY}"
        # Set up /etc/hosts
        if [ ! -f ${HOSTFILE} ]; then

This version is working with baselayout-vserver-1.11.14-r4. Because of a bug in previous baselayout-vserver-versions you have to update to baselayout-vserver-1.11.14-r4 or newer.

HTH,
Steffen

PS@Jason: The whole gentoo-add_ip.sh-script isn't using iproute2. The problem you mentioned some posts ago (dev venet0 problem) isn't interesting for vzctl until gentoo-add_ip.sh will be updated to use iproute2. This is only an informational note.
Re: Changed gentoo-add_ip.sh to work with baselayout-vserver-1.11.14-r3 [message #1991 is a reply to message #1990] Sun, 12 March 2006 02:02 Go to previous messageGo to next message
Jason Stubbs is currently offline  Jason Stubbs
Messages: 18
Registered: March 2006
Location: Japan
Junior Member
I don't like being picky, but gentoo-ip_add.sh doesn't care about iproute2 either way. It only updates the config with an IP address and route. After adding modules_venet0=( "iproute2" ) to conf.d/net of the VPS, any rerunning of gentoo-add_ip.sh won't touch it.

This point is moot anyway because the ifconfig module of 1.12.0 worked properly before I alerted anyone. What that means is that the "ticking time bomb" was always there. I just sped it up a little.
Re: Changed gentoo-add_ip.sh to work with baselayout-vserver-1.11.14-r3 [message #1995 is a reply to message #1991] Sun, 12 March 2006 13:50 Go to previous messageGo to next message
steffen.zieger is currently offline  steffen.zieger
Messages: 43
Registered: February 2006
Location: Germany, Stuttgart
Member
So, I think we can 'fix' this bug with an update to baselayout-vserver-1.11.14-r4 or newer and using the patch shown in my previous post, right?

HAND,
Steffen
Re: Changed gentoo-add_ip.sh to work with baselayout-vserver-1.11.14-r3 [message #2000 is a reply to message #1995] Mon, 13 March 2006 04:24 Go to previous message
Jason Stubbs is currently offline  Jason Stubbs
Messages: 18
Registered: March 2006
Location: Japan
Junior Member
put_param3 ${IFCFG} "routes_${VENET_DEV}" "-net ${FAKEGATEWAYNET}/24"

baselayout-1.11.14-r4/ifconfig: Works
baselayout-1.11.14-r4/iproute2: "-net" parameter isn't handled
baselayout-1.12.0_pre16/ifconfig: Works
baselayout-1.12.0_pre16/iproute2: Works


put_param3 ${IFCFG} "routes_${VENET_DEV}" "-net ${FAKEGATEWAY} netmask 255.255.255.255"

baselayout-1.11.14-r4/ifconfig: Works
baselayout-1.11.14-r4/iproute2: "-net" and "netmask" parameters aren't handled
baselayout-1.12.0_pre16/ifconfig: Works
baselayout-1.12.0_pre16/iproute2: "netmask" parameter isn't handled


put_param3 ${IFCFG} "routes_${VENET_DEV}" "${FAKEGATEWAY}"

baselayout-1.11.14-r4/ifconfig: Works
baselayout-1.11.14-r4/iproute2: Works
baselayout-1.12.0_pre16/ifconfig: Works
baselayout-1.12.0_pre16/iproute2: Defaults to "-net" if not specified (not a network)


put_param3 ${IFCFG} "routes_${VENET_DEV}" "${FAKEGATEWAY}/32"

baselayout-1.11.14-r4/ifconfig: Works
baselayout-1.11.14-r4/iproute2: Works
baselayout-1.12.0_pre16/ifconfig: Defaults to "-net" if not specified (ifconfig thinks /32 net is invalid)
baselayout-1.12.0_pre16/iproute2: Works


put_param3 ${IFCFG} "routes_${VENET_DEV}" "${FAKEGATEWAYNET}/24"

baselayout-1.11.14-r4/ifconfig: Works
baselayout-1.11.14-r4/iproute2: Works
baselayout-1.12.0_pre16/ifconfig: Works
baselayout-1.12.0_pre16/iproute2: Works


Hence, I'd leave it as it is now (other than the s/venet/${VENET_DEV} change) or go with:

--- gentoo-add_ip.sh.orig       2006-03-01 09:46:27.000000000 +0100
+++ gentoo-add_ip.sh    2006-03-11 18:47:52.805755280 +0100
@@ -37,7 +36,7 @@
        rc-update del net.eth0 &>/dev/null
        ln -sf /etc/init.d/net.lo /etc/init.d/net.${VENET_DEV}
        rc-update add net.lo boot &>/dev/null
-       rc-update add net.venet0 default &>/dev/null
+       rc-update add net.${VENET_DEV}  default &>/dev/null
        if ! grep -qe "^config_eth" ${IFCFG} 2>/dev/null; then
                return 0
        fi
@@ -54,7 +53,7 @@
        fix_net
        put_param3 ${IFCFG} "config_${VENET_DEV}" ""
        # add fake route
-       put_param3 ${IFCFG} "routes_${VENET_DEV}" "-net ${FAKEGATEWAYNET}/24"
+       put_param3 ${IFCFG} "routes_${VENET_DEV}" "${FAKEGATEWAYNET}/24"
        add_param3 ${IFCFG} "routes_${VENET_DEV}" "default via ${FAKEGATEWAY}"
        # Set up /etc/hosts
        if [ ! -f ${HOSTFILE} ]; then


1.11.14 modules only handle the gw/via difference. The modules in 1.12 also handle -net and -host/scope translations. Hence, the current setting is descriptive and will be fully supported with future versions, whereas the above patch would make it less descriptive and would rely on 1.12's (likely to be forward-compatible) -net route assumption but is compatible with all versions.

[Updated on: Tue, 14 March 2006 02:37]

Report message to a moderator

Previous Topic: Multicast support
Next Topic: 64Bit CPU Required for high RAM OpenVZ Servers?
Goto Forum:
  


Current Time: Fri Jul 12 18:35:15 GMT 2024

Total time taken to generate the page: 0.02439 seconds