diff options
-rw-r--r-- | sysconfig.txt | 3 | ||||
-rwxr-xr-x | sysconfig/network-scripts/ifup-eth | 22 |
2 files changed, 23 insertions, 2 deletions
diff --git a/sysconfig.txt b/sysconfig.txt index fde8934e..c002eb5f 100644 --- a/sysconfig.txt +++ b/sysconfig.txt @@ -586,6 +586,9 @@ Files in /etc/sysconfig/network-scripts/ If set to 'no', ifup will not try to determine, if requested ip address is used by other machine in network. Defaults to 'yes'. + IPV4_FAILURE_FATAL=yes|no + If set to yes, ifup-eth will end immediately after ipv4 dhclient fails. + Defaults to 'no'. For dynamic addressing (BOOTPROTO=dhcp) only DEVICE needs to be set; all the rest will be determined by the boot protocol. diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth index e76d4c24..bd524343 100755 --- a/sysconfig/network-scripts/ifup-eth +++ b/sysconfig/network-scripts/ifup-eth @@ -172,9 +172,16 @@ if [ -n "${DYNCONFIG}" ] && [ -x /sbin/dhclient ]; then if /sbin/dhclient ${DHCLIENTARGS} ${DEVICE} ; then echo $" done." + dhcpipv4="good" else echo $" failed." - exit 1 + if [[ "${IPV4_FAILURE_FATAL}" = [Yy1]* ]] ; then + exit 1 + fi + if [[ "$IPV6INIT" != [yY1]* && "$DHCPV6C" != [yY1]* ]] ; then + exit 1 + fi + net_log "Unable to obtain IPv4 DHCP address ${DEVICE}." warning fi # end dynamic device configuration else @@ -275,7 +282,18 @@ fi if [[ "${DHCPV6C}" = [Yy1]* ]] && [ -x /sbin/dhclient ]; then generate_config_file_name 6 generate_lease_file_name 6 - /sbin/dhclient -6 -1 ${DHCPV6C_OPTIONS} ${DHCLIENTCONF} -lf ${LEASEFILE} -pf /var/run/dhclient6-${DEVICE}.pid -H ${DHCP_HOSTNAME:-${HOSTNAME%%.*}} ${DEVICE} + echo + echo -n $"Determining IPv6 information for ${DEVICE}..." + if /sbin/dhclient -6 -1 ${DHCPV6C_OPTIONS} ${DHCLIENTCONF} -lf ${LEASEFILE} -pf /var/run/dhclient6-${DEVICE}.pid -H ${DHCP_HOSTNAME:-${HOSTNAME%%.*}} ${DEVICE} ; then + echo $" done." + else + echo $" failed." + if [ "${dhcpipv4}" = "good" -o -n "${IPADDR}" ]; then + net_log "Unable to obtain IPv6 DHCP address ${DEVICE}." warning + else + exit 1 + fi + fi fi if [ "${IPX}" = yes ]; then |