LinuxQuestions.org
Help answer threads with 0 replies.
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 09-18-2014, 04:46 AM   #1
pettha
LQ Newbie
 
Registered: Sep 2014
Location: Stockholm
Posts: 3

Rep: Reputation: Disabled
Unhappy why does "route del default eth0" break current ssh connection, sometimes?


Hi everyone.

I have two equal linux machines (hw1 and hw2), running Linux 3.2.0 armv7l GNU/Linux. They are behind two different cable modems/firewalls.

If I ssh into hw1 and executes "route del default eth0", I can continue to work in the ssh session/terminal window. I can't (of course perhaps) make any new outgoing connections from the terminal window, but I don't get disconnected. (The reason for me to doing the "route del default eth0" is to afterwards be able to add ppp0 (wireless) as default gw.)

But, if I ssh into hw2 and do the same, "route del default eth0", the ssh session/terminal windows gets instantly disconnected... Why is that?

Output from netstat and netstat -r are given below.
(I have obscured the foreign address for hw2 as it points to an address in the ”real” world.)

netstat:
======
hw1:
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 192.168.1.57:ssh 192.168.1.1:56980 ESTABLISHED
tcp 0 0 192.168.1.57:ssh 192.168.1.1:56721 ESTABLISHED

hw2:
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 192.168.0.53:ssh 217.xxx.yyy.zzz:56982 ESTABLISHED
tcp 0 208 192.168.0.53:ssh 217.xxx.yyy.zzz:56928 ESTABLISHED

netstat -r:
=======
hw1:
Destination Gateway Genmask Flags MSS Window irtt Iface
default router.asus.com 0.0.0.0 UG 0 0 0 eth0
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0

hw2:
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
default 192.168.0.200 0.0.0.0 UG 0 0 0 eth0
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0


Thanks!


(I have another thread ongoing,

"ssh session "disconnects" after "route add default ppp0", any suggestion?"

http://www.linuxquestions.org/questi...on-4175518365/

but I haven't come further with that one, so I try to narrow down the problem in this thread to come closer to a solution...)
 
Old 09-18-2014, 11:53 AM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
They are on different subnets (192.168.0.0/24 and 192.168.1.0/24). Your source machine must be on the same subnet as hw1. When you break the default route, traffic on the same subnet still knows where to go.
 
  


Reply

Tags
eth0, ppp0, routing


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
ssh session "disconnects" after "route add default ppp0", any suggestion? pettha Linux - Networking 2 09-15-2014 05:38 AM
Where should I configure the default gateway, "ifcfg-eth0" or "network"? huntkey Linux - Server 5 01-05-2009 10:41 AM
Hardy won't startup, stops with a "fail" and I have to "ctrl+alt+del" to boot. brjoon1021 Ubuntu 10 12-15-2008 07:29 PM
net working eth0 eth1 wlan0 "no connection" "no LAN" "no wi-fi" Cayitano Linux - Newbie 5 12-09-2007 08:11 PM
Route to subnet exists but I get "Network unreachable" when adding default route fciuffani Linux - Networking 4 08-18-2004 03:11 PM

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

All times are GMT -5. The time now is 07:53 AM.

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