Skip to content

Instantly share code, notes, and snippets.

@hedgehog
Created July 2, 2011 14:40
Show Gist options
  • Save hedgehog/1060540 to your computer and use it in GitHub Desktop.
Save hedgehog/1060540 to your computer and use it in GitHub Desktop.
# Removing leftover leases and persistent rules
echo "cleaning up dhcp leases"
rm /var/lib/dhcp3/*
# Make sure Udev doesn't block our network
# http://6.ptmc.org/?p=164
echo "cleaning up udev rules"
DIR_PATH=`readlink -f "/etc/udev/rules.d/70-persistent-net.rules"` # get rid of symlinks and get abs path
rm -rf /etc/udev/rules.d/70-persistent-net.rules
if [[ ! -d "${DIR_PATH}" ]] ; then # now you're testing
mkdir -p /etc/udev/rules.d/70-persistent-net.rules
fi
rm -rf /dev/.udev/
rm -rf /lib/udev/rules.d/75-persistent-net-generator.rules
echo "Adding a 2 sec delay to the interface up, to make the dhclient happy"
echo "pre-up sleep 2" >> /etc/network/interfaces
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment