LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How do you release an IP address in Red Hat 7.3 (https://www.linuxquestions.org/questions/linux-networking-3/how-do-you-release-an-ip-address-in-red-hat-7-3-a-26222/)

Nsean 07-20-2002 08:25 PM

How do you release an IP address in Red Hat 7.3
 
I have rogers Internet and I'm trying to release my IP address in red hat 7.3. i tried dhcpcd -d -k eth0 but it didn't work. Can anyone help me out. Much appreciated. Thank you.

sarin 07-20-2002 09:03 PM

Try
ifconfig eth0 down
--Sarin

Nsean 07-20-2002 10:16 PM

im very much a begginer so could you explain yourself in detail. thank you.

trickykid 07-21-2002 02:28 AM

As root type:

ifconfig eth0 down

This will bring your network services down for your first ethernet card, which is referred to eth0. If you had a two, you would have eth0, eth1.. and so on.

To bring your ethernet services back up, you would then type:

ifconfig eth0 up

Think of it as dhcp release, dhcp renew in the Windows world.

Nsean 07-21-2002 07:57 AM

It didnt work is there something wrong with my computer. Is there something I con do to correct it. PLEASE HELP ME!

sarin 07-21-2002 08:12 AM

I think dhcpcd gets the ip again. You must find a way to kill it. Try finding it's pid and issue a kill -9 pid ( I never used it. So don't know if it works ).
Also try /etc/init.d/network stop.
The above command will just stop all network devices.
--Sarin

sarin 07-21-2002 08:14 AM

forgot a something. You atleast need lo working. So if you stop network just issue
ifconfig lo up
--Sarin

trickykid 07-21-2002 11:18 AM

You might want to try something like this instead of just killing the process:

kill -SIGHUP 'cat /var/run/dhcpd.pid'

It may be slightly different on other systems, but this will kill the process and restart it.

You could also try this in this order:

dhcpcd -k
ifconfig eth0 down

Then to bring back up:

ifconfig eth0 up
dhcpcd eth0

What happened when you did the ifconfig eth0 down and up ??

Just because you release and renew the IP doesn't mean it will give you a totally new IP address, if that is what your aiming for. Most ISP's, especially with cable modem will keep issueing the same IP for weeks, months and maybe years at a time.

Nsean 07-21-2002 11:58 AM

kill -SIGHUP 'cat/var/run/dhcpd.pid' seemed to almost work but it said that there was no such .pid. All the other commands gave me command not found

dnar 07-21-2002 12:35 PM

/sbin/ifconfig eth0 down

Nsean 07-21-2002 12:46 PM

I tried
kill -SIGHUP 'cat /var/run/dhcpd.pid'

but it said .pid not found. but other than that it seemed to work well. With the other commands it said command not found. Im trying to release the ip address so that i can switch my internet connection to my other computer. Thank you for all your help.

sarin 07-21-2002 01:16 PM

Take care of back quotes in `cat /var/run/dhcpd.pid`.
Try
cat /var/run/dhcpd.pid
you will see the pid. then
kill -1 pid
--Sarin.

trickykid 07-21-2002 01:31 PM

I think I missed typed it.. it could be /var/run/dhcpcd.pid but it can vary though. Take a look in your /var/run/ directory, it should have it listed there.

Nsean 07-21-2002 03:25 PM

I figured it out. It is dhcpcd -k

trickykid 07-21-2002 03:32 PM

Quote:

Originally posted by Nsean
I figured it out. It is dhcpcd -k
Yeah, you almost had it right in your first post, you definitely didn't need that -d flag. I did mention trying that in an earlier post. Glad you got it working.


All times are GMT -5. The time now is 10:04 AM.