#! /bin/sh # # rc.inet1 This shell script boots up the base INET system. HOSTNAME=`cat /etc/HOSTNAME` /sbin/ifconfig lo 127.0.0.1 /sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo IPADDR="192.168.1.100" NETMASK="255.255.255.0" NETWORK="192.168.1.0" BROADCAST="192.168.1.255" GATEWAY="" DHCP="no" if [ "$DHCP" = "yes" ]; then echo "Configure eth0 with DHCP server" /sbin/dhcpcd elif [ ! "$IPADDR" = "127.0.0.1" ]; then echo "Configuring eth0 as ${IPADDR}..." /sbin/ifconfig eth0 ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK} if [ ! $? = 0 ]; then cat << EOF Your ethernet card was not initialized properly: 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. 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 [ ! "$GATEWAY" = "" ]; then /sbin/route add default gw ${GATEWAY} netmask 0.0.0.0 metric 1 fi fi