diff options
author | David Hankins <dhankins@isc.org> | 2008-01-16 23:02:10 +0000 |
---|---|---|
committer | David Hankins <dhankins@isc.org> | 2008-01-16 23:02:10 +0000 |
commit | 30922d9c3cdaa7bf8c28595e5286731fcfac50ef (patch) | |
tree | 8ae6ee803fe59f9b475dffe1271aed9feaf4e48c /client | |
parent | 219a65eb6e4eee3809cfde2151e863665579a44c (diff) | |
download | isc-dhcp-30922d9c3cdaa7bf8c28595e5286731fcfac50ef.tar.gz |
- The dhclient-script was updated to create a host route for the default
gateway if the supplied subnet mask for an IPv4 address was a /32. This
allows the client to work in 'captive' network environments, where the
operator does not want clients to crosstalk directly. [ISC-Bugs #17200]
Diffstat (limited to 'client')
-rwxr-xr-x | client/scripts/freebsd | 11 | ||||
-rwxr-xr-x | client/scripts/linux | 6 |
2 files changed, 16 insertions, 1 deletions
diff --git a/client/scripts/freebsd b/client/scripts/freebsd index 988c9ef0..67ff002e 100755 --- a/client/scripts/freebsd +++ b/client/scripts/freebsd @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: freebsd,v 1.20 2007/11/30 21:28:29 fdupont Exp $ +# $Id: freebsd,v 1.21 2008/01/16 23:02:10 dhankins Exp $ # # $FreeBSD$ @@ -186,6 +186,12 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \ fi route add $new_ip_address 127.1 >/dev/null 2>&1 for router in $new_routers; do + # If the subnet is captive, eg the netmask is /32 but the default + # gateway is (obviously) outside of this, then we need to produce a + # host route to reach the gateway. + if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then + route add -host $router -interface $interface + fi route add default $router >/dev/null 2>&1 done if [ -n "$new_static_routes" ]; then @@ -257,6 +263,9 @@ if [ x$reason = xTIMEOUT ]; then fi route add $new_ip_address 127.1 >/dev/null 2>&1 for router in $new_routers; do + if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then + route add -host $router -interface $interface + fi route add default $router >/dev/null 2>&1 done set -- $new_static_routes diff --git a/client/scripts/linux b/client/scripts/linux index 6ac25dd4..a0fcab55 100755 --- a/client/scripts/linux +++ b/client/scripts/linux @@ -166,6 +166,9 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \ route add -net $new_network_number $new_subnet_arg dev $interface fi for router in $new_routers; do + if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then + route add -host $router dev $interface + fi route add default gw $router done fi @@ -214,6 +217,9 @@ if [ x$reason = xTIMEOUT ]; then route add -net $new_network_number fi for router in $new_routers; do + if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then + route add -host $router dev $interface + fi route add default gw $router done make_resolv_conf |