#!/bin/sh # # rc.inet1 This shell script boots up the base INET system. # # Version: @(#)/etc/rc.d/rc.inet1 1.01 05/27/93 # Modified by Milan Kerslager HOSTNAME=`hostname` # Attach the loopback device. /sbin/ifconfig lo 127.0.0.1 /sbin/route add -net 127.0.0.0 # RFC1597 has specifically reserved some IP addresses for private # networks. You should use these as they prevent anything nasty # happening if you accidentally get connected to the Internet. The # addresses reserved are: # # 10.0.0.0 - 10.255.255.255 # 172.16.0.0 - 172.31.255.255 # 192.168.0.0 - 192.168.255.255 # IF YOU HAVE AN ETHERNET CONNECTION, use these lines below to configure the # eth0 interface. If you're only using loopback or SLIP, don't include the # rest of the lines in this file. if [ -r /etc/rc.d/ip-cfg.dos ] && [ "`fromdos < /etc/rc.d/ip-cfg.dos | grep "^CONFIGURE" | cut -d\ -f2`" = "YES" ]; then # You may configure IP address from DOS via /etc/rc.d/ip-cfg.dos # If you dislike this, be sure /etc/rc.d/ip-cfg.dos contain CONFIGURE NO MODULE="`fromdos < /etc/rc.d/ip-cfg.dos | grep ^MODULE | cut -b8-`" IPADDR="`fromdos < /etc/rc.d/ip-cfg.dos | grep ^IPADDR | cut -d\ -f2`" NETMASK="`fromdos < /etc/rc.d/ip-cfg.dos | grep ^NETMASK | cut -d\ -f2`" NETWORK="`fromdos < /etc/rc.d/ip-cfg.dos | grep ^NETWORK | cut -d\ -f2`" BROADCAST="`fromdos < /etc/rc.d/ip-cfg.dos | grep ^BROADCAST | cut -d\ -f2`" GATEWAY="`fromdos < /etc/rc.d/ip-cfg.dos | grep ^GATEWAY | cut -d\ -f2`" NAME="`fromdos < /etc/rc.d/ip-cfg.dos | grep ^NAME | cut -d\ -f2`" DOMAIN="`fromdos < /etc/rc.d/ip-cfg.dos | grep ^DOMAIN | cut -d\ -f2`" DNSSERVER="`fromdos < /etc/rc.d/ip-cfg.dos | grep ^DNSSERVER | cut -d\ -f2`" else # To manually configure IP address, uncoment line below and double check them. # Contact your network administrator for proper values. # Read the documentation to be sure, that everything is good. # IPADDR="192.168.1.1" NETMASK="255.255.255.0" NETWORK="192.168.1.0" BROADCAST="192.168.1.255" GATEWAY="192.168.1.250" fi # We must change our name now... if [ ! -z ${NAME} ] && [ ! -z ${DOMAIN} ]; then echo ${NAME}.${DOMAIN} > /etc/HOSTNAME /bin/hostname `cat /etc/HOSTNAME | cut -f1 -d .` HOSTNAME=`hostname` fi # Set up the rest of network configuration via file ip-cfg.dos if [ ! -z ${DOMAIN} ] && [ ! -z ${DNSSERVER} ]; then echo nameserver $DNSSERVER > /etc/resolv.conf echo domain $DOMAIN >> /etc/resolv.conf echo order hosts, bind > /etc/host.conf echo multi on >> /etc/host.conf fi if [ ! -z "${MODULE}" ]; then # this fix a small bug in syslogd :-( /usr/sbin/syslogd /sbin/modprobe ${MODULE} fi if [ ! -z ${IPADDR} ]; then /sbin/ifconfig eth0 ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK} /sbin/route add -net ${NETWORK} netmask ${NETMASK} /sbin/route add default gw ${GATEWAY} metric 1 fi # End of rc.inet1