Commit 4c0d4455 authored by Mike Hibler's avatar Mike Hibler
Browse files

More Studly Magic to get RHL 9 to DHCP on all interfaces without

touching a standard script
parent 523c2872
......@@ -61,7 +61,9 @@ bin-install: dir-install
etc-install: dir-install sysetc-remove sysetc-install
sysetc-install: ifcfgs dir-install
# $(INSTALL) -m 755 ifcfg-eth[0-9]* $(SYSETCDIR)/sysconfig/network-scripts
$(INSTALL) -m 644 $(SRCDIR)/modules.conf $(SYSETCDIR)/modules.conf
$(INSTALL) -m 644 $(SRCDIR)/ifcfg-eth99 $(SYSETCDIR)/sysconfig/network-scripts
$(INSTALL) -m 644 ifcfg-eth[0-9]* $(SYSETCDIR)/sysconfig/network-scripts
sysetc-remove:
......@@ -70,5 +72,5 @@ script-install: dir-install $(SCRIPTS)
sfs-install:
# create ifcfg-eth? files
ifcfgs: # $(SRCDIR)/mkifcfgs $(SRCDIR)/ifcfg.template
# $(SRCDIR)/mkifcfgs $(SRCDIR)/ifcfg.template
ifcfgs: $(SRCDIR)/mkifcfgs $(SRCDIR)/ifcfg.template
$(SRCDIR)/mkifcfgs $(SRCDIR)/ifcfg.template
#
# HACK: run dhclient on all interfaces, and do nothing else
#
# Note that this file's name (eth99) cannot overlap with an actual
# existing interface or dhclient will loop. dhclient-script invokes
# the source-config function which sources the ifcfg-ethN file. Thus
# if this script were called "ifcfg-eth0" and eth0 was the DHCPable
# interface, we would wind up recursively invoking dhclient (trust me,
# I tried it :-)
#
DEVICE="eth99"
IFACETYPES="3c59x e100 e1000 tulip"
#
# First, probe for all our supported ethernet types
#
modprobe -qa $IFACETYPES
#
# If dhclient returns success, then it has configured the first interface
# and gone into background mode. At that point we don't care about it any
# more and just kill it. We also set ONBOOT=no to prevent ifup (our caller)
# from doing any further configuration on this fake interface.
#
if [ -x /sbin/dhclient ] && /sbin/dhclient -q ; then
killall dhclient
ONBOOT="no"
else
# eat flaming death
exit 1
fi
IPADDR=""
NETMASK=""
IPXNETNUM_802_2=""
IPXPRIMARY_802_2="no"
IPXACTIVE_802_2="no"
IPXNETNUM_802_3=""
IPXPRIMARY_802_3="no"
IPXACTIVE_802_3="no"
IPXNETNUM_ETHERII=""
IPXPRIMARY_ETHERII="no"
IPXACTIVE_ETHERII="no"
IPXNETNUM_SNAP=""
IPXPRIMARY_SNAP="no"
IPXACTIVE_SNAP="no"
#!/bin/sh
#
# Create some ifcfg-eth files based on a template
#
if [ $# != 1 ]; then
echo "usage: $0 template-file"
exit 1
fi
for netif in 0 1 2 3 4 5 6 7 8 9; do
cat > ifcfg-eth${netif} <<FOO
#
# Auto-generated by $0.
# You know the drill: DO NOT EDIT, blah, blah, blah...
#
# ifcfg_eth99 is where the Emulab control net setup takes place,
# it invokes dhclient on all interfaces. However, dhclient-script
# expects to find an ifcfg_ethN file for each interface it wants to
# probe. So we put a stub here that does nothing (courtesy of ONBOOT=no).
#
DEVICE="eth${netif}"
ONBOOT="no"
FOO
cat $1 >> ifcfg-eth${netif}
done
alias char-major-10-200 tun
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment