1#!/bin/sh
| 1#!/bin/sh
|
2# $FreeBSD: head/release/picobsd/floppy.tree/etc/rc.conf 50479 1999-08-28 01:35:59Z peter $
| 2# $FreeBSD: head/release/picobsd/floppy.tree/etc/rc.conf 57048 2000-02-08 14:20:54Z luigi $
|
3# 4# rc.conf for picobsd. 5# $main_ether and $main_if are set from rc to the ethernet address and 6# name of the first ethernet interface, if available, so a simple 7# here-document below can be used for autoconfiguration. 8# Remaining parameters are set using a switch. 9
| 3# 4# rc.conf for picobsd. 5# $main_ether and $main_if are set from rc to the ethernet address and 6# name of the first ethernet interface, if available, so a simple 7# here-document below can be used for autoconfiguration. 8# Remaining parameters are set using a switch. 9
|
10while read ether hostname ip mask ; do 11 if [ "$ether" = "$main_ether" -o "$ether" = "default" ] ; then 12 break 13 fi 14done <<__eof__ 15# Insert here the description of the system 16# default terminates the search. 17# main_ether hostname ip mask 1800:20:18:2f:f4:2e rizzo 131.114.9.26 0xffffff00 1900:c0:58:21:9e:a0 aula29 10.1.1.11 0xffffff00 2052:54:00:e0:f3:73 tlcradar 10.1.1.25 0xffffff00 2152:54:00:e3:55:2e troika 10.1.1.2 0xffffff00 22default default 10.0.0.1 0xffffff00 23__eof__ 24 25eval ifconfig_${main_if}=\"inet \$ip netmask \$mask\" 26network_interfaces=`ifconfig -l` 27 28case $hostname in 29troika) 30 sysctl -w net.link.ether.bridge_cfg="ed4:2,ed5:1,ed6:1" 31 sysctl -w net.inet.ip.forwarding=1 32 ifconfig ed4 131.114.9.2 netmask 0xffffff00 33 ifconfig ed4 10.1.1.2 netmask 0xffffff00 alias 34 ifconfig ed5 131.114.5.129 netmask 0xffffff80 35 route add default 131.114.9.29 36 route add 131.114.5.0/26 131.114.5.130 37 route add 131.114.5.64/26 131.114.5.65 38 ;; 39esac 40
| 10rc_conf_set_defaults() {
|
41swapfile="NO" # Set to name of swapfile if aux swapfile desired.
| 11swapfile="NO" # Set to name of swapfile if aux swapfile desired.
|
42### Network configuration sub-section ###################### 43### Basic network options: ###
| |
44firewall="NO" # firewall type (see /etc/rc.firewall) or NO 45tcp_extensions="NO" # Allow RFC1323 & RFC1644 extensions (or NO). 46ifconfig_lo0="inet 127.0.0.1" # default loopback device configuration. 47#ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0xffffffff" # Sample alias entry. 48### Network daemons options: ###
| 12firewall="NO" # firewall type (see /etc/rc.firewall) or NO 13tcp_extensions="NO" # Allow RFC1323 & RFC1644 extensions (or NO). 14ifconfig_lo0="inet 127.0.0.1" # default loopback device configuration. 15#ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0xffffffff" # Sample alias entry. 16### Network daemons options: ###
|
| 17sshd_enable="YES" # if present...
|
49inetd_enable="YES" # Run the network daemon dispatcher (or NO) 50inetd_flags="" # Optional flags to inetd 51snmpd_enable="NO" # Run the SNMP daemon (or NO) 52snmpd_flags="-C -c /etc/snmpd.conf" # Optional flags to snmpd 53### Network routing options: ### 54defaultrouter="NO" # Set to default gateway (or NO). 55static_routes="" # Set to static route list (or leave empty). 56gateway_enable="NO" # Set to YES if this host will be a gateway. 57arpproxy_all="" # replaces obsolete kernel option ARP_PROXYALL.
| 18inetd_enable="YES" # Run the network daemon dispatcher (or NO) 19inetd_flags="" # Optional flags to inetd 20snmpd_enable="NO" # Run the SNMP daemon (or NO) 21snmpd_flags="-C -c /etc/snmpd.conf" # Optional flags to snmpd 22### Network routing options: ### 23defaultrouter="NO" # Set to default gateway (or NO). 24static_routes="" # Set to static route list (or leave empty). 25gateway_enable="NO" # Set to YES if this host will be a gateway. 26arpproxy_all="" # replaces obsolete kernel option ARP_PROXYALL.
|
| 27mask="0xffffff00" 28} 29 30rc_conf_set_defaults 31 32hostname="" 33while read a b c ; do 34 if [ "$a" = "#ethertable" ] ; then 35 hostname="." 36 elif [ "X$hostname" = "X." -a "X$a" = "X#" -a "X$b" = "X$main_ether" ] 37 then 38 hostname=$c 39 break 40 fi 41done < /etc/hosts 42if [ "X$hostname" = "X" -o "X$hostname" = "X." ] ; then 43 hostname=default 44fi 45 46eval ifconfig_${main_if}=\" \$hostname netmask \$mask\" 47network_interfaces=`ifconfig -l` 48
|
58### Allow local configuration override at the very end here ##
| 49### Allow local configuration override at the very end here ##
|
| 50### can make use of a case statement to set per-host things.
|
59if [ -f /etc/rc.conf.local ]; then 60 . /etc/rc.conf.local 61fi
| 51if [ -f /etc/rc.conf.local ]; then 52 . /etc/rc.conf.local 53fi
|