LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How do I manually disconnect/reconnect DHCP DSL internet connection? (https://www.linuxquestions.org/questions/linux-networking-3/how-do-i-manually-disconnect-reconnect-dhcp-dsl-internet-connection-646364/)

chaz_bro1972 06-02-2008 05:26 AM

How do I manually disconnect/reconnect DHCP DSL internet connection?
 

Hi.

I am on a wired only home network with 3 other PC's. Of the three PC's, only one runs Linux full time: mine. Needless to say I am extremely worried about security for the entire network (that's why it's a wired connection as opposed to a wireless connection). If it is possible at all, I would like some way of disconnecting (and reconnecting) my PC from the internet connection, without disconnecting any wires from the router (ie. via software). Is this possible with Linux?

PS. Please do not turn this into a flame war on "why wireless internet is better," or "wireless internet is secure." I'm sticking with my wired connection, and that is that. Please stay on target with this thread. Thank you.

puntjuh 06-02-2008 05:34 AM

To deactivate your network card. Just type: ifconfig eth0 down

eth0 depends... DO:

ifconfig

to find out what nic's you have enabled, and which name they have. Then disable them.

pinniped 06-02-2008 05:39 AM

What distro?

On many distros (like Debian), you just get the root user to do:
ifdown eth0
ifup eth0

Worst case (this will work on all distros):
ifconfig eth0 down
ifconfig eth0 up

If you're really keen, you can probably hack an "ethernet on demand" program ...

Switching to 'root' all the time to bring the interface down and up is probably a bigger security threat than the internet. I'm sure a lot of us reading this post are wondering if you really know what you're doing. This isn't WinDuhs - if you're not running services, the only thing to worry about is phishing when using a web browser. Well, that and a fatal flaw in the Linux network drivers. Or a remotely exploitable flaw in the browser.

marsguy 06-02-2008 05:49 AM

I think that "chaz_bro1972" wants to disconnect his internet connection only, not the Whole ethernet connection.

am I correct "chaz_bro1972"?

Randux 06-02-2008 06:12 AM

What are you running on your other 2 PC's that you are only worried about the one running Linux part time? Slackware is more secure than winbloze any day.

Now for the obligatory: (wireless internet sucks! let the flames begin....!!!!)

chaz_bro1972 06-02-2008 07:36 AM

Quote:

Originally Posted by marsguy (Post 3171869)
I think that "chaz_bro1972" wants to disconnect his internet connection only, not the Whole ethernet connection.

am I correct "chaz_bro1972"?

Quite right, marsguy.

chaz_bro1972 06-02-2008 07:43 AM

Quote:

Originally Posted by Randux (Post 3171892)
What are you running on your other 2 PC's that you are only worried about the one running Linux part time? Slackware is more secure than winbloze any day.

Now for the obligatory: (wireless internet sucks! let the flames begin....!!!!)

The three PC's are running the following OS's:

1)My wife's PC: Win XP (even she doesn't want Vista - thank God!)
2)My daughter's PC: Dual-booting Win 2000 Pro & Slackware 12.0
3)My PC: Slackware 12.0 (tried 12.1, didn't work quite right on my old hardware)

I'm afraid that whatever bug the Windbloze PC's got might transfer over. Some geek at Microsoft might be writing a Linux virus. They probably write so many of their own viruses they definitely have the practice.

lsteacke 06-02-2008 07:45 AM

One of the perks of having a high bandwidth connection is that you don't have to disconnect and reconnect constantly when you want internet access. In this respect, there ways to mimic this functionality but they all basically involve disabling your network card, or stopping networking services on your box. As it was said before, bringing down your interface will do the trick.

Code:

ifdown eth0
or how about

Code:

etc/rc.d/rc.inetd stop

chaz_bro1972 06-02-2008 07:51 AM

Quote:

Originally Posted by lsteacke (Post 3171996)
One of the perks of having a high bandwidth connection is that you don't have to disconnect and reconnect constantly when you want internet access. In this respect, there ways to mimic this functionality but they all basically involve disabling your network card, or stopping networking services on your box. As it was said before, bringing down your interface will do the trick.

Code:

ifdown eth0
or how about

Code:

etc/rc.d/rc.inetd stop

Soooooo.... if this stops the access to the net for MY PC only:

Code:

etc/rc.d/rc.inetd stop
Does this bring it back?:

Code:

etc/rc.d/rc.inetd start

Tux-Slack 06-02-2008 08:26 AM

Or you could just bring down the gateway... this will disconnect you as well.

chaz_bro1972 06-02-2008 08:50 AM

"ifconfig eth0 down" disconnects me, but "ifconfig eth0 up" does not reconnect me. I can only reconnect after reboot. "etc/rc.d/rc.inetd stop" doesn't work at all, and "etc/rc.d/rc.inetd start" does not either.

Anymore suggestions?

chaz_bro1972 06-02-2008 08:53 AM

Quote:

Originally Posted by Tux-Slack (Post 3172041)
Or you could just bring down the gateway... this will disconnect you as well.

Interesting... How do I do this?

Tux-Slack 06-02-2008 08:55 AM

One thing I don't undestand tho.
Your computer acts as a router for the windows boxes?

ip route del default via gatewayIP dev eth0(may differ)
ip route add default via gatewayIP dev eth0(same as above)

if this is a router for your windows machines it will bring them down as well.

chaz_bro1972 06-02-2008 08:59 AM

Quote:

Originally Posted by Tux-Slack (Post 3172073)
One thing I don't undestand tho.
Your computer acts as a router for the windows boxes?

ip route del default via gatewayIP dev eth0(may differ)
ip route add default via gatewayIP dev eth0(same as above)

if this is a router for your windows machines it will bring them down as well.

Ummm? I don't think so. We are all connected to a physical wired router. The only thing we share is internet (as far as I know).

chaz_bro1972 06-02-2008 07:46 PM

Confirmed:

All the other PC's connected to the router are independent of each other. The DSL modem is attached to the router. The router's power comes from the power bar that my PC is also attached to, but my PC does not need to be turned on to allow the others internet access.

So, to clarify, the DSL modem is attached to the router, and the three PC's are attached to the router (via their own network card), giving the three PC's internet access. Isn't this way the right way to do it?

Let me ask again:

1) "ifconfig eth0 down" drops the net from my PC <===solved :)
2) "ifconfig eth0 up" does NOT reconnect me <===unsolved :(

Further help is still needed.


All times are GMT -5. The time now is 03:40 PM.