#!/bin/sh #---------------------------------------------------------------------------- # /etc/rc.d/rc310.dhclient - startup of DHCP client dhclient # was file /etc/rc.d/rc.dhclient # # Creation: 21.10.2001 fm # Last Update: $Id$ #---------------------------------------------------------------------------- case x$DHCP_CLIENT_TYPE in xdhclient) begin_script DHCP_CLIENT "starting dhcp client dhclient ..." ip_up_events='yes' ln -s /etc/dhcpcd.sh /etc/dhclient-exit-hooks mkdir -p /var/db [ "$DHCP_CLIENT_DEBUG" = yes ] && > /var/run/dhcp-debug > /etc/dhclient.conf [ 0$DHCP_CLIENT_N -eq 0 ] || for i in `seq 1 $DHCP_CLIENT_N`; do eval interface=\$DHCP_CLIENT_${i}_IF eval route=\$DHCP_CLIENT_${i}_ROUTE eval usepeerdns=\$DHCP_CLIENT_${i}_USEPEERDNS eval hostname=\$DHCP_CLIENT_${i}_HOSTNAME no_def_gw= : ${route:=none} eval interface=\$$interface if [ ! "$interface" ]; then log_error "invalid interface reference $i" continue fi interfaces="$interfaces $interface" [ "$hostname" ] && cat <> /etc/dhclient.conf interface "$interface" { send host-name "$hostname"; } EOF > /var/run/dhcp-client.$interface.$route case $route in imond | default) ip_up_events='yes' > /var/run/dhcp-client.$interface.ip-updown [ "$usepeerdns" = yes ] && echo yes > /var/run/$interface.usepeerdns ;; esac [ "$route" = default ] && > /var/run/$interface.gw done if [ -n "$interfaces" ]; then for i in $interfaces; do ip link set $i up done # found no other way to do it - i have to switch off the spoofing filter # for a while filter=`cat /proc/sys/net/ipv4/conf/all/rp_filter` echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter dhclient -sf /etc/dhclient-script $interfaces # write it back echo $filter > /proc/sys/net/ipv4/conf/all/rp_filter fi end_script ;; esac