LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-02-2008, 08:08 PM   #16
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50

"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.
 
Old 06-02-2008, 09:52 PM   #17
chaz_bro1972
Member
 
Registered: Jul 2006
Location: Oklahoma, USA
Distribution: Slackware64-Current, Multilib
Posts: 242

Original Poster
Rep: Reputation: 27
Quote:
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
 
Old 06-02-2008, 10:16 PM   #18
hemi_426
Member
 
Registered: Apr 2008
Location: KSA-jeddah
Distribution: CentOS, gentoo, slackware
Posts: 80

Rep: Reputation: 15
hi

on slackware there is a rc.d/rc.inet1 file

anyway by doing
Quote:
#/etc/rc.d/rc.inet1 stop
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
Quote:
#/sbin/route add default gw <your router IP>
i hope that is usefull
thanks
 
Old 06-02-2008, 10:21 PM   #19
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
See 'man 5 interfaces'

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.
 
Old 06-03-2008, 04:00 AM   #20
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
What hemi wrote "/etc/rc.d/rc.inet1 start" should be fine. Or you could type dhcpcd -d -t 10 eth0 to go back online.
 
Old 06-03-2008, 04:28 AM   #21
grizly
Member
 
Registered: Nov 2006
Location: Melbourne Australia
Distribution: Centos, RHEL, Debian, Ubuntu, Mint
Posts: 128

Rep: Reputation: 16
Are you using a static IP?

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!)
 
Old 06-03-2008, 04:39 AM   #22
Tux-Slack
Member
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware 13.37
Posts: 511

Rep: Reputation: 37
Quote:
Originally Posted by hemi_426 View Post
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
Thought default GW brings everything down. o.O

Last edited by Tux-Slack; 06-03-2008 at 04:41 AM.
 
Old 06-03-2008, 11:51 AM   #23
hasanatizaz
Member
 
Registered: Nov 2007
Location: Pakistan
Distribution: Redhat and Debian
Posts: 317
Blog Entries: 1

Rep: Reputation: 35
try "ifup eth0" for bring up the interface
ifdown eth0 for bring down the interface.

Last edited by hasanatizaz; 06-03-2008 at 11:52 AM.
 
Old 06-03-2008, 05:19 PM   #24
chaz_bro1972
Member
 
Registered: Jul 2006
Location: Oklahoma, USA
Distribution: Slackware64-Current, Multilib
Posts: 242

Original Poster
Rep: Reputation: 27
Quote:
Originally Posted by grizly View Post
Are you using a static IP?
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.
 
Old 06-03-2008, 05:26 PM   #25
chaz_bro1972
Member
 
Registered: Jul 2006
Location: Oklahoma, USA
Distribution: Slackware64-Current, Multilib
Posts: 242

Original Poster
Rep: Reputation: 27
Quote:
Originally Posted by pinniped View Post
See 'man 5 interfaces'
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.
 
Old 06-03-2008, 05:31 PM   #26
chaz_bro1972
Member
 
Registered: Jul 2006
Location: Oklahoma, USA
Distribution: Slackware64-Current, Multilib
Posts: 242

Original Poster
Rep: Reputation: 27
Quote:
Originally Posted by Randux View Post
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.
 
Old 06-03-2008, 05:33 PM   #27
chaz_bro1972
Member
 
Registered: Jul 2006
Location: Oklahoma, USA
Distribution: Slackware64-Current, Multilib
Posts: 242

Original Poster
Rep: Reputation: 27
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.
 
Old 06-03-2008, 05:45 PM   #28
chaz_bro1972
Member
 
Registered: Jul 2006
Location: Oklahoma, USA
Distribution: Slackware64-Current, Multilib
Posts: 242

Original Poster
Rep: Reputation: 27
Thumbs up Problem Solved!!!

Quote:
Originally Posted by Randux View Post
Or you could type dhcpcd -d -t 10 eth0 to go back online.
Code:
$ifconfig eth0 down ##drops internet
Solved!
Code:
$ifconfig eth0 up ##reconnects internet
$dhcpcd -d -t 10 eth0 ## resets dhcp
Solved!


THANK YOU ALL! Together you helped me accomplish this. I couldn't have done these things without you.

Last edited by chaz_bro1972; 06-03-2008 at 05:47 PM.
 
Old 06-03-2008, 06:06 PM   #29
gadde_vamsi83
LQ Newbie
 
Registered: Jun 2008
Posts: 1

Rep: Reputation: 0
internet access in backtrack 3

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
 
Old 06-04-2008, 02:21 AM   #30
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
Quote:
Originally Posted by chaz_bro1972 View Post
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.

Welcome to the Slackware community!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
USB Keybooard/Mouse disconnect/reconnect issue (Genius TwinTouch Optical Office) 2Pacalypse Linux - Hardware 0 09-22-2007 05:06 AM
Disconnect an Windows internet connection taro83 Linux - Networking 10 04-09-2007 10:29 AM
Mount / unmount / ejecting CD/DVD makes LAN disconnect & reconnect...! GrapefruiTgirl Slackware 9 03-06-2007 10:48 PM
Internet connection drops how to reconnect a file transfer jspsandhu Linux - Networking 2 06-21-2005 04:43 PM
Can't reconnect internet when connection has lost Mikessu *BSD 1 06-18-2004 06:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration