Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Feb 2009 14:36:59 -0600 (CST)
From:      Jamie <jamie@gnulife.org>
To:        Nikolaj Thygesen <mailinglist@diamondbox.dk>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: Assigning static ip address
Message-ID:  <alpine.BSF.2.00.0902121432250.77515@whiskey.ihavefire.com>
In-Reply-To: <49947FC4.4000400@diamondbox.dk>
References:  <49947FC4.4000400@diamondbox.dk>

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


    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-unsubscribe@freebsd.org"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.0902121432250.77515>