diff options
author | hrs <hrs@FreeBSD.org> | 2013-06-09 18:11:36 +0000 |
---|---|---|
committer | hrs <hrs@FreeBSD.org> | 2013-06-09 18:11:36 +0000 |
commit | 2ec3ccab05ceb9d46ff8bfd7510e7859e344aa5a (patch) | |
tree | 8afffc588e1b5a5d270906681d36fabdc14b5337 /etc/rc.d/netif | |
parent | 64a7278134b4fcca2717b660dc511d4b792d12c4 (diff) | |
download | FreeBSD-src-2ec3ccab05ceb9d46ff8bfd7510e7859e344aa5a.zip FreeBSD-src-2ec3ccab05ceb9d46ff8bfd7510e7859e344aa5a.tar.gz |
Add :ifname modifier to specify interface-specific routes into
{,ipv6_}static_routes and rc.d/routing. For example:
static_routes="foo bar:em0"
route_foo="-net 10.0.0.0/24 -gateway 192.168.2.1"
route_bar="-net 192.168.1.0/24 -gateway 192.168.0.2"
At boot time, all of the static routes are installed as before.
The differences are:
- "/etc/rc.d/netif start/stop <if>" now configures static routes
with :<if> if any.
- "/etc/rc.d/routing start/stop <af> <if>" works as well. <af> cannot be
omitted when <if> is specified, but a keyword "any" or "all" can be used
for <af> and <if>.
Diffstat (limited to 'etc/rc.d/netif')
-rwxr-xr-x | etc/rc.d/netif | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/etc/rc.d/netif b/etc/rc.d/netif index 2ace581..d623503 100755 --- a/etc/rc.d/netif +++ b/etc/rc.d/netif @@ -46,6 +46,8 @@ set_rcvar_obsolete ipv6_prefer network_start() { + local _if + # Set the list of interfaces to work on. # cmdifn=$* @@ -81,16 +83,29 @@ network_start() if [ -f /etc/rc.d/bridge -a -n "$cmdifn" ] ; then /etc/rc.d/bridge start $cmdifn fi + if [ -f /etc/rc.d/routing -a -n "$cmdifn" ] ; then + for _if in $cmdifn; do + /etc/rc.d/routing start any $_if + done + fi } network_stop() { + local _if + # Set the list of interfaces to work on. # cmdifn=$* # Deconfigure the interface(s) network_common ifn_stop + + if [ -f /etc/rc.d/routing -a -n "$cmdifn" ] ; then + for _if in $cmdifn; do + /etc/rc.d/routing stop any $_if + done + fi } # network_common routine |