Click to See Complete Forum and Search --> : Detecting a reconnected cable


KWTm
09-25-2002, 01:31 PM
I am using RedHat 5.1 on my 486-33MHz with a cheap 3COM 3c509 ethernet card, which usually works well, connected to my cable modem with DHCP service. When RedHat boots, it finds the ethernet connection, and I am having loads of fun doing remote FTPing with Midnight Commander and surfing the web with Links.

However, if the ethernet cable is not connected when the machine boots up, I can't get it to recognize it if I plug in the cable afterward. I have one cable modem and two computers (the other is an Athlon 850 running Win2k), and can only plug in the cable to one computer at a time. Eventually I hope this will change, but in the meantime I want to leave my 486 on all the time and hook it up to the Internet when needed, rather than booting the cumbersome Win2k machine.

I even tried booting the 486 Linux box with the cable connected, and then (after having ensured a working Internet connection) unplugged the cable. After a while, RedHat 5.1 detects that I've unplugged the cable, and stops trying to use the ethernet connection. If I plug the cable back in, it doesn't work and I'm still not connected.

1. What do I do to tell Linux that the cable is back?

I've tried 'insmod 3c509', which tells me that my 3COM 509 card is working, but doesn't really help. (This shouldn't be necessary since my RedHat already recognizes 3c509 at bootup.)

I typed 'ifconfig eth0' (eth0 is where my ethernet card is), and it tells me that my IP address is 0.0.0.0, which really means that it's not working.

I typed 'dhcpcd'. The first time, it seemed to do something: "Setting eth0 Rx to 1 addresses" or something like that. That was before I connected the cable (I was just fooling around). So I connected the cable, and tried 'dhcpcd' again. This time it said, "Setting eth0 Rx to 0 addresses". More attempts to type 'dhcpcd' seemed to result in no response other than the root prompt coming back to me and saying, "Okay, so *now* what do you want to do?"

I thought perhaps dhcpcd ran in the background, so I did 'ps -a' but it didn't show any process with dhcpcd. I checked '/var/run/dhcpcd-pid' (or something like that) and it did list some number, like "157", so I went and typed 'kill 157', and Linux complained, "No such PID."

Any ideas?

Lorithar
09-25-2002, 05:47 PM
MOST network cards are smart enough to reset the link status of the card when a cable is plugged into them... *however* if the card *doesn't* manage this, unplugging the cable, then as root, from the command line
rmmod [modulename]
will unload the module from the system
then plug in the cable, and from the command line as root
modprobe -dv [modulename]
will reload it ..

Once you've done this you should be able to use (I'm not redhat so ... I *may* be wrong) pump to get it to pull a new IP address off the DHCP server.