LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-13-2005, 02:57 PM   #1
dmkh
LQ Newbie
 
Registered: Apr 2004
Location: France
Distribution: Mandrake 10.0
Posts: 6

Rep: Reputation: 0
Unable to switch from DHCP to Static IP with Slackware 10.1


Hi

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)

Thanks

Last edited by dmkh; 09-13-2005 at 03:02 PM.
 
Old 09-13-2005, 04:04 PM   #2
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
As root (using su to become root), issue the command netconfig, you can set up your network settings that way.
 
Old 09-13-2005, 04:52 PM   #3
dmkh
LQ Newbie
 
Registered: Apr 2004
Location: France
Distribution: Mandrake 10.0
Posts: 6

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

Another suggestion ?
 
Old 09-13-2005, 05:49 PM   #4
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
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.)
 
Old 09-13-2005, 06:04 PM   #5
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
If his DHCP server is a residential gateway/router, it probably doesn't have the ability to bind IPs to MAC.
 
Old 09-13-2005, 08:13 PM   #6
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
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.

dmkh,
Why the sudden need/urge to move from DHCP to static IP?
And, BTW, which DLink router?
 
Old 09-14-2005, 03:20 AM   #7
dmkh
LQ Newbie
 
Registered: Apr 2004
Location: France
Distribution: Mandrake 10.0
Posts: 6

Original Poster
Rep: Reputation: 0
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 ?

Thanks
 
Old 09-14-2005, 05:37 AM   #8
PDock
Member
 
Registered: Aug 2004
Distribution: Slack10 & curr. tried numerous
Posts: 189

Rep: Reputation: 37
I suspect besides /etc/resolv.conf you also have /etc/resolv.conf.sv 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.
Options:
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
 
Old 09-14-2005, 06:46 AM   #9
dmkh
LQ Newbie
 
Registered: Apr 2004
Location: France
Distribution: Mandrake 10.0
Posts: 6

Original Poster
Rep: Reputation: 0
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.

Last edited by dmkh; 09-14-2005 at 06:53 AM.
 
Old 09-15-2005, 03:41 AM   #10
dmkh
LQ Newbie
 
Registered: Apr 2004
Location: France
Distribution: Mandrake 10.0
Posts: 6

Original Poster
Rep: Reputation: 0
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 ?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How Do I Switch From Static IP To DHCP Psibur Linux - Networking 3 06-23-2005 09:40 AM
Switch DHCP to STATIC zaicheke Linux - Newbie 2 09-14-2004 09:12 PM
Switch DHCP to static Darkangel90 Linux - Networking 1 03-29-2004 05:15 AM
switch RH 7.2 from DHCP over to static IP dwichman Linux - Networking 3 03-04-2002 01:28 AM
Switch from static IP to dhcp ? Fuel Linux - Networking 2 02-23-2002 09:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration