Assigning static ip address
Jamie
jamie at gnulife.org
Thu Feb 12 17:52:56 PST 2009
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 at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
>
More information about the freebsd-questions
mailing list