/sbin/ifup has # set up default gateway if [ "${GATEWAY}" != "" -a "`ipcalc --network ${GATEWAY} ${NETMASK}`" = "NETWORK=${NETWORK}" ]; then route add default gw ${GATEWAY} ${DEVICE} DEFGW=${GATEWAY} elif [ "${GATEWAYDEV}" = "${DEVICE}" ]; then route add default ${DEVICE} fi The problem is `ipcalc --network ${GATEWAY} ${NETMASK}` is always evaluated with /bin/sh even if "${GATEWAY}" is "". I won't call it a bash bug. One way to fix it is to use `ipcalc --network ${GATEWAY} ${NETMASK} 2> /dev/null` to get rid of error messages from ipcalc.
*** This bug has been marked as a duplicate of 30741 ***