#!/bin/sh # rc.inet2 This shell script boots up the entire network system. # If we see IPv4 packet forwarding support in the kernel, we will turn it on. # This was the default for 2.0.x kernels, but with newer kernels it must be # activated through a file in /proc. IPv4 packet forwarding support is # required if you plan to use your Linux machine as a router or firewall. # If you don't want your Linux machine to forward packets, change the 1 below # to a 0. IPV4_FORWARD=1 if [ -f /proc/sys/net/ipv4/ip_forward ]; then if [ "$IPV4_FORWARD" = "1" ]; then echo "Activating IPv4 packet forwarding." echo 1 > /proc/sys/net/ipv4/ip_forward else echo "Disabling IPv4 packet forwarding." echo 0 > /proc/sys/net/ipv4/ip_forward fi fi # Start the ipchains firewall: if [ -x /etc/rc.d/rc.firewall ]; then echo "Starting ipchains based firewall /etc/rc.d/rc.firewall" /etc/rc.d/rc.firewall fi # Done starting the ipchains firewall. # At this point, we are ready to talk to The World... # Start the syslogd and klogd daemons: if [ -x /usr/sbin/syslogd ]; then echo -n "Starting sysklogd daemons: " echo -n " /usr/sbin/syslogd" /usr/sbin/syslogd -r -m 40 sleep 1 # prevent syslogd/klogd race condition on SMP kernels echo " /usr/sbin/klogd -c 3" # '-c 3' = display level 'error' or higher messages on console /usr/sbin/klogd -c 3 fi # Done starting the syslogd and klogd daemons. # Start the inetd server: if [ -x /usr/sbin/inetd ]; then echo "Starting Internet super-server daemon: /usr/sbin/inetd" /usr/sbin/inetd else echo "WARNING: /usr/sbin/inetd not found." fi # Done starting the inetd meta-server. # Start the BSD line printer spooler daemon: if [ -x /usr/sbin/lpd ]; then echo "Starting BSD line printer spooler daemon: /usr/sbin/lpd" /usr/sbin/lpd fi # Done starting the BSD line printer spooler daemon. # Start the name server daemon: if [ -x /usr/local/sbin/dnrd ]; then echo "Starting name server daemon: /usr/local/sbin/dnrd" /usr/local/sbin/dnrd --server=192.168.1.1 fi # Done starting the server. # Start DHCP server on local network if [ -f /etc/dhcpd.conf ]; then echo "Starting DHCP services: /usr/sbin/dhcpd eth0" /usr/sbin/dhcpd eth0 fi