LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How do you reset internet connection in Linux? (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-you-reset-internet-connection-in-linux-4175456313/)

villandra 03-31-2013 09:13 PM

How do you reset internet connection in Linux?
 
My housemate has Linux. Today I unplugged his ethernet cable from the household router and plugged it directly into the modem, before shutting down all other computer equipment and leaving the house for the day. Severe storms were expected. The cable company owns the modem and readily replaces it, but I own the router.

My housemate promptly lost his internet connection for the day. His connection was restored when I plugged his cable back into the router, connected the router to the modem, and booted up the router.

I've done the same thing before and he did not lose his internet connection. I don't know if I rebooted the modem. It's the only thing that would have happened different.

Whenever I unplug my Windows computer from the router and connect the ethernet cable directly to the modem, the internet connection won't work until I enter the Netshell command in a command prompt window. It is unclear whether Roadrunner ISP deliberately corrupts your TCP/ IP stack to prevent connecting computers to their network, or the router does that, though I've had the problem with more than one brand of router.

Is there a similar procedure for Linux?

I've searched on the Internet, and found convoluted and seemingly nonresponsive theories, answers that pertain to something different, and answers that pertain to some different operating system like Ubantu. I've seen advanced discussions about what some OTHER procedure is.

The only thing that will make sense to me is the simple command or commands to reset TCP in Linux.

The solution must NOT reset all of my housemate's OTHER computer settings or whatever to their default whatever. ONLY the Internet connection.

Thank you.

Yours,
Dora

malekmustaq 03-31-2013 11:14 PM

Quote:

The solution must NOT reset all of my housemate's OTHER computer settings or whatever to their default whatever. ONLY the Internet connection.
If you mean the TCP connection within one system there are many ways of doing that:

1. Manipulating it from the scripts /etc/rc.d/init.d (whatever is found therein) just look for something like "networkmanager" or "inet", cd into that folder (must be root user) then enter that script as command, e. g.--
Code:

--# cd /etc/init.d
--# networkmanager force-restart

you can examine what semantic your script is using by
Code:

--# cat "scriptname"
then look for some loop header like "start", "restart", "reload", or "force-restart".

2. Manipulating it from the ifconfig command may do sometimes--
Code:

--# ifconfig eth0 down
--# ifconfig eth0 up

the IP connection will stop and then try to reconnect. If your interface is named "eth1" or another you many use it accordingly. You will find out what name it uses by querying the interface:
Code:

--# ifconfig -a
3. Manipulating it from the level scripts (this is quite an overkill and longer process, however this will sure render the same service you needed. Under most Gnu/Linux the network daemon initiates at runlevel 3, so you can pass across that level by switching to 1 and 4 (or 5 whatever your system uses).
Code:

--# init 1 <Enter>
(this shuts down the X and network processes and enters single user mode, you login as root there and from there issue the following similar command)

Code:

--# init 4 <Enter>
(this returns to X login with fresh network and TCP/IP connections)

4. Manipulating it from the process
Code:

--# ps axu | grep inetd
(get the process ID # of the inetd)
--# kill HUP xxxx

(xxxx is the process ID number; Note: I believe this only tends to redefine the connection without altering anything from the interface so this may not give you what you wanted as far as I understood from above, but you may try, there's no harm.)
,
/*The following shall affect all other systems connected to the modem. */

5. Manipulating from the ISP side. The modem provided by the ISP usually has a sunked-in button at the back of the modem for resetting. Use a ballpen point or a sharp pencil to push the button for 8 seconds then release. Note: this will re-initiate all connections using the modem.

Hope that helps.

Good luck.

evo2 03-31-2013 11:19 PM

Hi,

here I'm assuming that both the router and the modem are running standard dhcp servers (otherwise you need to provide more information about your network).

You may need to take the connection down and bring it back up again on the Linux box. The best way do this will depend on the distro that your housemate is running. It may be enough to disconnect and reconnect the ethernet cable where it plugs into the machine after you do the swap at the router/modem end.

Evo2.

chrism01 04-01-2013 08:35 PM

For some systems
Code:

service network restart

michaelk 04-01-2013 08:58 PM

Welcome to LinuxQuestions.

Typically cable ISPs home service only provides one dynamic IP address based upon the MAC address of the connected device which is stored in the MODEMs memory. In order for the computer to connect to the internet when it is directly connected to the MODEM instead of the router you must cycle its (the MODEM) power. And as stated you might need to restart the linux computers network service.

lucky9 04-02-2013 12:05 AM

Do the smart thing and buy an inexpensive surge protector. Better yet a battery backup unit.

The correct topology is, wall plug to surge protector (or battery backup) to modem to router to computers.

As far as a restart is concerned it should only take a power-down and start if everything is plugged in. Make sure that the computers are plugged into the same router port. It makes it easier sometimes.

evo2 04-02-2013 12:10 AM

Hi,
Quote:

Originally Posted by lucky9 (Post 4923210)
As far as a restart is concerned it should only take a power-down and start if everything is plugged in.

WTF?! Rebooting may be the answer to most questions in the windows world, but the OP is looking for a real answer.

Evo2.


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