3 # Copyright (C) 2004, 2007-2010 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.59 2010/06/11 23:46:49 tbox Exp $
21 # Set up interface aliases for bind9 system tests.
23 # IPv4: 10.53.0.{1..7} RFC 1918
24 # IPv6: fd92:7065:b8e:ffff::{1..7} ULA
28 for f in ./config.guess ../../../config.guess
36 if test "X$config_guess" = "X"
39 $0: must be run from the top level source directory or the
40 bin/tests/system directory
45 # If running on hp-ux, don't even try to run config.guess.
46 # It will try to create a temporary file in the current directory,
47 # which fails when running as root with the current directory
48 # on a NFS mounted disk.
52 *) sys=`sh $config_guess` ;;
56 [0-9]|[1-9][0-9]|[1-9][0-9][0-9]) base=$2;;
61 [0-9]|[1-9][0-9]|[1-9][0-9][0-9]) base6=$2;;
68 for ns in 1 2 3 4 5 6 7
72 int=`expr $ns + $base - 1`
78 int6=`expr $ns + $base6 - 1`
84 ifconfig lo0:$int 10.53.0.$ns netmask 0xffffffff up
87 ifconfig lo0:$int 10.53.0.$ns netmask 0xffffffff up
89 *-*-solaris2.[8-9]|*-*-solaris2.1[0-9])
90 /sbin/ifconfig lo0:$int plumb
91 /sbin/ifconfig lo0:$int 10.53.0.$ns up
94 /sbin/ifconfig lo0:$int6 inet6 plumb
95 /sbin/ifconfig lo0:$int6 \
96 inet6 fd92:7065:b8e:ffff::$ns up
100 ifconfig lo:$int 10.53.0.$ns up netmask 255.255.255.0
101 ifconfig lo inet6 add fd92:7065:b8e:ffff::$ns/64
104 ifconfig lo0 10.53.0.$ns alias netmask 0xffffffff
105 ifconfig lo0 inet6 fd92:7065:b8e:ffff::$ns alias
108 ifconfig lo0 10.53.0.$ns alias netmask 255.255.255.0
109 ifconfig lo0 inet6 fd92:7065:b8e:ffff::$ns alias
112 ifconfig lo0 10.53.0.$ns alias netmask 255.255.255.0
113 ifconfig lo0 inet6 fd92:7065:b8e:ffff::$ns alias
116 ifconfig lo0 add 10.53.0.$ns netmask 255.255.255.0
119 ifconfig lo0 alias 10.53.0.$ns
122 ifconfig lo0 alias 10.53.0.$ns
124 *-*-sysv5uw7*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
125 ifconfig lo0 10.53.0.$ns alias netmask 0xffffffff
127 *-ibm-aix4.*|*-ibm-aix5.*)
128 ifconfig lo0 alias 10.53.0.$ns
129 ifconfig lo0 inet6 alias -dad fd92:7065:b8e:ffff::$ns/64
132 ifconfig lo0:$int 10.53.0.$ns netmask 255.255.255.0 up
133 ifconfig lo0:$int inet6 fd92:7065:b8e:ffff::$ns up
136 ifconfig lo0 alias 10.53.0.$ns
139 ifconfig lo0 alias 10.53.0.$ns
140 ifconfig lo0 inet6 fd92:7065:b8e:ffff::$ns alias
143 echo "Don't know how to set up interface. Giving up."
150 for ns in 7 6 5 4 3 2 1
154 int=`expr $ns + $base - 1`
160 ifconfig lo0:$int 0.0.0.0 down
162 *-sun-solaris2.[6-7])
163 ifconfig lo0:$int 10.53.0.$ns down
165 *-*-solaris2.[8-9]|*-*-solaris2.1[0-9])
166 ifconfig lo0:$int 10.53.0.$ns down
167 ifconfig lo0:$int 10.53.0.$ns unplumb
170 ifconfig lo0:$int6 inet6 down
171 ifconfig lo0:$int6 inet6 unplumb
175 ifconfig lo:$int 10.53.0.$ns down
176 ifconfig lo inet6 del fd92:7065:b8e:ffff::$ns/64
179 ifconfig lo0 10.53.0.$ns delete
180 ifconfig lo0 inet6 fd92:7065:b8e:ffff::$ns delete
183 ifconfig lo0 10.53.0.$ns delete
184 ifconfig lo0 inet6 fd92:7065:b8e:ffff::$ns delete
187 ifconfig lo0 10.53.0.$ns delete
188 ifconfig lo0 inet6 fd92:7065:b8e:ffff::$ns delete
191 ifconfig lo0 remove 10.53.0.$ns
194 ifconfig lo0 -alias 10.53.0.$ns
197 ifconfig lo0 -alias 10.53.0.$ns
199 *-*-sysv5uw7*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
200 ifconfig lo0 -alias 10.53.0.$ns
202 *-ibm-aix4.*|*-ibm-aix5.*)
203 ifconfig lo0 delete 10.53.0.$ns
204 ifconfig lo0 delete inet6 fd92:7065:b8e:ffff::$ns/64
207 ifconfig lo0:$int 0.0.0.0
208 ifconfig lo0:$int inet6 ::
211 ifconfig lo0 -alias 10.53.0.$ns
214 ifconfig lo0 -alias 10.53.0.$ns
215 ifconfig lo0 inet6 fd92:7065:b8e:ffff::$ns delete
218 echo "Don't know how to destroy interface. Giving up."
226 echo "Usage: $0 { up | down } [base]"