How do I manually disconnect/reconnect DHCP DSL internet connection?
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
"ifconfig eth0 down" drops the net from my PC <===solved
"ifconfig eth0 up" does NOT reconnect me <===unsolved
The 'down' part is easy - if that didn't work there's something seriously wrong with your system (probably 'owned').
For the 'up' part, there can be any number of explanations. After bringing the interface down, use another computer to check the active leases. The router might be a bit - well - stupid.
From the dhclient manual:
<quote>
The client normally doesn't release the current lease as it is not
required by the DHCP protocol. Some cable ISPs require their clients
to notify the server if they wish to release an assigned IP address.
The -r flag explicitly releases the current lease, and once the lease
has been released, the client exits.
<\quote>
In such a case you may need to edit the "interfaces" file and add a "pre-down" statement which executes "dhclient -r eth0". Your router is not an ISP, but if it's a stupid router it may require you explicitly release the lease.
Don't waste time with the "inetd" thing - that will only shut down services which are started via inetd; all sevices which are run on their own rather than via inetd will still be up and running. You will also find that you're still connected to the internet regardless of what inetd is doing.
Bringing down your own interface (eth0) won't affect anyone else (unless you were acting as the router) so I don't know what that other poster is talking about when he says it will bring down everyone's connection.
For the 'up' part, there can be any number of explanations. After bringing the interface down, use another computer to check the active leases. The router might be a bit - well - stupid.
Yes... I probably have a very stupid router
Quote:
From the dhclient manual:
<quote>
The client normally doesn't release the current lease as it is not
required by the DHCP protocol. Some cable ISPs require their clients
to notify the server if they wish to release an assigned IP address.
The -r flag explicitly releases the current lease, and once the lease
has been released, the client exits.
<\quote>
In such a case you may need to edit the "interfaces" file and add a "pre-down" statement which executes "dhclient -r eth0". Your router is not an ISP, but if it's a stupid router it may require you explicitly release the lease.
Ok, so how do I go about fixing this? What file do I edit, and where?
Quote:
Don't waste time with the "inetd" thing - that will only shut down services which are started via inetd; all sevices which are run on their own rather than via inetd will still be up and running. You will also find that you're still connected to the internet regardless of what inetd is doing.
Yea, I'm done trying that - learned the hard way.
Quote:
Bringing down your own interface (eth0) won't affect anyone else (unless you were acting as the router) so I don't know what that other poster is talking about when he says it will bring down everyone's connection.
Good, glad to hear that. Thanks for clearing that up. I do not know how to set up my computer as a router for the other PC's, and I'm not sure it will be of any benefit.
FYI (to all posters): The rest of the family knows, that Microsoft's OS's days are numbered (on our home network), and that they will be converted to Linux or some other Unix-based OS (like Solaris or BSD).
Last edited by chaz_bro1972; 06-02-2008 at 09:57 PM.
Reason: Clarify
that will bring your network interfaces down , and
Quote:
#/etc/rc.d/rc.inet1 start
will bring them up.
now if you want to keep your computer connected to the netwrok excluding the internet
you have to remove the defautl gateway on your machine like some1 said befor by doing
Quote:
/sbin/route del default
if you want to have the internet connection back ofcourse we shuold put the gateway back by
Edit your /etc/network/interfaces file, find the stanza which controls eth0, then add a line like this under it:
pre-down /sbin/dhclient -r eth0
That's assuming that 'dhclient' is your dhcp client and that it's in /sbin/.
If you use a different dhcp client (pump, or others), you will need to read their manual pages to see how to relinquish the dhcp lease.
If you are manually disabling the network, you may need to manually request an IP for it to work again.
On various systems these commands work:
Quote:
pump
Quote:
dhclient
I would just set firewall rules that block all access to the other windows machines, so they can be as stuffed with viruses (as they like to be), and it not affect you one iota.
If that was the opposite of your intention, you could just drop your gateway..
Quote:
route del default gw IP.ADD.RE.SS eth0
This way, you can't access the internet, but are still connected to the LAN.. enabling you to communicate with the other hosts on your router. (which seems to be what you asked in the original post)
Of course, the easiest way to disconnect your machine.. is simply pull out your cable! (safest option for total security.. beat that wireless!)
No, I'm not. Our ISP is AT&T Yahoo DSL, and we cannot afford to get the static IP option.
Quote:
If you are manually disabling the network, you may need to manually request an IP for it to work again.
On various systems these commands work:
Code:
pump
Code:
dhclient
Thanks, I'll give those a try.
Quote:
I would just set firewall rules that block all access to the other windows machines, so they can be as stuffed with viruses (as they like to be), and it not affect you one iota.
Using both the built-in firewall (from the router) and Guarddog's firewall. I stay current on all my installed applications versions.
Quote:
If that was the opposite of your intention, you could just drop your gateway..
Code:
route del default gw IP.ADD.RE.SS eth0
This way, you can't access the internet, but are still connected to the LAN.. enabling you to communicate with the other hosts on your router. (which seems to be what you asked in the original post)
No, I guess I need to be clearer. My wife can drop her internet connection and then reconnect by clicking this one program. Now I know, this isn't winbloze. But Linux should be just as capable if not better. Linux can do anything Windblows can (except get itself into trouble), and Linux can do it better (IMHO).
Quote:
Of course, the easiest way to disconnect your machine.. is simply pull out your cable! (safest option for total security.. beat that wireless!)
[Sigh] I thought Linux should have this thing licked by now.
I tried that - seems my system doesn't have the interfaces manual.
Quote:
Edit your /etc/network/interfaces file, find the stanza which controls eth0, then add a line like this under it:
pre-down /sbin/dhclient -r eth0
No such file folder /etc/network.
Quote:
That's assuming that 'dhclient' is your dhcp client and that it's in /sbin/.
If you use a different dhcp client (pump, or others), you will need to read their manual pages to see how to relinquish the dhcp lease.
Yes, believe it or not there is such a file as /sbin/dhclient.
What hemi wrote "/etc/rc.d/rc.inet1 start" should be fine.
Didn't work. "/etc/rc.d/rc.inet1 stop" shut my internet connection down right, but bringing it back up with "/etc/rc.d/rc.inet1 start" failed miserably.
Quote:
Or you could type dhcpcd -d -t 10 eth0 to go back online.
Need to try this. I'll get back to you if this works.
OMG. You guys are awesome, with the amount of help. I just want to say thank you to everybody who has responded to this post sooooooo positively. I am grateful.
how to access the internet in backtrack 3. i can see the available networks but if i try to connect that,its showing connection failed.i am using the live cd.could somebody please reply me with some useful commands and information
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705
Rep:
Quote:
Originally Posted by chaz_bro1972
OMG. You guys are awesome, with the amount of help. I just want to say thank you to everybody who has responded to this post sooooooo positively. I am grateful.
You got a lot of people running other distros who tried to help you, but your answer came from Slackware people because that is the distro you are running. Most of those other distros put all kinds of their own customisations into the process but Slackware is known for doing things as simply and directly as possible. What works on RedHat Debian etc usually doesn't work on Slackware.
When you ask a question like this, look to see what people are running, and you can save yourself a lot of time.
Thank YOU for posting the solution. This helps other people who search for problems and solutions on Linuxquestions.org.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.