where did the old "ifconfig" file go?

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Jeff Barker
Date:  
Subject: where did the old "ifconfig" file go?
--=====================_1000168==_.ALT
Content-Type: text/plain; charset="us-ascii"

It's me again,

I have a simple question:

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?

If I edit the rc.inet1 to look like this:

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 independently.

HOSTNAME=`cat /etc/HOSTNAME`

# 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

# IF YOU HAVE AN ETHERNET CONNECTION, use these lines below to configure the
# eth0 interface.

# Edit these values to set up a static IP address:
IPADDR="24.x.x.x"   # REPLACE with YOUR IP address!
NETMASK="255.255.255.0" # REPLACE with YOUR netmask!
NETWORK="24.x.x.x"    # REPLACE with YOUR network address!
BROADCAST="24.x.x.x"        # REPLACE with YOUR broadcast address, if you
                        # have one. If not, leave blank and edit below.
GATEWAY="24.x.x.x"    # REPLACE with YOUR gateway address!


# To use DHCP instead of a static IP, set this value to "yes":
DHCP="no"            # Use DHCP ("yes" or "no")


# OK, time to set up the interface:
if [ "$DHCP" = "yes" ]; then # use DHCP to set everything up:
echo "Attempting to configure eth0 by contacting a DHCP server..."
/sbin/dhcpcd
elif [ ! "$IPADDR" = "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}

  # If that didn't succeed, give the system administrator some hints:
  if [ ! $? = 0 ]; then
    cat << EOF
Your ethernet card was not initialized properly.  Here are some reasons why 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 boottime,
   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 error...)
EOF
  fi


  # Older kernel versions need this to set up the eth0 routing table:
  KVERSION=`uname -r | cut -f 1,2 -d .`
  if [ "$KVERSION" = "1.0" -o "$KVERSION" = "1.1" \
   -o "$KVERSION" = "1.2" -o "$KVERSION" = "2.0" -o "$KVERSION" = "" ]; then
    /sbin/route add -net ${NETWORK} netmask ${NETMASK} eth0
  fi


  # If there is a gateway defined, then set it up:
  if [ ! "$GATEWAY" = "" ]; then
    /sbin/route add default gw ${GATEWAY} netmask 0.0.0.0 metric 1
  fi
fi


# IF YOU HAVE AN ETHERNET CONNECTION, use these lines below to configure the
# eth0 interface.

# Edit these values to set up a static IP address:
IPADDR2="192.168.x.x"   # REPLACE with YOUR IP address!
NETMASK2="255.255.255.0" # REPLACE with YOUR netmask!
NETWORK2="192.168.0.0"    # REPLACE with YOUR network address!
BROADCAST2="192.168.0.255"        # REPLACE with YOUR broadcast address, if you
                        # have one. If not, leave blank and edit below.
GATEWAY2="192.168.x.x"    # REPLACE with YOUR gateway address!


# To use DHCP instead of a static IP, set this value to "yes":
DHCP2="no"            # Use DHCP ("yes" or "no")  


# OK, time to set up the interface:
if [ "$DHCP2" = "yes" ]; then # use DHCP to set everything up:
echo "Attempting to configure eth1 by contacting a DHCP server..."
/sbin/dhcpcd
elif [ ! "$IPADDR2" = "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 ${NETMASK2}

  # If that didn't succeed, give the system administrator some hints:
  if [ ! $? = 0 ]; then
    cat << EOF
Your ethernet card was not initialized properly.  Here are some reasons why 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 boottime,
   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 error...)
EOF
  fi


  # Older kernel versions need this to set up the eth0 routing table:
  if [ "$KVERSION" = "1.0" -o "$KVERSION" = "1.1" \
   -o "$KVERSION" = "1.2" -o "$KVERSION" = "2.0" -o "$KVERSION" = "" ]; then   
    /sbin/route add -net ${NETWORK2} netmask ${NETMASK2} eth1
  fi


  # If there is a gateway defined, then set it up:
  if [ ! "$GATEWAY2" = "" ]; then
    /sbin/route add default gw ${GATEWAY2} netmask 0.0.0.0 metric 1
  fi
fi



# End of rc.inet1


then both seem to get set up by looking at the boot messages, but only the internal eth1 works, I switch back to the original rc.inet1 file ( without the second half for eth1) and the external connection works, so I am assuming something is conflicting in this script and it uses the second setup.

What's the proper location to add in the correct lines for ifconfig eth1 etc.....

There used to be a ifconfig file under /etc in slackware 7 but it's not there in 8.




--=====================_1000168==_.ALT
Content-Type: text/html; charset="us-ascii"

