= dhclient = Configures network settings based on onformation provided by a DHCP server. == Slackware settings for classless static routes == Adapted from [[http://forums.opensuse.org/english/get-technical-help-here/network-internet/449539-classless-static-routes.html]]. Create file '''/etc/dhclient.conf''': {{{#!highlight bash option rfc3442-classless-static-routes code 121 = array of unsigned integer 8; option ms-classless-static-routes code 249 = array of unsigned integer 8; also request rfc3442-classless-static-routes; also request ms-classless-static-routes; send host-name "hostx"; request subnet-mask, broadcast-address, time-offset, routers, domain-name, host-name, netbios-name-servers, netbios-scope, interface-mtu, rfc3442-classless-static-routes, ntp-servers,domain-name-servers; }}} Create file '''/etc/dhclient-exit-hooks''': {{{#!highlight bash if [ "$new_rfc3442_classless_static_routes" != "" ]; then if [ "$reason" = "BOUND" ] || [ "$reason" = "REBOOT" ]; then rfc_routes=($new_rfc3442_classless_static_routes) for(( i=0; i < ${#rfc_routes[@]}; )); do net_length=${rfc_routes[$i]} ((i++)) net_address=(0 0 0 0) for(( j=0; j < $[$net_length / 8 + \ ($net_length % 8 ? 1 : 0)]; j++, i++)); do net_address[$j]=${rfc_routes[$i]} done gateway=(0 0 0 0) for (( j=0; j < 4; j++, i++ )); do gateway[$j]=${rfc_routes[$i]} done old_IFS="$IFS" IFS='.' if [ "$net_length" == "32" ]; then /sbin/route add -host "${net_address[*]}" gw "${gateway[*]}" else /sbin/route add -net "${net_address[*]}/$net_length" gw "${gateway[*]}" fi IFS="$old_IFS" done fi fi }}} To get and apply settings run '''dhclient eth0 -v''' for eth0 interface. Add to '''/etc/rc.d/rc.local''' {{{ /sbin/dhclient -v eth0 }}}