We don't have lkm, use aftermountlkm instead.
[dragonfly.git] / etc / rc.d / network2
1 #!/bin/sh
2 #
3 # Configure routing and miscellaneous network tunables
4 #
5 # $FreeBSD: src/etc/rc.d/network2,v 1.137 2003/06/29 05:15:57 mtm Exp $
6 # $DragonFly: src/etc/rc.d/Attic/network2,v 1.2 2004/01/27 00:42:45 rob Exp $
7 #
8
9 # PROVIDE: network2
10 # REQUIRE: netif ppp-user
11 # KEYWORD: DragonFly  nostart
12
13 . /etc/rc.subr
14
15 name="network2"
16 start_cmd="network2_start"
17 stop_cmd=":"
18
19 network2_start()
20 {
21         case ${defaultrouter} in
22         [Nn][Oo] | '')
23                 ;;
24         *)
25                 static_routes="default ${static_routes}"
26                 route_default="default ${defaultrouter}"
27                 ;;
28         esac
29
30         # Setup static routes. This should be done before router discovery.
31         #
32         if [ -n "${static_routes}" ]; then
33                 for i in ${static_routes}; do
34                         eval route_args=\$route_${i}
35                         route add ${route_args}
36                 done
37         fi
38
39         echo -n 'Additional routing options:'
40         case ${tcp_extensions} in
41         [Yy][Ee][Ss] | '')
42                 ;;
43         *)
44                 echo -n ' tcp extensions=NO'
45                 sysctl net.inet.tcp.rfc1323=0 >/dev/null
46                 ;;
47         esac
48
49         case ${icmp_bmcastecho} in
50         [Yy][Ee][Ss])
51                 echo -n ' broadcast ping responses=YES'
52                 sysctl net.inet.icmp.bmcastecho=1 >/dev/null
53                 ;;
54         esac
55
56         case ${icmp_drop_redirect} in
57         [Yy][Ee][Ss])
58                 echo -n ' ignore ICMP redirect=YES'
59                 sysctl net.inet.icmp.drop_redirect=1 >/dev/null
60                 ;;
61         esac
62
63         case ${icmp_log_redirect} in
64         [Yy][Ee][Ss])
65                 echo -n ' log ICMP redirect=YES'
66                 sysctl net.inet.icmp.log_redirect=1 >/dev/null
67                 ;;
68         esac
69
70         case ${gateway_enable} in
71         [Yy][Ee][Ss])
72                 echo -n ' IP gateway=YES'
73                 sysctl net.inet.ip.forwarding=1 >/dev/null
74                 ;;
75         esac
76
77         case ${forward_sourceroute} in
78         [Yy][Ee][Ss])
79                 echo -n ' do source routing=YES'
80                 sysctl net.inet.ip.sourceroute=1 >/dev/null
81                 ;;
82         esac
83
84         case ${accept_sourceroute} in
85         [Yy][Ee][Ss])
86                 echo -n ' accept source routing=YES'
87                 sysctl net.inet.ip.accept_sourceroute=1 >/dev/null
88                 ;;
89         esac
90
91         case ${tcp_keepalive} in
92         [Nn][Oo])
93                 echo -n ' TCP keepalive=NO'
94                 sysctl net.inet.tcp.always_keepalive=0 >/dev/null
95                 ;;
96         esac
97
98         case ${tcp_drop_synfin} in
99         [Yy][Ee][Ss])
100                 echo -n ' drop SYN+FIN packets=YES'
101                 sysctl net.inet.tcp.drop_synfin=1 >/dev/null
102                 ;;
103         esac
104
105         case ${ipxgateway_enable} in
106         [Yy][Ee][Ss])
107                 echo -n ' IPX gateway=YES'
108                 sysctl net.ipx.ipx.ipxforwarding=1 >/dev/null
109                 ;;
110         esac
111
112         case ${arpproxy_all} in
113         [Yy][Ee][Ss])
114                 echo -n ' ARP proxyall=YES'
115                 sysctl net.link.ether.inet.proxyall=1 >/dev/null
116                 ;;
117         esac
118
119         case ${ip_portrange_first} in
120         [Nn][Oo] | '')
121                 ;;
122         *)
123                 echo -n " ip_portrange_first=$ip_portrange_first"
124                 sysctl net.inet.ip.portrange.first=$ip_portrange_first >/dev/null
125                 ;;
126         esac
127
128         case ${ip_portrange_last} in
129         [Nn][Oo] | '')
130                 ;;
131         *)
132                 echo -n " ip_portrange_last=$ip_portrange_last"
133                 sysctl net.inet.ip.portrange.last=$ip_portrange_last >/dev/null
134                 ;;
135         esac
136
137         echo '.'
138 }
139
140 load_rc_config $name
141 run_rc_command "$1"