View | Details | Raw Unified | Return to bug 132476 | Differences between
and this patch

Collapse All | Expand All

(-)etc/rc.d/routing (-15 / +31 lines)
Lines 27-54 Link Here
27
27
28
routing_stop()
28
routing_stop()
29
{
29
{
30
	route -n flush
30
	_fibs_num=`sysctl -n net.fibs`
31
	for i in `jot ${_fibs_num} 0`; do
32
		setfib -F $i route -n flush
33
	done
31
}
34
}
32
35
33
static_start()
36
static_start()
34
{
37
{
35
	case ${defaultrouter} in
38
	_fibs_num=`sysctl -n net.fibs`
36
	[Nn][Oo] | '')
39
	if [ -n "${static_routes}" ]; then
37
		;;
40
		static_routes_fib0=${static_routes}
38
	*)
41
	fi
39
		static_routes="default ${static_routes}"
42
	if [ -n "${defaultrouter}" ]; then
40
		route_default="default ${defaultrouter}"
43
		defaultrouter_fib0=${defaultrouter}
41
		;;
44
	fi
42
	esac
43
45
44
	# Setup static routes. This should be done before router discovery.
46
	# Setup static routes. This should be done before router discovery.
45
	#
47
	#
46
	if [ -n "${static_routes}" ]; then
48
	for n in `jot ${_fibs_num} 0`; do
47
		for i in ${static_routes}; do
49
		eval _drouter=\$defaultrouter_fib${n}
48
			eval route_args=\$route_${i}
50
		eval _routes=\$static_routes_fib${n}
49
			route add ${route_args}
51
50
		done
52
		case ${_drouter} in
51
	fi
53
		[Nn][Oo] | '')
54
			;;
55
		*)
56
			_routes="default ${_routes}"
57
			route_default="default ${_drouter}"
58
			;;
59
		esac
60
61
		if [ -n "${_routes}" ]; then
62
			for i in ${_routes}; do
63
				eval route_args=\$route_${i}
64
				setfib -F $n route add ${route_args}
65
			done
66
		fi
67
	done
52
	# Now ATM static routes
68
	# Now ATM static routes
53
	#
69
	#
54
	if [ -n "${natm_static_routes}" ]; then
70
	if [ -n "${natm_static_routes}" ]; then
(-)share/man/man5/rc.conf.5 (-5 / +15 lines)
Lines 2187-2193 Link Here
2187
.Dq Li NO ,
2187
.Dq Li NO ,
2188
create a default route to this host name or IP address
2188
create a default route to this host name or IP address
2189
(use an IP address if this router is also required to get to the
2189
(use an IP address if this router is also required to get to the
2190
name server!).
2190
name server!). It's an equivalent of
2191
.Va defaultrouter_fib0 .
2192
.It Va defaultrouter_fibN
2193
.Pq Vt str
2194
If not set to
2195
.Dq Li NO ,
2196
create a default route to this host name or IP address in FIB
2197
number N. See the setfib(1).
2191
.It Va ipv6_defaultrouter
2198
.It Va ipv6_defaultrouter
2192
.Pq Vt str
2199
.Pq Vt str
2193
The IPv6 equivalent of
2200
The IPv6 equivalent of
Lines 2195-2204 Link Here
2195
.It Va static_routes
2202
.It Va static_routes
2196
.Pq Vt str
2203
.Pq Vt str
2197
Set to the list of static routes that are to be added at system
2204
Set to the list of static routes that are to be added at system
2198
boot time.
2205
boot time. (It's an equivalent of
2199
If not set to
2206
.Va static_routes_fib0 )
2200
.Dq Li NO
2207
If not empty then for each whitespace separated
2201
then for each whitespace separated
2202
.Ar element
2208
.Ar element
2203
in the value, a
2209
in the value, a
2204
.Va route_ Ns Aq Ar element
2210
.Va route_ Ns Aq Ar element
Lines 2212-2217 Link Here
2212
route_mcast="-net 224.0.0.0/4 -iface gif0"
2218
route_mcast="-net 224.0.0.0/4 -iface gif0"
2213
route_gif0local="-host 169.254.1.1 -iface lo0"
2219
route_gif0local="-host 169.254.1.1 -iface lo0"
2214
.Ed
2220
.Ed
2221
.It Va static_routes_fibN
2222
.Pq Vt str
2223
Set to the list of static routes that are to be added in FIB
2224
number N. See setfib(1).
2215
.It Va ipv6_static_routes
2225
.It Va ipv6_static_routes
2216
.Pq Vt str
2226
.Pq Vt str
2217
The IPv6 equivalent of
2227
The IPv6 equivalent of

Return to bug 132476