#! /bin/sh # # rc.inet1 This shell script boots up the base INET system. # # Version: @(#)/etc/rc.d/rc.inet1 2.00 10/06/1999 # 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 # eth1 interface. # Edit these values to set up a static IP address: IPADDR="PUT_IT_HERE" # REPLACE with YOUR Cable Modem's IP address. NETMASK="PUT_IT_HERE" # REPLACE with YOUR Cable Modem's netmask. BROADCAST="PUT_IT_HERE" # REPLACE with YOUR Cable Modem's broadcast address GATEWAY="PUT_IT_HERE" # REPLACE with YOUR Cable Modem's gateway address. # Set up the ethernet card: echo "Configuring eth0 as ${IPADDR}..." /sbin/ifconfig eth0 ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK} #eth0 = to cable modem #eth1 = internal LAN echo "Configuring eth1 as 192.168.1.1..." /sbin/ifconfig eth1 192.168.1.1 broadcast 192.168.0.255 netmask 255.255.255.0 # 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 # 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 # End of rc.inet1