LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 08-15-2005, 08:12 PM   #1
asilentmurmur
Member
 
Registered: Mar 2005
Location: Washington DC area
Posts: 214

Rep: Reputation: 30
Help switching from Static IP to DHCP on Redhat Linux 9


Ok heres my story: I recently installed a second NIC card inside a desktop PC. I also installed Redhat Linux 9 with a minimal installation onto the desktop. I plan to use the desktop as a firewall/server. I set up eth0 as a static IP. What I want to know is , how do I switch it from static IP to DHCP so if I need to use it as DHCP i will be able to? Also, I am only running command prompt so please give me the proper commands. Also how do I switch it back to Static IP when im done with the DHCP?
 
Old 08-16-2005, 06:25 AM   #2
RanDrake10
Member
 
Registered: Oct 2004
Location: Florida
Distribution: Debian
Posts: 319

Rep: Reputation: 30
You need dhcpd installed, then use an editor (like vi) to change /etc/network/interfaces change "iface eth0 inet static" to "iface eth0 inet dhcp" and commet out the options below that line.
 
Old 08-16-2005, 07:37 AM   #3
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Actually dhcpd is a DHCP server.

You need either dhclient, dhcpcd or bump to be a DHCP client. On my Redhat and Debian I have dhclient. I just learned about the other two yesterday - apparently they are older clients.
 
Old 08-16-2005, 02:30 PM   #4
asilentmurmur
Member
 
Registered: Mar 2005
Location: Washington DC area
Posts: 214

Original Poster
Rep: Reputation: 30
and how would i use dhclient on Redhat to change my configuration from static IP to DHCP ? (also how would i do it the reverse way too)
 
Old 08-16-2005, 03:07 PM   #5
RanDrake10
Member
 
Registered: Oct 2004
Location: Florida
Distribution: Debian
Posts: 319

Rep: Reputation: 30
I meant to type "dhcpcd". Install the rpm, then change the interfaces file. To switch back to static just remove dhcp for static. It's on the install cd's or pbone.net.
 
Old 08-16-2005, 03:53 PM   #6
asilentmurmur
Member
 
Registered: Mar 2005
Location: Washington DC area
Posts: 214

Original Poster
Rep: Reputation: 30
where can i find the rpm with out connecting to the internet?
 
Old 08-16-2005, 06:49 PM   #7
asilentmurmur
Member
 
Registered: Mar 2005
Location: Washington DC area
Posts: 214

Original Poster
Rep: Reputation: 30
ok i downloaded dhcpcd and i installed it using the configure script/make/make install/make clean procedure, but now when i run the dhcpcd client, it doesnt give me any output, it just sits there running and then the command prompt comes back up. What did I do wrong? Also how do I use this thing to access the interfaces and change the network configuration to DHCP instead of Static?
 
Old 08-16-2005, 07:52 PM   #8
RanDrake10
Member
 
Registered: Oct 2004
Location: Florida
Distribution: Debian
Posts: 319

Rep: Reputation: 30
type "vi /etc/network/interfaces" to use vi editor to edit this file. In vi press " i " to insert text, then " Esc " to stop editing, and " : " then " q " to save file and quit. When done editing type "/etc/init.d/networking restart" to restart networking with dhcpcd running, or reboot.
 
Old 08-16-2005, 08:08 PM   #9
mhiggins
Member
 
Registered: Feb 2004
Posts: 140

Rep: Reputation: 15
Even a minimal install will have dhclient already installed! so you don't need to compile anything. Another note is if you do compile something it will break many RH scripts that depend on dhclient and its config files to be in specific locations. Anyway to set you interface to use dhcp run the following command as root

/usr/sbin/setup

select network configuration and select dhcp for eth0.

The other way is to edit a some config files namely :

/etc/sysconfig/network-scripts/ifcfg-eth0

make it look like this

DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
TYPE=Ethernet


-Matt
 
  


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
switching from dhcp to static lost internet basq3 Linux - Networking 8 03-29-2005 09:44 AM
Redhat 9 auto-dhcp on static interface snigglyfox Linux - Networking 1 10-01-2004 10:39 AM
FC2 Overriding static if in favor of dhcp system set for static pkraus109 Linux - Networking 8 09-21-2004 11:13 AM
RedHat 9 dhcp or static? MongeK Linux - Networking 2 12-14-2003 12:05 PM
Switching from DHCP to static IP class-a Linux - Networking 0 09-19-2001 03:38 AM

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

All times are GMT -5. The time now is 06:19 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