Help switching from Static IP to DHCP on Redhat Linux 9
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
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.
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?
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.
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 :
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.