LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 03-16-2012, 10:59 AM   #1
leericlapton
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 9.181.137.143
netmask 255.255.255.0
interface eth0
default gw 9.181.137.1

Next, I want to chang the IP address to another subnet mask like this:
ip adderss 9.27.22.244
netmask 255.255.252.0
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, 11:32 AM   #2
Celyr
Member
 
Registered: Mar 2012
Location: Italy
Distribution: Slackware+Debian
Posts: 321

Rep: Reputation: 81
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, 12:18 PM   #3
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
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.
 
  


Reply

Tags
default route, ifconfig, maintainence, ssh



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

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

All times are GMT -5. The time now is 10:50 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