LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Changing dhcp ip -> fixed ip (http://www.linuxquestions.org/questions/linux-networking-3/changing-dhcp-ip-fixed-ip-178088/)

Lakani 05-05-2004 05:32 AM

Changing dhcp ip -> fixed ip
 
I have two servers here which obtain their ip address through dhcp. The dhcp server was set to give out a fixed ip address on their mac addresses. Now that the router (dhcp server) has died I had to get a new router. The new router doesn't support this feature, so I have to change the settings on the server from dhcp to a fixed ip. Does anyone know how this can be done? I looked through alot of faqs and howtos but didn't read an anwser to my question.

On the servers I use RH9 and RH7.

I forgot to tell you that I don't have a gui available.

I have found the solution to my problem:

in the directory /etc/sysconfig/network-scripts/ you can find the scripts that define the settings for the nic, called ifcfg-eth# (ifcfg-eth0 in my case).

For static IPs

DEVICE=eth0
NAME=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=xxx.xxx.xxx.xxx
NETMASK=xxx.xxx.xxx.xxx
BROADCAST=xxx.xxx.xxx.xxx
NETWORK=xxxx.xxx.xxx.xxx

For DHCP IPs

DEVICE=eth0
NAME=eth0
ONBOOT=yes
BOOTPROTO=dhcp


All times are GMT -5. The time now is 09:23 PM.