<html>
It's me again,<br><br>
I have a simple question:<br><br>
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?<br><br>
If I edit the rc.inet1 to look like this: <br><br>
&nbsp;I changed my IP addresses for this email so you can't see it.&nbsp;
:) Let's assume I'm using the right IP addresses for all fields since
they work independently.<br><br>
HOSTNAME=`cat /etc/HOSTNAME`<br><br>
# Attach the loopback device.<br>
/sbin/ifconfig lo 127.0.0.1<br>
/sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo<br><br>
# IF YOU HAVE AN ETHERNET CONNECTION, use these lines below to configure
the<br>
# eth0 interface.<br><br>
# Edit these values to set up a static IP address:<br>
IPADDR=&quot;24.x.x.x&quot;&nbsp;&nbsp; # REPLACE with YOUR IP
address!<br>
NETMASK=&quot;255.255.255.0&quot; # REPLACE with YOUR netmask!<br>
NETWORK=&quot;24.x.x.x&quot;&nbsp;&nbsp;&nbsp; # REPLACE with YOUR
network address!<br>
BROADCAST=&quot;24.x.x.x&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# REPLACE with YOUR broadcast address, if you<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# have one. If not, leave blank and edit below.<br>
GATEWAY=&quot;24.x.x.x&quot;&nbsp;&nbsp;&nbsp; # REPLACE with YOUR
gateway address!<br><br>
# To use DHCP instead of a static IP, set this value to
&quot;yes&quot;:<br>
DHCP=&quot;no&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# Use DHCP (&quot;yes&quot; or &quot;no&quot;)<br><br>
# OK, time to set up the interface:<br>
if [ &quot;$DHCP&quot; = &quot;yes&quot; ]; then # use DHCP to set
everything up:<br>
&nbsp; echo &quot;Attempting to configure eth0 by contacting a DHCP
server...&quot;<br>
&nbsp; /sbin/dhcpcd<br>
elif [ ! &quot;$IPADDR&quot; = &quot;127.0.0.1&quot; ]; then # set up IP
statically:<br>
&nbsp; # Set up the ethernet card:<br>
&nbsp; echo &quot;Configuring eth0 as ${IPADDR}...&quot;<br>
&nbsp; /sbin/ifconfig eth0 ${IPADDR} broadcast ${BROADCAST} netmask
${NETMASK}<br><br>
&nbsp; # If that didn't succeed, give the system administrator some
hints:<br>
&nbsp; if [ ! $? = 0 ]; then<br>
&nbsp;&nbsp;&nbsp; cat &lt;&lt; EOF<br>
Your ethernet card was not initialized properly.&nbsp; Here are some
reasons why this<br>
may have happened, and the solutions:<br>
1. Your kernel does not contain support for your card.&nbsp; Including
all the<br>
&nbsp;&nbsp; network drivers in a Linux kernel can make it too large to
even boot, and<br>
&nbsp;&nbsp; sometimes including extra drivers can cause system
hangs.&nbsp; To support your<br>
&nbsp;&nbsp; ethernet, either edit /etc/rc.d/rc.modules to load the
support at boottime,<br>
&nbsp;&nbsp; or compile and install a kernel that contains support.<br>
2. You don't have an ethernet card, in which case you should comment out
this<br>
&nbsp;&nbsp; section of /etc/rc.d/rc.inet1.&nbsp; (Unless you don't mind
seeing this error...)<br>
EOF<br>
&nbsp; fi<br><br>
&nbsp; # Older kernel versions need this to set up the eth0 routing
table:<br>
&nbsp; KVERSION=`uname -r | cut -f 1,2 -d .`<br>
&nbsp; if [ &quot;$KVERSION&quot; = &quot;1.0&quot; -o
&quot;$KVERSION&quot; = &quot;1.1&quot; \<br>
&nbsp;&nbsp; -o &quot;$KVERSION&quot; = &quot;1.2&quot; -o
&quot;$KVERSION&quot; = &quot;2.0&quot; -o &quot;$KVERSION&quot; =
&quot;&quot; ]; then<br>
&nbsp;&nbsp;&nbsp; /sbin/route add -net ${NETWORK} netmask ${NETMASK}
eth0<br>
&nbsp; fi<br><br>
&nbsp; # If there is a gateway defined, then set it up:<br>
&nbsp; if [ ! &quot;$GATEWAY&quot; = &quot;&quot; ]; then<br>
&nbsp;&nbsp;&nbsp; /sbin/route add default gw ${GATEWAY} netmask 0.0.0.0
metric 1<br>
&nbsp; fi<br>
fi<br><br>
# IF YOU HAVE AN ETHERNET CONNECTION, use these lines below to configure
the<br>
# eth0 interface.<br>
&nbsp;&nbsp; <br>
# Edit these values to set up a static IP address:<br>
IPADDR2=&quot;192.168.x.x&quot;&nbsp;&nbsp; # REPLACE with YOUR IP
address!<br>
NETMASK2=&quot;255.255.255.0&quot; # REPLACE with YOUR netmask!<br>
NETWORK2=&quot;192.168.0.0&quot;&nbsp;&nbsp;&nbsp; # REPLACE with YOUR
network address!<br>
BROADCAST2=&quot;192.168.0.255&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# REPLACE with YOUR broadcast address, if you<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# have one. If not, leave blank and edit below.<br>
GATEWAY2=&quot;192.168.x.x&quot;&nbsp;&nbsp;&nbsp; # REPLACE with YOUR
gateway address!<br><br>
# To use DHCP instead of a static IP, set this value to
&quot;yes&quot;:<br>
DHCP2=&quot;no&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# Use DHCP (&quot;yes&quot; or &quot;no&quot;)&nbsp; <br><br>
# OK, time to set up the interface:<br>
if [ &quot;$DHCP2&quot; = &quot;yes&quot; ]; then # use DHCP to set
everything up:<br>
&nbsp; echo &quot;Attempting to configure eth1 by contacting a DHCP
server...&quot;<br>
&nbsp; /sbin/dhcpcd<br>
elif [ ! &quot;$IPADDR2&quot; = &quot;127.0.0.1&quot; ]; then # set up IP
statically:<br>
&nbsp; # Set up the ethernet card:<br>
&nbsp; echo &quot;Configuring eth1 as ${IPADDR2}...&quot;<br>
&nbsp; /sbin/ifconfig eth1 ${IPADDR2} broadcast ${BROADCAST2} netmask
${NETMASK2}<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp; # If that didn't succeed, give the system administrator some
hints:<br>
&nbsp; if [ ! $? = 0 ]; then<br>
&nbsp;&nbsp;&nbsp; cat &lt;&lt; EOF<br>
Your ethernet card was not initialized properly.&nbsp; Here are some
reasons why this<br>
may have happened, and the solutions:<br>
1. Your kernel does not contain support for your card.&nbsp; Including
all the<br>
&nbsp;&nbsp; network drivers in a Linux kernel can make it too large to
even boot, and<br>
&nbsp;&nbsp; sometimes including extra drivers can cause system
hangs.&nbsp; To support your<br>
&nbsp;&nbsp; ethernet, either edit /etc/rc.d/rc.modules to load the
support at boottime,<br>
&nbsp;&nbsp; or compile and install a kernel that contains support.<br>
2. You don't have an ethernet card, in which case you should comment out
this<br>
&nbsp;&nbsp; section of /etc/rc.d/rc.inet1.&nbsp; (Unless you don't mind
seeing this error...)<br>
EOF<br>
&nbsp; fi<br><br>
&nbsp; # Older kernel versions need this to set up the eth0 routing
table:<br>
&nbsp; if [ &quot;$KVERSION&quot; = &quot;1.0&quot; -o
&quot;$KVERSION&quot; = &quot;1.1&quot; \<br>
&nbsp;&nbsp; -o &quot;$KVERSION&quot; = &quot;1.2&quot; -o
&quot;$KVERSION&quot; = &quot;2.0&quot; -o &quot;$KVERSION&quot; =
&quot;&quot; ]; then&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; /sbin/route add -net ${NETWORK2} netmask ${NETMASK2}
eth1<br>
&nbsp; fi<br>
&nbsp;&nbsp; <br>
&nbsp; # If there is a gateway defined, then set it up:<br>
&nbsp; if [ ! &quot;$GATEWAY2&quot; = &quot;&quot; ]; then<br>
&nbsp;&nbsp;&nbsp; /sbin/route add default gw ${GATEWAY2} netmask 0.0.0.0
metric 1<br>
&nbsp; fi<br>
fi<br>
&nbsp; <br>
&nbsp;&nbsp; <br>
# End of rc.inet1<br><br>
<br>
then both seem to get set up by looking at the boot messages, but only
the internal eth1 works, I switch back to the original rc.inet1 file (
without the second half for eth1) and the external connection works, so I
am assuming something is conflicting in this script and it uses the
second setup. <br><br>
What's the proper location to add in the correct lines for ifconfig eth1
etc.....<br><br>
There used to be a ifconfig file under /etc in slackware 7 but it's not
there in 8.&nbsp; <br><br>
<br><br>
</html>

--=====================_1000168==_.ALT--