LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Running netconfig will not switch from static to DHCP (http://www.linuxquestions.org/questions/slackware-14/running-netconfig-will-not-switch-from-static-to-dhcp-4175440514/)

damgar 12-07-2012 08:06 PM

Running netconfig will not switch from static to DHCP
 
I have a 14.0 system that normally uses a static up address. I need to switch to dhcp to do some troubleshooting and reconfigure some things. Running netconfig as root I go through the prompts, reboot, and when the machine Combes back up not only is it not taking a new address, but ifconfig shows the same static IP address. Am I missing something? Is there someplace I have to edit manually as well to lose the static IP address?

glorsplitz 12-07-2012 09:28 PM

maybe something to do with /etc/udev/rules.d/70-persistent-net.rules? delete it and reboot

I'd just edit rc.inet1.conf to do dhcp, then restart rc.inet1.

TommyC7 12-07-2012 11:56 PM

Have you tried editing /etc/rc.d/rc.inet1.conf manually, and set it to use DHCP?

GazL 12-08-2012 05:22 AM

One thing I've noticed is that if you ever select networkmanager in netconfig then it will chmod 755 rc.networkmanager, but there is no corresponding chmod 644 when you select one of the non-networkmanager options. You might want to check that networkmanager isn't interfering with what you want to happen.


I gave up on the stock netconfig and rc.inet1 a while back when I realised that having 300 lines of script in rc.inet1 and 100 lines of rc.inet1.conf were a little silly when all I need is this:
Code:

#! /bin/sh
#    /etc/rc.d/rc.inet1
#      Simpler replacement for Slackware's stock rc.inet1.

########################################################################

##  STOP  ##

if [ "$1" = "stop" -o "$1" = "restart" ]; then
  echo "Stopping network interfaces..."
  # /sbin/ifconfig lo down
  /sbin/ifconfig eth0 down

  /sbin/dhclient -x wlan0
  /usr/sbin/wpa_cli -i wlan0 terminate
fi

##  (RE)START  ##

if [ "$1" != "stop" ]; then
  echo "Starting network interfaces..."
  /sbin/ifconfig lo 127.0.0.1
  /sbin/ifconfig eth0 192.168.1.2

  /usr/sbin/wpa_supplicant -B -D wext -i wlan0 \
                            -c /etc/wpa_supplicant.conf \
    && /sbin/dhclient wlan0
fi

########################################################################



All times are GMT -5. The time now is 10:38 AM.