LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How to maintain the SSH connection when I want to change default route (http://www.linuxquestions.org/questions/linux-networking-3/how-to-maintain-the-ssh-connection-when-i-want-to-change-default-route-934798/)

leericlapton 03-16-2012 10:59 AM

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

Celyr 03-16-2012 11:32 AM

I tried on a box a couple of possible solutions but they didn't work.
I think it isn't possible :/

Reuti 03-17-2012 12:18 PM

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.


All times are GMT -5. The time now is 05:47 PM.