From owner-freebsd-questions@FreeBSD.ORG Sat Nov 15 12:12:40 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1038516A4CE for ; Sat, 15 Nov 2003 12:12:40 -0800 (PST) Received: from smtp.infracaninophile.co.uk (ns0.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id E680F43FE1 for ; Sat, 15 Nov 2003 12:12:36 -0800 (PST) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [127.0.0.1]) hAFKCSBg073800 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 15 Nov 2003 20:12:30 GMT (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)id hAFKCSU6073799; Sat, 15 Nov 2003 20:12:28 GMT (envelope-from matthew) Date: Sat, 15 Nov 2003 20:12:28 +0000 From: Matthew Seaman To: Jamie Message-ID: <20031115201228.GA73634@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , Jamie , freebsd-questions@freebsd.org References: <20031115132923.J5131-100000@floyd.gnulife.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="oyUTqETQ0mS9luUI" Content-Disposition: inline In-Reply-To: <20031115132923.J5131-100000@floyd.gnulife.org> User-Agent: Mutt/1.5.5.1i X-Spam-Status: No, hits=-4.9 required=5.0 tests=BAYES_00 autolearn=ham version=2.60 X-Spam-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on happy-idiot-talk.infracaninophile.co.uk cc: freebsd-questions@freebsd.org Subject: Re: Fastest way to change IP addresses X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Nov 2003 20:12:40 -0000 --oyUTqETQ0mS9luUI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 15, 2003 at 01:35:52PM -0600, Jamie wrote: >=20 >=20 >=20 >=20 >=20 > I want to change the IP address from 200.80.11.7 to 200.80.11.8 > on a FreeBSD machine as quickly as possible. Despite my efforts, I can > only get the change to work by editing rc.conf and rebooting the machine. > Isn't there a more elegant way?? The man page for ifconfig seems to cover > changing IP ALIASES, but not the primary IP of an interface. >=20 >=20 >=20 > In order to switch to 200.80.11.8 I've tried: >=20 > 1) ifconfig de0 200.80.11.8 255.255.255.0 >=20 > ifconfig -a then gives me: >=20 > fxp0: flags=3D8843 mtu 1500 > inet 200.80.11.8 netmask 0xffffff00 broadcast 200.88.11.255 > ether 00:03:47:b1:d6:1c > media: 10BaseT/UTP status: active >=20 >=20 >=20 > But then I cannot ping the gateway, Yes -- you're doing everything right in order to change the IP number. Except that you seem confused as to whether the network interface is de0 or fxp0 -- I assume that's just a flub in your e-mail, and not what you've actually done... If it isn't that, then the problem may lie within your network gear. This may have cached the MAC address belonging to your machine as associated with first IP number and is getting confused by the renumbering. If you wait for a while it should eventually sort itself out. How long you have to wait depends on a number of things including the make of routers and switches -- it could be as long as 20 minutes. One way that you might get round this problem would be to add the new address as an alias: # ifconfig de0 inet 200.80.11.8 netmask 0xffffffff alias In theory you could then go on to swap the netmasks for the two addresses, thus making the second one the primary address, and then delete the first address. Possibly with some sort of delay between each operation to let verything adjust. But no guarrantees that will work. You'll have to experiment. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK --oyUTqETQ0mS9luUI Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/toisdtESqEQa7a0RAgRxAJ971/cbwMiTiP+Xj9P4Ui5XCR1QngCff5a2 W0k/9BWahWECUezNyAYKcOU= =E0eY -----END PGP SIGNATURE----- --oyUTqETQ0mS9luUI--