where did the old "ifconfig" file go?

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Nathan England
Date:  
Subject: where did the old "ifconfig" file go?
--=-dqIx0glIKBGFk/H/GEXk
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

What I do is copy the rc.inet1 to a rc.inet3 and then update rc.M to
load rc.inet3=20

# Initialize the NET subsystem.
if [ -x /etc/rc.d/rc.inet1 ]; then
. /etc/rc.d/rc.inet1
. /etc/rc.d/rc.inet2
. /etc/rc.d/rc.inet3



Like that.
That way it loads the correct setup for each...
or do it manually adding it to rc.local

nathan

On Sun, 2001-10-28 at 20:17, Jeff Barker wrote:
> It's me again,
>=20
> I have a simple question:
>=20
> How do I set Linux up to load support for eth1 at boot time? What file do=

I need to edit to use ifconfig on it?
>=20
> If I edit the rc.inet1 to look like this:=20
>=20
> I changed my IP addresses for this email so you can't see it. :) Let's =

assume I'm using the right IP addresses for all fields since they work inde=
pendently.
>=20
> HOSTNAME=3D`cat /etc/HOSTNAME`
>=20
> # Attach the loopback device.
> /sbin/ifconfig lo 127.0.0.1
> /sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo
>=20
> # IF YOU HAVE AN ETHERNET CONNECTION, use these lines below to configure =

the
> # eth0 interface.
>=20
> # Edit these values to set up a static IP address:
> IPADDR=3D"24.x.x.x"   # REPLACE with YOUR IP address!
> NETMASK=3D"255.255.255.0" # REPLACE with YOUR netmask!
> NETWORK=3D"24.x.x.x"    # REPLACE with YOUR network address!
> BROADCAST=3D"24.x.x.x"        # REPLACE with YOUR broadcast address, if y=

ou
>                         # have one. If not, leave blank and edit below.
> GATEWAY=3D"24.x.x.x"    # REPLACE with YOUR gateway address!
>=20
> # To use DHCP instead of a static IP, set this value to "yes":
> DHCP=3D"no"            # Use DHCP ("yes" or "no")
>=20
> # OK, time to set up the interface:
> if [ "$DHCP" =3D "yes" ]; then # use DHCP to set everything up:
>   echo "Attempting to configure eth0 by contacting a DHCP server..."
>   /sbin/dhcpcd
> elif [ ! "$IPADDR" =3D "127.0.0.1" ]; then # set up IP statically:
>   # Set up the ethernet card:
>   echo "Configuring eth0 as ${IPADDR}..."
>   /sbin/ifconfig eth0 ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK}
>=20
>   # If that didn't succeed, give the system administrator some hints:
>   if [ ! $? =3D 0 ]; then
>     cat << EOF
> Your ethernet card was not initialized properly.  Here are some reasons w=

hy this
> may have happened, and the solutions:
> 1. Your kernel does not contain support for your card.  Including all the
>    network drivers in a Linux kernel can make it too large to even boot, =

and
>    sometimes including extra drivers can cause system hangs.  To support =

your
>    ethernet, either edit /etc/rc.d/rc.modules to load the support at boot=

time,
>    or compile and install a kernel that contains support.
> 2. You don't have an ethernet card, in which case you should comment out =

