kernel - support dummy reallocblks in devfs
[dragonfly.git] / etc / rc.d / routing
blob82b4d9dcaeae692ed89e941b5208b3245bebd7b3
1 #!/bin/sh
3 # Configure routing and miscellaneous network tunables
5 # $FreeBSD: src/etc/rc.d/routing,v 1.138 2003/06/29 17:59:09 mtm Exp $
8 # PROVIDE: routing
9 # REQUIRE: netif ppp-user
11 . /etc/rc.subr
13 name="routing"
14 start_cmd="routing_start"
15 stop_cmd="routing_stop"
16 extra_commands="options static change"
17 static_cmd="static_start"
18 change_cmd="change_start"
19 options_cmd="options_start"
21 routing_start()
23 static_start
24 change_start
25 options_start
28 routing_stop()
30 route -n flush
33 static_start()
35 case ${defaultrouter} in
36 [Nn][Oo] | '')
39 static_routes="default ${static_routes}"
40 route_default="default ${defaultrouter}"
42 esac
44 # Setup static routes. This should be done before router discovery.
46 if [ -n "${static_routes}" ]; then
47 for i in ${static_routes}; do
48 eval route_args=\$route_${i}
49 route add ${route_args}
50 done
54 change_start()
56 # Change routes. This should be done before router discovery.
58 if [ -n "${change_routes}" ]; then
59 for i in ${change_routes}; do
60 eval route_args=\$change_route_${i}
61 route change ${route_args}
62 done
66 options_start()
68 echo -n 'Additional routing options:'
69 case ${tcp_extensions} in
70 [Yy][Ee][Ss] | '')
73 echo -n ' tcp extensions=NO'
74 sysctl net.inet.tcp.rfc1323=0 >/dev/null
76 esac
78 case ${icmp_bmcastecho} in
79 [Yy][Ee][Ss])
80 echo -n ' broadcast ping responses=YES'
81 sysctl net.inet.icmp.bmcastecho=1 >/dev/null
83 esac
85 case ${icmp_drop_redirect} in
86 [Yy][Ee][Ss])
87 echo -n ' ignore ICMP redirect=YES'
88 sysctl net.inet.icmp.drop_redirect=1 >/dev/null
90 esac
92 case ${icmp_log_redirect} in
93 [Yy][Ee][Ss])
94 echo -n ' log ICMP redirect=YES'
95 sysctl net.inet.icmp.log_redirect=1 >/dev/null
97 esac
99 case ${gateway_enable} in
100 [Yy][Ee][Ss])
101 echo -n ' IP gateway=YES'
102 sysctl net.inet.ip.forwarding=1 >/dev/null
104 esac
106 case ${forward_sourceroute} in
107 [Yy][Ee][Ss])
108 echo -n ' do source routing=YES'
109 sysctl net.inet.ip.sourceroute=1 >/dev/null
111 esac
113 case ${accept_sourceroute} in
114 [Yy][Ee][Ss])
115 echo -n ' accept source routing=YES'
116 sysctl net.inet.ip.accept_sourceroute=1 >/dev/null
118 esac
120 case ${tcp_keepalive} in
121 [Nn][Oo])
122 echo -n ' TCP keepalive=NO'
123 sysctl net.inet.tcp.always_keepalive=0 >/dev/null
125 esac
127 case ${tcp_drop_synfin} in
128 [Yy][Ee][Ss])
129 echo -n ' drop SYN+FIN packets=YES'
130 sysctl net.inet.tcp.drop_synfin=1 >/dev/null
132 esac
134 case ${arpproxy_all} in
135 [Yy][Ee][Ss])
136 echo -n ' ARP proxyall=YES'
137 sysctl net.link.ether.inet.proxyall=1 >/dev/null
139 esac
141 case ${ip_portrange_first} in
142 [Nn][Oo] | '')
145 echo -n " ip_portrange_first=$ip_portrange_first"
146 sysctl net.inet.ip.portrange.first=$ip_portrange_first >/dev/null
148 esac
150 case ${ip_portrange_last} in
151 [Nn][Oo] | '')
154 echo -n " ip_portrange_last=$ip_portrange_last"
155 sysctl net.inet.ip.portrange.last=$ip_portrange_last >/dev/null
157 esac
159 echo '.'
162 load_rc_config $name
163 run_rc_command "$1"