LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how do i reset my ip? (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-i-reset-my-ip-77450/)

i_is_cat 07-30-2003 06:49 PM

how do i reset my ip?
 
hi
running redhat 7.3 kde
just had the internet reconnected as i hadn't paid the bill until today and i do not want to reboot my system but the internet company doesn't have any info on how to reset the ip on linux the best help they can give is to reboot which i do not want to do.. i know it will work fine if i do reboot but i want to know how to do it without rebooting every single time i have a problem can anyone help plz?

fsbooks 07-30-2003 07:00 PM

The method differs if you have a dynamic or a static IP. It also differs if you are dialup (ppp - modem connection) or dsl (eth0 -NIC connection). Can you fill us in plz?

Azmeen 07-30-2003 07:33 PM

ifconfig <device> down
ifconfig <device> up

Where <device> is usually...
eth0 (or eth1, eth2, etc... depending on how you assign your NIC) for NICs

I don't think you're using dialup/modem, correct me if I'm wrong.

i_is_cat 07-30-2003 07:36 PM

sorry fsbooks i posted a reply but i guess it never made it through..
i have a cable modem hooked through a hub to my box and the windows one i am currently using and the other guy.. (your nick here) i will try that out and post another reply

i_is_cat 07-30-2003 07:39 PM

Azmeen

i tried what you said to do and it said there is no command "ifconfig" got any more ideas? ;/

fsbooks 07-30-2003 08:11 PM

Are you doing this as root? Is /sbin in your path? You can always try "/sbin/ifconif" to explicitly state the path. It is in the rpm net-tools: you can always do "rpm -q net-tools" to make sure you have it, but I suspect you do.

The configuration information is actually in a file called /etc/network-scripts/ifcfg-eth0. It is worth taking a look at even if your configuration is setup properly already through a GUI. I myself explicitly set my IP (local 192.168.0.0 space) there, although most people use the DHCP from their router/modem.

i_is_cat 07-30-2003 08:28 PM

ya i switched to root and then tried ifdown eth0 and then ifup eth0 or something like that
it said it worked but then mozilla and lynx and everything still wouldn't work so i just ended up rebooting but i'd still like to know how to do it if anyone can still help
thanx to everyone who tried so far :)

fsbooks 07-30-2003 09:47 PM

The "ifdown eth0;ifup eth0" sequence should work if your NIC is configured as eth0 (which it usually is). Basically, the /etc/init.d/network script does on bootup is an "ifup eth0" (getting this from the existence of a file /etc/sysconfig/network-scripts/ifcfg-eth0). I suspect your routing was messed up as well. I would do the following next time (as root, of course) "/etc/init.d/network restart" . This would reset all network parameters and devices to bootup conditions. You can mess around with it if you like. For example, save the output of "/sbin/route" and "/sbin/ifconfig". Execute "/etc/init.d/network stop" and you will nolonger have internet. Compare the output "/sbin/route" and "/sbin/ifconfig". now to the previous output. The execute "/etc/init.d/network start" and see that the output of those commands are now what they were to begin with. Note: "/etc/init.d/network restart" is simply a stop/start in sequence. Have fun.

Chris

i_is_cat 07-31-2003 03:22 AM

thanx fsbooks i will try that out :)


All times are GMT -5. The time now is 08:17 AM.