No, it isn't that hard...you could set up rc.conf to get a dynamic IP when the machine starts, and then you could write a startup script and place it in /usr/local/etc/rc.d that sleeps for however long you want the dynamic IP to be active, and then runs ifconfig to reconfigure your IP address to the static you want.

You'd want to set up your rc.conf to get the dhcp address at boot time...here are some of the default options...season to taste:

dhclient_program="/sbin/dhclient"       # Path to dhcp client program.
dhclient_flags=""               # Extra flags to pass to dhcp client.
#dhclient_flags_fxp0=""         # Extra dhclient flags for fxp0 only
background_dhclient="NO"        # Start dhcp client in the background.





-------------------------------------------------------------

  "Wherever you go, there you are!"

On Thu, 12 Feb 2009, Nikolaj Thygesen wrote:

Hi list,

I've been experimenting and googling for hours w/ no luck. All I want to do is run dhcp and then replace the ip address of the interface with a new static ip afterwards. I've been looking at the /etc/dhclient.conf man pages, but they don't seem to help. I can do it from rc.conf like:

  ifconfig_em0="inet 1.2.3.4"

but then I loose all the other dhcp parameters like dns and stuff. Is it really that hard???

  thanks - Nikolaj

_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to