-   Linux - Networking (
-   -   Unable to switch from DHCP to Static IP with Slackware 10.1 (

dmkh 09-13-2005 03:57 PM

Unable to switch from DHCP to Static IP with Slackware 10.1

When installing Slackware 10.1 I've choosen DHCP to connect to Internet via a router DLink.
But now I want to use Static IP by editing thoses files

/etc/rc.d/rc.inet1.conf (IP, Netmask, gateway, disabled DHCP)
/etc/resolv.conf (Nameserver) and
/etc/hosts (Host)

After rebooting the machine, I can not connect to the Internet anymore. When checking the file /etc/resolv.conf I found nothing in there except a word "search", all the DNS address I'd entered have disappeared.
Could it be the reason of the failure of connection ?
How could I prevent resolv.conf from being modified after a reboot (by dhcpcd ?) ?
Has any Slackware'user made a successful switch from DHCP to Static IP and how to do ?

(I have the same Static IP configuration for Windows dually installed with Slackware and can connect nomally to the Internet)


XavierP 09-13-2005 05:04 PM

As root (using su to become root), issue the command netconfig, you can set up your network settings that way.

dmkh 09-13-2005 05:52 PM

I'd tried all that (netconfig, ifconfig) but no luck so I've modified manually thoses setting files.
Thank you anyway

Another suggestion ?

archtoad6 09-13-2005 06:49 PM

If you need the box to always have the same IP, why don't you force that by MAC address on the DHCP server? (And avoid this hassle.)

MS3FGX 09-13-2005 07:04 PM

If his DHCP server is a residential gateway/router, it probably doesn't have the ability to bind IPs to MAC.

archtoad6 09-13-2005 09:13 PM

Every "Broadband Router" I ever owned could do "Address Reservation", or whatever the mfr. called the feature. Some still can. I guess it has been so long since I bought one, I didn't notice that some don't.

Why the sudden need/urge to move from DHCP to static IP?
And, BTW, which DLink router?

dmkh 09-14-2005 04:20 AM

I need this move to static IP because I want to open a port on my box to use aMule.
I don't remember the serie of my DLink router because I'm not home at the moment.

But thing that bothers me the most is why I could not do such a simple stuff with my Slackware. What makes changes to my resolv.conf and how prevent such changes to preserve my nameservers ?


PDock 09-14-2005 06:37 AM

I suspect besides /etc/resolv.conf you also have /etc/ which means a dhcpd server is still updating this file ( man dhcpd.conf ).
Also suspect you a still running dhcpd or hcpd on the box you are trying to convert to static ip.
1. chmod -x /etc/rc.d/rc.dhcpd ; do the same for hcpd ; ie stop running the client and/or server

2. put your resolv entries in the global section of /etc/dhcpd.conf such that the resolv.conf file stays the same after it is swapped out.

Hope this helps

dmkh 09-14-2005 07:46 AM

Thank PDock

I have the same impression that DHCP still is running and and overwriting the resolv.conf. file. As I desabled DHCP check in /etc/rc.d/rc.inet1.conf, the script that check nameservers find nothing. As a result, the resolv.conf is resfreshed with blank as nameservers.

I'll try your suggestion tonight when back home and give you feedback.

dmkh 09-15-2005 04:41 AM

No luck
I've tried all this but it didn't work until I commented out the line USE_DHCP="" in /etc/rc.d/rc.inet1.conf that actually preserved my /etc/resolved.conf. But the Internet connection still failed. (When I switched back to DHCP by Netconfig, the connection worked well).

By curiosity, I completely reinstalled Slacware and set Static IP during the installation to see what'll happen. Then the connection worked well with Static ID. Checking out all three files inet1.conf, resolv.conf and hosts I found they have the same settings as when I manually modified them before the re-installation. That means besides those three files, there's something else that affects the Internet connection.

Who knows ?

All times are GMT -5. The time now is 07:47 PM.