4 echo search $new_domain_name >/etc/resolv.conf
5 for nameserver in $new_domain_name_servers; do
6 echo nameserver $nameserver >>/etc/resolv.conf
10 # Must be used on exit. Invokes the local dhcp client exit hooks, if any.
13 if [ -x /etc/dhclient-exit-hooks ]; then
14 . /etc/dhclient-exit-hooks
16 # probably should do something with exit status of the local script
20 # Invoke the local dhcp client enter hooks, if they exist.
21 if [ -x /etc/dhclient-enter-hooks ]; then
23 . /etc/dhclient-enter-hooks
24 # allow the local script to abort processing of this state
25 # local script must set exit_status variable to nonzero.
26 if [ $exit_status -ne 0 ]; then
31 if [ x$new_network_number != x ]; then
32 echo New Network Number: $new_network_number
35 if [ x$new_broadcast_address != x ]; then
36 echo New Broadcast Address: $new_broadcast_address
37 new_broadcast_arg="broadcast $new_broadcast_address"
39 if [ x$old_broadcast_address != x ]; then
40 old_broadcast_arg="broadcast $old_broadcast_address"
42 if [ x$new_subnet_mask != x ]; then
43 new_netmask_arg="netmask $new_subnet_mask"
45 if [ x$old_subnet_mask != x ]; then
46 old_netmask_arg="netmask $old_subnet_mask"
48 if [ x$alias_subnet_mask != x ]; then
49 alias_subnet_arg="netmask $alias_subnet_mask"
52 if [ x$reason = xMEDIUM ]; then
53 ifconfig $interface $medium
54 ifconfig $interface inet -alias 0.0.0.0 $medium >/dev/null 2>&1
59 if [ x$reason = xPREINIT ]; then
60 if [ x$alias_ip_address != x ]; then
61 ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1
62 route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
64 ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 \
65 broadcast 255.255.255.255 up
69 if [ x$reason = xARPCHECK ] || [ x$reason = xARPSEND ]; then
73 if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
74 [ x$reason = xREBIND ] || [ x$reason = xREBOOT ]; then
75 if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \
76 [ x$alias_ip_address != x$old_ip_address ]; then
77 ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1
78 route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
80 if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]; then
81 ifconfig $interface inet -alias $old_ip_address $medium
82 route delete $old_ip_address 127.1 >/dev/null 2>&1
83 for router in $old_routers; do
84 route delete default $router >/dev/null 2>&1
86 if [ "$old_static_routes" != "" ]; then
87 set $old_static_routes
88 while [ $# -gt 1 ]; do
93 arp -n -a | sed -n -e 's/^.*(\(.*\)) at .*$/arp -n -d \1/p' |sh
95 if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
96 [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
97 ifconfig $interface inet $new_ip_address $new_netmask_arg \
98 $new_broadcast_arg $medium
99 route add $new_ip_address 127.1 >/dev/null 2>&1
100 for router in $new_routers; do
101 route add default $router >/dev/null 2>&1
103 if [ "$new_static_routes" != "" ]; then
104 set $new_static_routes
105 while [ $# -gt 1 ]; do
111 if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ];
113 ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
114 route add $alias_ip_address 127.0.0.1
116 echo search $new_domain_name >/etc/resolv.conf
117 for nameserver in $new_domain_name_servers; do
118 echo nameserver $nameserver >>/etc/resolv.conf
123 if [ x$reason = xEXPIRE ] || [ x$reason = xFAIL ]; then
124 if [ x$alias_ip_address != x ]; then
125 ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1
126 route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
128 if [ x$old_ip_address != x ]; then
129 ifconfig $interface inet -alias $old_ip_address $medium
130 route delete $old_ip_address 127.1 >/dev/null 2>&1
131 for router in $old_routers; do
132 route delete default $router >/dev/null 2>&1
134 if [ "$old_static_routes" != "" ]; then
135 set $old_static_routes
136 while [ $# -gt 1 ]; do
141 arp -n -a | sed -n -e 's/^.*(\(.*\)) at .*$/arp -n -d \1/p' \
144 if [ x$alias_ip_address != x ]; then
145 ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
146 route add $alias_ip_address 127.0.0.1
151 if [ x$reason = xTIMEOUT ]; then
152 if [ x$alias_ip_address != x ]; then
153 ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1
154 route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
156 ifconfig $interface inet $new_ip_address $new_netmask_arg \
157 $new_broadcast_arg $medium
159 if [ "$new_routers" != "" ]; then
161 if ping -q -c 1 $1; then
162 if [ x$new_ip_address != x$alias_ip_address ] && \
163 [ x$alias_ip_address != x ]; then
164 ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
165 route add $alias_ip_address 127.0.0.1
167 route add $new_ip_address 127.1 >/dev/null 2>&1
168 for router in $new_routers; do
169 route add default $router >/dev/null 2>&1
171 set $new_static_routes
172 while [ $# -gt 1 ]; do
176 echo search $new_domain_name >/etc/resolv.conf.std
177 for nameserver in $new_domain_name_servers; do
178 echo nameserver $nameserver >>/etc/resolv.conf.std
180 if [ -f /etc/resolv.conf ]; then
181 rm -f /etc/resolv.conf
183 mv /etc/resolv.conf.std /etc/resolv.conf
187 ifconfig $interface inet -alias $new_ip_address $medium
188 for router in $old_routers; do
189 route delete default $router >/dev/null 2>&1
191 if [ "$old_static_routes" != "" ]; then
192 set $old_static_routes
193 while [ $# -gt 1 ]; do
198 arp -n -a | sed -n -e 's/^.*(\(.*\)) at .*$/arp -n -d \1/p' \