netoptions (212576) | netoptions (220153) |
---|---|
1#!/bin/sh 2# | 1#!/bin/sh 2# |
3# $FreeBSD: head/etc/rc.d/netoptions 212576 2010-09-13 19:52:46Z hrs $ | 3# $FreeBSD: head/etc/rc.d/netoptions 220153 2011-03-30 01:19:00Z emaste $ |
4# 5 6# PROVIDE: netoptions 7# REQUIRE: FILESYSTEMS 8# BEFORE: netif 9# KEYWORD: nojail 10 11. /etc/rc.subr --- 23 unchanged lines hidden (view full) --- 35} 36 37netoptions_inet() 38{ 39 case ${log_in_vain} in 40 [12]) 41 netoptions_init 42 echo -n " log_in_vain=${log_in_vain}" | 4# 5 6# PROVIDE: netoptions 7# REQUIRE: FILESYSTEMS 8# BEFORE: netif 9# KEYWORD: nojail 10 11. /etc/rc.subr --- 23 unchanged lines hidden (view full) --- 35} 36 37netoptions_inet() 38{ 39 case ${log_in_vain} in 40 [12]) 41 netoptions_init 42 echo -n " log_in_vain=${log_in_vain}" |
43 ${SYSCTL_W} net.inet.tcp.log_in_vain=${log_in_vain} >/dev/null 44 ${SYSCTL_W} net.inet.udp.log_in_vain=${log_in_vain} >/dev/null | 43 ${SYSCTL} net.inet.tcp.log_in_vain=${log_in_vain} >/dev/null 44 ${SYSCTL} net.inet.udp.log_in_vain=${log_in_vain} >/dev/null |
45 ;; 46 *) | 45 ;; 46 *) |
47 ${SYSCTL_W} net.inet.tcp.log_in_vain=0 >/dev/null 48 ${SYSCTL_W} net.inet.udp.log_in_vain=0 >/dev/null | 47 ${SYSCTL} net.inet.tcp.log_in_vain=0 >/dev/null 48 ${SYSCTL} net.inet.udp.log_in_vain=0 >/dev/null |
49 ;; 50 esac 51 52 if checkyesno tcp_extensions; then | 49 ;; 50 esac 51 52 if checkyesno tcp_extensions; then |
53 ${SYSCTL_W} net.inet.tcp.rfc1323=1 >/dev/null | 53 ${SYSCTL} net.inet.tcp.rfc1323=1 >/dev/null |
54 else 55 netoptions_init 56 echo -n " rfc1323 extensions=${tcp_extensions}" | 54 else 55 netoptions_init 56 echo -n " rfc1323 extensions=${tcp_extensions}" |
57 ${SYSCTL_W} net.inet.tcp.rfc1323=0 >/dev/null | 57 ${SYSCTL} net.inet.tcp.rfc1323=0 >/dev/null |
58 fi 59 60 if checkyesno tcp_keepalive; then | 58 fi 59 60 if checkyesno tcp_keepalive; then |
61 ${SYSCTL_W} net.inet.tcp.always_keepalive=1 >/dev/null | 61 ${SYSCTL} net.inet.tcp.always_keepalive=1 >/dev/null |
62 else 63 netoptions_init 64 echo -n " TCP keepalive=${tcp_keepalive}" | 62 else 63 netoptions_init 64 echo -n " TCP keepalive=${tcp_keepalive}" |
65 ${SYSCTL_W} net.inet.tcp.always_keepalive=0 >/dev/null | 65 ${SYSCTL} net.inet.tcp.always_keepalive=0 >/dev/null |
66 fi 67 68 if checkyesno tcp_drop_synfin; then 69 netoptions_init 70 echo -n " drop SYN+FIN packets=${tcp_drop_synfin}" | 66 fi 67 68 if checkyesno tcp_drop_synfin; then 69 netoptions_init 70 echo -n " drop SYN+FIN packets=${tcp_drop_synfin}" |
71 ${SYSCTL_W} net.inet.tcp.drop_synfin=1 >/dev/null | 71 ${SYSCTL} net.inet.tcp.drop_synfin=1 >/dev/null |
72 else | 72 else |
73 ${SYSCTL_W} net.inet.tcp.drop_synfin=0 >/dev/null | 73 ${SYSCTL} net.inet.tcp.drop_synfin=0 >/dev/null |
74 fi 75 76 case ${ip_portrange_first} in 77 [0-9]*) 78 netoptions_init 79 echo -n " ip_portrange_first=$ip_portrange_first" | 74 fi 75 76 case ${ip_portrange_first} in 77 [0-9]*) 78 netoptions_init 79 echo -n " ip_portrange_first=$ip_portrange_first" |
80 ${SYSCTL_W} net.inet.ip.portrange.first=$ip_portrange_first >/dev/null | 80 ${SYSCTL} net.inet.ip.portrange.first=$ip_portrange_first >/dev/null |
81 ;; 82 esac 83 84 case ${ip_portrange_last} in 85 [0-9]*) 86 netoptions_init 87 echo -n " ip_portrange_last=$ip_portrange_last" | 81 ;; 82 esac 83 84 case ${ip_portrange_last} in 85 [0-9]*) 86 netoptions_init 87 echo -n " ip_portrange_last=$ip_portrange_last" |
88 ${SYSCTL_W} net.inet.ip.portrange.last=$ip_portrange_last >/dev/null | 88 ${SYSCTL} net.inet.ip.portrange.last=$ip_portrange_last >/dev/null |
89 ;; 90 esac 91} 92 93netoptions_inet6() 94{ 95 if checkyesno ipv6_ipv4mapping; then 96 netoptions_init 97 echo -n " ipv4-mapped-ipv6=${ipv6_ipv4mapping}" | 89 ;; 90 esac 91} 92 93netoptions_inet6() 94{ 95 if checkyesno ipv6_ipv4mapping; then 96 netoptions_init 97 echo -n " ipv4-mapped-ipv6=${ipv6_ipv4mapping}" |
98 ${SYSCTL_W} net.inet6.ip6.v6only=0 >/dev/null | 98 ${SYSCTL} net.inet6.ip6.v6only=0 >/dev/null |
99 else | 99 else |
100 ${SYSCTL_W} net.inet6.ip6.v6only=1 >/dev/null | 100 ${SYSCTL} net.inet6.ip6.v6only=1 >/dev/null |
101 fi 102 103 if checkyesno ipv6_privacy; then 104 netoptions_init 105 echo -n " IPv6 Privacy Addresses" | 101 fi 102 103 if checkyesno ipv6_privacy; then 104 netoptions_init 105 echo -n " IPv6 Privacy Addresses" |
106 ${SYSCTL_W} net.inet6.ip6.use_tempaddr=1 >/dev/null 107 ${SYSCTL_W} net.inet6.ip6.prefer_tempaddr=1 >/dev/null | 106 ${SYSCTL} net.inet6.ip6.use_tempaddr=1 >/dev/null 107 ${SYSCTL} net.inet6.ip6.prefer_tempaddr=1 >/dev/null |
108 fi 109} 110 111load_rc_config $name 112run_rc_command $1 | 108 fi 109} 110 111load_rc_config $name 112run_rc_command $1 |