From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 31681198005 for ; Thu, 28 Feb 2013 06:08:18 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F2DF1E07AF; Thu, 28 Feb 2013 06:08:04 +0000 (UTC) Received: from mail-da0-f54.google.com (mail-da0-f54.google.com [209.85.210.54]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8A68BE06F4 for ; Thu, 28 Feb 2013 06:08:03 +0000 (UTC) Received: by mail-da0-f54.google.com with SMTP id p1so687912dad.41 for ; Wed, 27 Feb 2013 22:08:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:date:from:to:subject:message-id:mail-followup-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=59SR6mAuTFEd7naXfL2BvrNp8CcHoomyergojuGHdmM=; b=aXF3mBjap1Bwp1l61rRMrp6fTr+VPUDtNI1sUVey/wAaBLqUky544Y14q+Zn3uqSW0 6uXM4jnaHwfG5s5cxIA+Bm6xWVrBbEtp/kqrF9kFRN6DVVUcCI8uHbZ+8WWzfoZlHaKs 8K2bFi/thQhiIdRWLp0v9H8CPdpBobmFA1gcdFMGaWQN0gII+/xplo7gP6psNb9nNC/l lB8Lol5SqoBiqxpFkN3Jb4C3w53oROjqlYfXlGn+G2VZOAAQP+8mCm1Il9Ff+UG1TzmS lUeIL554Yt0onF/ZFDjLvrAeCoQM1V4yNDUYlilAiXCaGPn+mxwdFy7PL1z+9SLwNRd7 1Qeg== X-Received: by 10.68.134.133 with SMTP id pk5mr1976183pbb.209.1362031682468; Wed, 27 Feb 2013 22:08:02 -0800 (PST) Received: from localhost ([113.66.122.54]) by mx.google.com with ESMTPS id pp1sm4698597pac.7.2013.02.27.22.07.58 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 27 Feb 2013 22:08:00 -0800 (PST) Date: Thu, 28 Feb 2013 14:07:47 +0800 From: Amankwah To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Changing static IP remotely... Message-ID: <20130228060747.GA2762@Crystal> Mail-Followup-To: gentoo-user@lists.gentoo.org References: <512EE182.7030209@gmail.com> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <512EE182.7030209@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Archives-Salt: 7712e1ed-af72-4698-b5b1-8f26e4b24140 X-Archives-Hash: 995579f4e50fa0da62a915412d460faa 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