4d97bc072b
rc.d/routing and in to rc.d/netoptions. Also instead of saying "TCP options" say "IP options".
78 lines
1.3 KiB
Bash
78 lines
1.3 KiB
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
# PROVIDE: netoptions
|
|
# REQUIRE: FILESYSTEMS
|
|
# KEYWORD: nojail
|
|
|
|
. /etc/rc.subr
|
|
|
|
load_rc_config 'XXX'
|
|
|
|
echo -n 'Additional IP options:'
|
|
case ${log_in_vain} in
|
|
[Nn][Oo] | '')
|
|
log_in_vain=0
|
|
;;
|
|
[Yy][Ee][Ss])
|
|
log_in_vain=1
|
|
;;
|
|
[0-9]*)
|
|
;;
|
|
*)
|
|
echo " invalid log_in_vain setting: ${log_in_vain}"
|
|
log_in_vain=0
|
|
;;
|
|
esac
|
|
|
|
[ "${log_in_vain}" -ne 0 ] && (
|
|
echo -n " log_in_vain=${log_in_vain}"
|
|
sysctl net.inet.tcp.log_in_vain="${log_in_vain}" >/dev/null
|
|
sysctl net.inet.udp.log_in_vain="${log_in_vain}" >/dev/null
|
|
)
|
|
|
|
case ${tcp_extensions} in
|
|
[Yy][Ee][Ss] | '')
|
|
;;
|
|
*)
|
|
echo -n ' tcp extensions=NO'
|
|
sysctl net.inet.tcp.rfc1323=0 >/dev/null
|
|
;;
|
|
esac
|
|
|
|
case ${tcp_keepalive} in
|
|
[Nn][Oo])
|
|
echo -n ' TCP keepalive=NO'
|
|
sysctl net.inet.tcp.always_keepalive=0 >/dev/null
|
|
;;
|
|
esac
|
|
|
|
case ${tcp_drop_synfin} in
|
|
[Yy][Ee][Ss])
|
|
echo -n ' drop SYN+FIN packets=YES'
|
|
sysctl net.inet.tcp.drop_synfin=1 >/dev/null
|
|
;;
|
|
esac
|
|
|
|
case ${ip_portrange_first} in
|
|
[Nn][Oo] | '')
|
|
;;
|
|
*)
|
|
echo -n " ip_portrange_first=$ip_portrange_first"
|
|
sysctl net.inet.ip.portrange.first=$ip_portrange_first >/dev/null
|
|
;;
|
|
esac
|
|
|
|
case ${ip_portrange_last} in
|
|
[Nn][Oo] | '')
|
|
;;
|
|
*)
|
|
echo -n " ip_portrange_last=$ip_portrange_last"
|
|
sysctl net.inet.ip.portrange.last=$ip_portrange_last >/dev/null
|
|
;;
|
|
esac
|
|
|
|
echo '.'
|