3 # Copyright (C) 2004, 2007-2009 Internet Systems Consortium, Inc. ("ISC")
4 # Copyright (C) 2000-2003 Internet Software Consortium.
6 # Permission to use, copy, modify, and/or distribute this software for any
7 # purpose with or without fee is hereby granted, provided that the above
8 # copyright notice and this permission notice appear in all copies.
10 # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
11 # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12 # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
13 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 # PERFORMANCE OF THIS SOFTWARE.
18 # Id: ifconfig.sh,v 1.57 2009/06/26 23:47:58 tbox Exp
21 # Set up interface aliases for bind9 system tests.
25 for f
in .
/config.guess ..
/..
/..
/config.guess
33 if test "X$config_guess" = "X"
36 $0: must be run from the top level source directory or the
37 bin/tests/system directory
42 # If running on hp-ux, don't even try to run config.guess.
43 # It will try to create a temporary file in the current directory,
44 # which fails when running as root with the current directory
45 # on a NFS mounted disk.
49 *) sys
=`sh $config_guess` ;;
53 [0-9]|
[1-9][0-9]|
[1-9][0-9][0-9]) base
=$2;;
60 for ns
in 1 2 3 4 5 6 7
64 int
=`expr $ns + $base - 1`
70 ifconfig lo0
:$int 10.53.0.
$ns netmask
0xffffffff up
73 ifconfig lo0
:$int 10.53.0.
$ns netmask
0xffffffff up
75 *-*-solaris2.
[8-9]|
*-*-solaris2.1
[0-9])
76 /sbin
/ifconfig lo0
:$int plumb
77 /sbin
/ifconfig lo0
:$int 10.53.0.
$ns up
80 ifconfig lo
:$int 10.53.0.
$ns up netmask
255.255.255.0
83 ifconfig lo0
10.53.0.
$ns alias netmask
0xffffffff
86 ifconfig lo0
10.53.0.
$ns alias netmask
255.255.255.0
89 ifconfig lo0
10.53.0.
$ns alias netmask
255.255.255.0
92 ifconfig lo0 add
10.53.0.
$ns netmask
255.255.255.0
95 ifconfig lo0
alias 10.53.0.
$ns
98 ifconfig lo0
alias 10.53.0.
$ns
100 *-*-sysv5uw7*|
*-*-sysv*UnixWare
*|
*-*-sysv*OpenUNIX
*)
101 ifconfig lo0
10.53.0.
$ns alias netmask
0xffffffff
103 *-ibm-aix4.
*|
*-ibm-aix5.
*)
104 ifconfig lo0
alias 10.53.0.
$ns
107 ifconfig lo0
:$int 10.53.0.
$ns up
110 ifconfig lo0
alias 10.53.0.
$ns
113 ifconfig lo0
alias 10.53.0.
$ns
116 echo "Don't know how to set up interface. Giving up."
123 for ns
in 7 6 5 4 3 2 1
127 int
=`expr $ns + $base - 1`
133 ifconfig lo0
:$int 0.0.0.0 down
135 *-sun-solaris2.
[6-7])
136 ifconfig lo0
:$int 10.53.0.
$ns down
138 *-*-solaris2.
[8-9]|
*-*-solaris2.1
[0-9])
139 ifconfig lo0
:$int 10.53.0.
$ns down
140 ifconfig lo0
:$int 10.53.0.
$ns unplumb
143 ifconfig lo
:$int 10.53.0.
$ns down
146 ifconfig lo0
10.53.0.
$ns delete
149 ifconfig lo0
10.53.0.
$ns delete
152 ifconfig lo0
10.53.0.
$ns delete
155 ifconfig lo0 remove
10.53.0.
$ns
158 ifconfig lo0
-alias 10.53.0.
$ns
161 ifconfig lo0
-alias 10.53.0.
$ns
163 *-*-sysv5uw7*|
*-*-sysv*UnixWare
*|
*-*-sysv*OpenUNIX
*)
164 ifconfig lo0
-alias 10.53.0.
$ns
166 *-ibm-aix4.
*|
*-ibm-aix5.
*)
167 ifconfig lo0 delete
10.53.0.
$ns
170 ifconfig lo0
:$int 10.53.0.
$ns down
173 ifconfig lo0
-alias 10.53.0.
$ns
176 ifconfig lo0
-alias 10.53.0.
$ns
179 echo "Don't know how to destroy interface. Giving up."
187 echo "Usage: $0 { up | down } [base]"