SuSE 9.3 domU /sbin/ifup workaround

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

SuSE 9.3 domU /sbin/ifup workaround

Robbie Dinn
Hi all

I have a SuSE 9.3 domU. It has a eth0 interface, corresponding
to some vif interface in the dom0. Running

   ifup eth0

doesn't seem to work. This means I don't get any network.

It seems that /sbin/ifup relies upon /sbin/getcfg but getcfg
does not seem to find the right configuration for the eth0 device.

A attached a patch below with a work around for this. It's
only a work around, because it patches ifup, but I think the
real problem might be with getcfg.

If you want to try this patch, I suggest keeping the original
file around, like so

   mv /sbin/ifup /sbin/ifup.orig
   cp /sbin/ifup.orig /sbin/ifup
   cat patch-ifup | patch /sbin/ifup

hope that helps someone.

--- /sbin/ifup.orig 2005-03-21 16:03:50.000000000 +0000
+++ /sbin/ifup 2005-06-13 14:34:29.000000000 +0000
@@ -127,6 +127,17 @@
 INTERFACE=$HWD_INTERFACE_0
 case $SCRIPTNAME in
  ifup)
+ # XXX HACK STARTS
+ case $INTERFACE in
+ eth[0-9])
+ if [ -z "$HWD_CONFIG_0" \
+ -a -e /sys/class/net/${INTERFACE}/address ] ; then
+ HWD_CONFIG_0="eth-id-$(cat /sys/class/net/${INTERFACE}/address)"
+ fi
+ ;;
+ *) ;;
+ esac
+ # XXX HACK ENDS
  if [ -z "$CONFIG" -a "$DHCP" = yes ] ; then
  # This time we were called from dhcpcd just to finish setup (hooks,
  # routes) and thus must use for sure the same config as in the first

_______________________________________________
Xen-users mailing list
[hidden email]
http://lists.xensource.com/xen-users
Reply | Threaded
Open this post in threaded view
|

Re: SuSE 9.3 domU /sbin/ifup workaround

Robbie Dinn
Replying to my own post...

I forgot to say that I had to manually create my
network device configuration file, because the
Yast tool can't detect the ethernet device automatically.
(getcfg broken?)

Here is one way you could do it, adapt for you site.
(I have not tested this, so watch for my typos,
word wrap etc...)

cat >"/etc/sysconfig/network/ifcfg-eth-id-$(cat
/sys/class/net/eth0/address) <<eof
IPADDR=10.2.8.2
NETMASK=255.0.0.0
NETWORK=10.255.255.255
STARTMODE=onboot
USERCONTROL=no
eof

hope that helps

_______________________________________________
Xen-users mailing list
[hidden email]
http://lists.xensource.com/xen-users
Reply | Threaded
Open this post in threaded view
|

Re: SuSE 9.3 domU /sbin/ifup workaround

Gerd Hoffmann
Robbie Dinn <[hidden email]> writes:

> cat >"/etc/sysconfig/network/ifcfg-eth-id-$(cat
> /sys/class/net/eth0/address) <<eof

You can simply name that file "ifcfg-eth0" ;)

  Gerd

--
-mm seems unusually stable at present.
        -- akpm about 2.6.12-rc3-mm3

_______________________________________________
Xen-users mailing list
[hidden email]
http://lists.xensource.com/xen-users