Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Nov 2003 12:21:45 -0800
From:      Kevin Stevens <kevin_stevens@pursued-with.net>
To:        Jamie <jamie@gnulife.org>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Fastest way to change IP addresses
Message-ID:  <553B01E2-17A9-11D8-A904-000A95D7C3C6@pursued-with.net>
In-Reply-To: <20031115132923.J5131-100000@floyd.gnulife.org>
References:  <20031115132923.J5131-100000@floyd.gnulife.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On Nov 15, 2003, at 11:35, Jamie wrote:

>    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??

That *is* the elegant way.  You want a more expedient way.

>   In order to switch to 200.80.11.8 I've tried:
>
> 1) ifconfig de0 200.80.11.8 255.255.255.0
>
>   ifconfig -a then gives me:
>
>   fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> 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

That is not the correct broadcast address for that network...


>   But then I cannot ping the gateway,
>
>    ping 200.80.11.1
>
>   5 Packets transmitted, 0 packets received 100% packet loss

It should work.  Two thoughts:

If you've been bouncing around between addresses while testing, you may 
have confused the arp cache on the gateway device, which would need to 
be flushed or time out before speaking to you again.

When you make the IP change directly, it's then incumbent on you to 
also make any appropriate routing updates - this is handled 
automatically during boot by the rc.conf procedure.  Since you're 
changing addresses within the same subnet it shouldn't be a major deal 
(you shouldn't be attempting to route), but it should be checked 
anyway.  netstat -nr.

KeS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?553B01E2-17A9-11D8-A904-000A95D7C3C6>