Reconnecting to the internet?
Hi, I have cable and somewhere in my startup internet detection is fine, but if I unplug my ethernet cable or get disconnected for whatever other reason, what's the command to reconnect? `ifconfig eth0 up` seemed to be the way to go, but that doesn't work. Thanks in advance.
|
how many eth devices do u have?
ensure that eth0 is the correct ethernet adapter. try also ifconfig eth0 down ifconfig eth0 0.0.0.0 ifconfig eth0 up let me know |
I have two eth devices, one for my wireless (which i haven't gotten to work yet), and one for my regular ethernet, which I'm pretty sure is on eth0
#ifconfig eth0 Link encap:Ethernet HWaddr 08:00:46:AC:F8:86 inet addr:192.168.2.10 Bcast:255.255.255.255 Mask:255.255.255.0 UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1130 errors:0 dropped:0 overruns:0 frame:0 TX packets:982 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:1195925 (1.1 Mb) TX bytes:122235 (119.3 Kb) Interrupt:9 Base address:0xb000 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:2 errors:0 dropped:0 overruns:0 frame:0 TX packets:2 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:100 (100.0 b) TX bytes:100 (100.0 b) |
Oh yeah, trying:
ifconfig eth0 down ifconfig eth0 0.0.0.0 ifconfig eth0 up didn't work. |
ifup eth0
interestingly...ur eth0 ifconfig seems to have a class C ip address....are y on a LAN or behind a router with dhcp or sumtin? |
a restart of the network service depending on ur setup may also be a feasible idea
# service network restart |
Yeah, I'm behind a router - I'm using slackware and bash is telling me that it can't find the command 'service'
|
hmmm....run a locate on service...
hmmmm....try /sbin/service ok...so ur surfing the web and then you unplug the ethernet cable that is connected to ur machine from the router...for some reason...and wehn u reconnect it the web doesn't work. eth0 i assume is on dhcp from the router...if so does it get an ip when it is reconnected? can u ping the router? |
nope, no service.....
The main reason I'm asking this question is not if I disconnect from the internet, but rather, if I start my laptop without being connected to the internet and plug in an ethernet cable later on I'd rather not have to restart the computer every time. And actually it does work if I disconnect and reconnect (at least if the interval is short enough, haven't tried it for longer periods of time) - it's just when I send the down command to ifconfig, and then try to restart it with up, it doesn't work. eth0 is on dhcp from the router - how do i check if it gets an ip when it's reconnected? Do I even get to the point where I'm reconnected? I'm pretty sure I can ping the router? |
hmmmm....i have to admit i'm not familiar with slackware but you shouldn't have to restart ur machine in such a trivial situation as cable disconnect.
the IP check can be done with the same ifconfig command ("ifconfig eth0").... do the ip check after putting the interface down.... and then again when u bring it back up holla back |
did you configure the nic to use DHCP? just a thought
|
Heh, I just started using 'switchto' and that fixed both my problems! Now I can connect to my wireless, and connect to my lan at whim. Thanks for all your help guys.
|
All times are GMT -5. The time now is 09:31 PM. |