this
>    section of /etc/rc.d/rc.inet1.  (Unless you don't mind seeing this err=

or...)
> EOF
>   fi
>=20
>   # Older kernel versions need this to set up the eth0 routing table:
>   KVERSION=3D`uname -r | cut -f 1,2 -d .`
>   if [ "$KVERSION" =3D "1.0" -o "$KVERSION" =3D "1.1" \
>    -o "$KVERSION" =3D "1.2" -o "$KVERSION" =3D "2.0" -o "$KVERSION" =3D "=

" ]; then
>     /sbin/route add -net ${NETWORK} netmask ${NETMASK} eth0
>   fi
>=20
>   # If there is a gateway defined, then set it up:
>   if [ ! "$GATEWAY" =3D "" ]; then
>     /sbin/route add default gw ${GATEWAY} netmask 0.0.0.0 metric 1
>   fi
> fi
>=20
> # IF YOU HAVE AN ETHERNET CONNECTION, use these lines below to configure =

the
> # eth0 interface.
>   =20
> # Edit these values to set up a static IP address:
> IPADDR2=3D"192.168.x.x"   # REPLACE with YOUR IP address!
> NETMASK2=3D"255.255.255.0" # REPLACE with YOUR netmask!
> NETWORK2=3D"192.168.0.0"    # REPLACE with YOUR network address!
> BROADCAST2=3D"192.168.0.255"        # REPLACE with YOUR broadcast address=

, if you
>                         # have one. If not, leave blank and edit below.
> GATEWAY2=3D"192.168.x.x"    # REPLACE with YOUR gateway address!
>=20
> # To use DHCP instead of a static IP, set this value to "yes":
> DHCP2=3D"no"            # Use DHCP ("yes" or "no") =20
>=20
> # OK, time to set up the interface:
> if [ "$DHCP2" =3D "yes" ]; then # use DHCP to set everything up:
>   echo "Attempting to configure eth1 by contacting a DHCP server..."
>   /sbin/dhcpcd
> elif [ ! "$IPADDR2" =3D "127.0.0.1" ]; then # set up IP statically:
>   # Set up the ethernet card:
>   echo "Configuring eth1 as ${IPADDR2}..."
>   /sbin/ifconfig eth1 ${IPADDR2} broadcast ${BROADCAST2} netmask ${NETMAS=

K2}
>    =20
>   # If that didn't succeed, give the system administrator some hints:
>   if [ ! $? =3D 0 ]; then
>     cat << EOF
> Your ethernet card was not initialized properly.  Here are some reasons w=

hy this
> may have happened, and the solutions:
> 1. Your kernel does not contain support for your card.  Including all the
>    network drivers in a Linux kernel can make it too large to even boot, =

and
>    sometimes including extra drivers can cause system hangs.  To support =

your
>    ethernet, either edit /etc/rc.d/rc.modules to load the support at boot=

time,
>    or compile and install a kernel that contains support.
> 2. You don't have an ethernet card, in which case you should comment out =

this
>    section of /etc/rc.d/rc.inet1.  (Unless you don't mind seeing this err=

or...)
> EOF
>   fi
>=20
>   # Older kernel versions need this to set up the eth0 routing table:
>   if [ "$KVERSION" =3D "1.0" -o "$KVERSION" =3D "1.1" \
>    -o "$KVERSION" =3D "1.2" -o "$KVERSION" =3D "2.0" -o "$KVERSION" =3D "=

" ]; then =20
>     /sbin/route add -net ${NETWORK2} netmask ${NETMASK2} eth1
>   fi
>   =20
>   # If there is a gateway defined, then set it up:
>   if [ ! "$GATEWAY2" =3D "" ]; then
>     /sbin/route add default gw ${GATEWAY2} netmask 0.0.0.0 metric 1
>   fi
> fi
>  =20
>   =20
> # End of rc.inet1
>=20
>=20
> then both seem to get set up by looking at the boot messages, but only th=

e internal eth1 works, I switch back to the original rc.inet1 file ( withou=
t the second half for eth1) and the external connection works, so I am assu=
ming something is conflicting in this script and it uses the second setup.=20
>=20
> What's the proper location to add in the correct lines for ifconfig eth1 =

etc.....
>=20
> There used to be a ifconfig file under /etc in slackware 7 but it's not t=

here in 8. =20
>=20
>=20
>=20




--=-dqIx0glIKBGFk/H/GEXk
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQA73Y21lOcGdOjBBEsRAhPVAJ0f6erGgW7L+WBmspmIDbqALGF2VQCfeqex
19I71pQjFZjh3sY76n2tGNo=
=hJQa
-----END PGP SIGNATURE-----

--=-dqIx0glIKBGFk/H/GEXk--