On Thu, Feb 28, 2013 at 05:48:02AM +0100, Jarry wrote: > Hi Gentoo users, > > what is the proper way of changing static IP-address remotely > without the need to restart the whole system (or locking > me out)? > > I have one interface with static IP, so first I'm going to edit > /etc/conf.d/net. Then I will set up command for later execution: > > # echo '#!/bin/bash' > /root/eth-restart > # echo '/etc/init.d/net.eth0 restart' >> /root/eth-restart > # chmod 0700 /root/eth-restart > # at -f /root/eth-restart now + 5 min > > Then I terminate my ssh-session hoping 5 minutes later > I can connect using new IP. Is this correct and all that > is necessary? > > Jarry > --
I think that is correct but not necessary. just using a temporary IP address. assume your remote host network interface is eth0, the original IP is addr1, the last IP is addr2, the temporary IP is addr3. You can start a ssh session to addr1, and bind a temporary IP to the interface using: # ifconfig eth0:0 addr3 then terminate the ssh session, start a new session to addr3. changing the eth0's IP address to addr2 finally, you can start a ssh session to the last IP address *addr2* and release the temporary IP. # ifconfig eth0:0 down