IPTables in Kernel aktiviert.
[people/pmueller/ipfire-2.x.git] / src / initscripts / init.d / network
CommitLineData
3fd5feeb
MT
1#!/bin/sh
2########################################################################
3# Begin $rc_base/init.d/network
4#
5# Description : Network Control Script
6#
7# Authors : Michael Tremer - m.s.tremer@googlemail.com
8#
9# Version : 00.00
10#
11# Notes : Written for IPFire by its team
12#
13########################################################################
14
15. /etc/sysconfig/rc
16. ${rc_functions}
17. /var/ipfire/ethernet/settings
18
19case "${1}" in
20 start)
21 boot_mesg "Loading MASQ helper modules"
22 modprobe iptable_nat
23 modprobe ip_conntrack
24 modprobe ip_conntrack_ftp
25 modprobe ip_nat_ftp
26 modprobe ip_conntrack_h323
27 modprobe ip_nat_h323
28 modprobe ip_conntrack_irc
29 modprobe ip_nat_irc
30 modprobe ip_conntrack_mms
31 modprobe ip_nat_mms
32 modprobe ip_conntrack_pptp
33 modprobe ip_nat_pptp
34 modprobe ip_conntrack_proto_gre
35 modprobe ip_nat_proto_gre
36 modprobe ip_conntrack_quake3
37 modprobe ip_nat_quake3
38
39 # Remove possible leftover files
40 rm -f CONFIG_ROOT/red/{active,device,dial-on-demand,dns1,dns2,local-ipaddress,remote-ipaddress,resolv.conf}
41
42 # This won't actually do anything unless a PCMCIA controller was
43 # detected at install time, because /etc/pcmcia.conf won't exist.
44 /etc/rc.d/rc.pcmcia start
45 # Now, just in case we found a PCMCIA USB controller, we'll need to reload
46 # the USB here.
47 /usr/local/bin/resetusb
48
49 # The 'for' loop force driver loading order
50 for NIC in 0 1 2 3; do
51 ETHX="eth${NIC}"
52 if [ "$GREEN_DEV" == "$ETHX" ]; then
53 if [ "$GREEN_DRIVER" != "" ]; then
54 modprobe $GREEN_DRIVER $GREEN_DRIVER_OPTIONS
55 evaluate_retval
56 fi
57 fi
58 if [ "$ORANGE_DEV" == "$ETHX" ]; then
59 if [ "$ORANGE_DRIVER" != "" ]; then
60 modprobe $ORANGE_DRIVER $ORANGE_DRIVER_OPTIONS
61 evaluate_retval
62 fi
63 fi
64 if [ "$BLUE_DEV" == "$ETHX" ]; then
65 if [ "$BLUE_DRIVER" != "" ]; then
66 modprobe $BLUE_DRIVER $BLUE_DRIVER_OPTIONS
67 evaluate_retval
68 fi
69 fi
70 if [ "$RED_DEV" == "$ETHX" ]; then
71 if [ "$RED_DRIVER" != "" ]; then
72 modprobe $RED_DRIVER $RED_DRIVER_OPTIONS
73 evaluate_retval
74 fi
75 fi
76 done
77
78 if [ -d /proc/bus/pccard ]; then
79 boot_mesg "Initializing PCMCIA cardbus modems"
80 modprobe serial_cb
81 evaluate_retval
82 fi
83
84 boot_mesg "Setting up IPFire firewall rules"
85 /etc/rc.d/rc.firewall start
86 evaluate_retval
87 boot_mesg "Setting up IP Accounting"
88 /etc/rc.d/helper/writeipac.pl
89 /usr/sbin/fetchipac -S
90 evaluate_retval
91 boot_mesg "Setting IPFire DMZ pinholes"
92 /usr/local/bin/setdmzholes
93 evaluate_retval
94
95 if [ "$BLUE_DEV" != "" ]; then
96 boot_mesg "Setting up wireless firewall rules"
97 /usr/local/bin/restartwireless
98 evaluate_retval
99 fi
100
101 boot_mesg "Bringing network up..."
102 . /etc/rc.d/rc.netaddress.up
103
104 ;;
105
106 stop)
107
108 ;;
109
110 restart)
111 ${0} stop
112 sleep 1
113 ${0} start
114 ;;
115
116 *)
117 echo "Usage: ${0} {start|stop|restart}"
118 exit 1
119 ;;
120esac
121
122# End /etc/rc.d/init.d/network