LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Yoper (https://www.linuxquestions.org/questions/yoper-57/)
-   -   eth0 back up but no connection (https://www.linuxquestions.org/questions/yoper-57/eth0-back-up-but-no-connection-252994/)

jasmith 11-09-2004 07:10 PM

eth0 back up but no connection
 
On bootup it automatically connects but when I do ifconfig eth0 down and bring it back up with ifconfig eth0 up, I can't connect to anything. Any ideas out there?
Thanx

peter_robb 11-10-2004 11:13 AM

ifconfig needs to be given some extra parameters, eg at least an ip number..

Try using ifup eth0 and ifdown eth0 instead..


jasmith 11-10-2004 01:40 PM

it says that the command ifdown or ifup is not found. do i have to set a path for it?

ralvez 11-10-2004 02:04 PM

well, try this:
ifconfig eth0 up (or /sbin/ifconfig eth0 up)


R

jasmith 11-10-2004 02:16 PM

Re: eth0 back up but no connection
 
Quote:

Originally posted by jasmith
On bootup it automatically connects but when I do ifconfig eth0 down and bring it back up with ifconfig eth0 up, I can't connect to anything. Any ideas out there?
Thanx

That is what i did.
ifconfig eth0 up.

ralvez 11-10-2004 02:37 PM

You did not read my posting carefully enough ;-)
See I also indicated /sbin/ifconfig eth0 up
Try that.
Failing that also try this
<code>
whereis ifconfig
</code>
to find the path to the program

R

jasmith 11-10-2004 02:57 PM

Quote:

Originally posted by ralvez
You did not read my posting carefully enough ;-)
See I also indicated /sbin/ifconfig eth0 up
Try that.
Failing that also try this
<code>
whereis ifconfig
</code>
to find the path to the program

R

The problem is not with finding ifconfig. I can run it and it will show the interfaces. The problem is that when I pull down eth0 and bring it up again there is no connection to the internet which i had at bootup.
Sorry if I didn't communicate my problem clearly.

ralvez 11-10-2004 03:42 PM

OK, I understand now.
After you bring the interface up does it have an address? To make sure it does run /sbin/ifconfig (no parameters).
If it does assing a gateway to the internet pointing to the machine that is the inernet gateway like this:
route add default gw <address of the gateway> ethX
where X is the inteface of the gateway.

That should get you connected.

Hope this helps.

R.

jasmith 11-10-2004 04:39 PM

Thanks. Do you know how to auotomatically detect the gateway for use on other lans sorta how it does it at boot time?

ralvez 11-10-2004 08:19 PM

Well as far as I know it is done by a script. I use Slackware and I have a small network; therefore, I do not use DHCP and I have a static IP for each machine. With that, then, I have a specific address for the gw.
If you set up your system to run on DHCP I believe it should do it for you. Enabling your system on DHCP depends a bit on your distro, and if you are using something like Mandrake or SuSE it's very easy; other distros could be a bit more involed.
Hoe this helps.

R.

postal26 12-01-2004 10:16 PM

ifdown and ifup = debian
 
ifdown and ifup is for debian bud =)

I have the same issue after ifconfig eth0 down. I've gotta reboot to get a connection to the n3t

ralvez 12-02-2004 08:56 PM

Just a thought ... do you have your /etc/hosts file set up?
It should have something like:
127.0.0.1 localhost # that is the loopback
192.168.1.1 it2web it2web # this is the gateway
192.168.1.2 spitfire spitfire # this is a computer in the network

So when you get the eth0 up it does know its ip.

HOpe this helps.

Rick

postal26 12-06-2004 01:28 PM

Still no luck. Guess i'll just have to kill dhcpcd and restart it!

Thanks for trying rick.


All times are GMT -5. The time now is 06:20 PM.