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 Go to previous message](/theme/ovz3/images/up.png) |
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
|
|
|