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


  Search this Thread
Old 03-16-2012, 11:59 AM   #1
LQ Newbie
Registered: Oct 2011
Posts: 2

Rep: Reputation: Disabled
Thumbs up How to maintain the SSH connection when I want to change default route

Dear all

Right now, the senario as following:
Ip address
interface eth0
default gw

Next, I want to chang the IP address to another subnet mask like this:
ip adderss
interfce eth0

But when I run script "ifconfig " to modify the ip address, then the default route will lose because of the sumnetmask changed.

So my question is how to maintain the ssh connection while I want to change the default route in linux? Do you think it is possible to maintain it from the technique? That is urgent and thank you for any response or suggestion
Old 03-16-2012, 12:32 PM   #2
Registered: Mar 2012
Location: Italy
Distribution: Slackware+Debian
Posts: 321

Rep: Reputation: 80
I tried on a box a couple of possible solutions but they didn't work.
I think it isn't possible :/
Old 03-17-2012, 01:18 PM   #3
Senior Member
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 13.1
Posts: 1,329

Rep: Reputation: 254Reputation: 254Reputation: 254
With the new address you have no new gateway again? You will need one which you can reach locally.

Do you want to keep a session open or a tunnel? You can look into screen to reconnect a session and/or autossh tools.


default route, ifconfig, maintainence, ssh

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
Change default route metric MikeyCarter Linux - Networking 1 09-10-2011 09:47 AM
Default route is set as on DSL connection and have to delete it everytime DJ Shaji Linux - Networking 1 08-10-2011 01:51 PM
ssh connection forces password change, then closes connection loadedmind Linux - Newbie 2 02-16-2011 02:24 PM
Quagga default route not showing in kernel default route (netstat -nr) Valkyr1e Linux - Networking 3 08-03-2008 10:20 PM
How to change default Route? suncloud Linux - Networking 2 11-21-2003 06:17 AM > Forums > Linux Forums > Linux - Networking

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

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