Fastest way to change IP addresses
Kevin Stevens
kevin_stevens at pursued-with.net
Tue Nov 18 14:27:31 PST 2003
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
More information about the freebsd-questions
mailing list