Re: how to add flags to ifconfig at boot



On Thu, Sep 21, 2006 at 07:24:21AM -0700, Bill Schoolcraft wrote:
--- David Kelly <dkelly@xxxxxxxxxx> wrote:

True only if your options for ifconfig in rc.conf would clear or
override whatever it is you put in /etc/start_if_em0. As long as its
something that can be done with multiple ifconfigs then all is fine.

For example this works fine in /etc/start_if.xl0:

#!/bin/sh
ifconfig xl0 lladdr 00:01:23:45:67:89

with this in rc.conf:
ifconfig_xl0="DHCP"

Thank you very much for the above info David, I've always been
challenged with my (encrypted) wireless card though, and usually have
my own manual script that I run. Always wanted to have it start
"automagically" when/if it is the card I'm using.

(question)

Besides the single line you have in /etc/rc.conf above to instruct DHCP
to be used, can one place all the following somehow in rc.conf or will
I have to get this going in a script location?

Currently I give my card a static ip but would like to have it grab
it's ipaddr by DHCP, here is the majority of the script, omitted are
my ping tests of the gateway at the end.

The reason you do not put a script such as you describe within rc.conf
is that rc.conf is widely sourced as part of other scripts. As such, its
run many times, not just once at boot.

I think you should be able to remove the ifconfig setting static IP
address, and the "route add" from your script, name the script
if_start.wi0, and add "ifconfig_wi0='DHCP'" to rc.conf and be in
business (assuming your wireless access point serves DHCP).

Thats the whole point of start_if.<if_name>, to do things such as change
MAC addresses, set WEP keys, etc. Things which lack formal support in
rc.conf.

--
David Kelly N4HHE, dkelly@xxxxxxxxxx
========================================================================
Whom computers would destroy, they must first drive mad.
_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: remote ip configuration
    ... > I'm trying to write a script that would allow me to completely control Local ... > configuration on the target workstation (it can be seen from its Local Area ... I use this to set DHCP and obtain DNS servers. ...
    (microsoft.public.scripting.wsh)
  • Re: Change computer dns to automatic
    ... you can use the script below to change all IP-settings to DHCP on the ... Dim wmiRoot, wmiQuery ... I am using DHCP for my ... >I am looking for a way to change all the dns configuration on all the XP ...
    (microsoft.public.windows.server.scripting)
  • DLINK 614+, script injection vulnerability
    ... TYPE: Script injection over DHCP ... to change the administrator password (doesn't require his current ...
    (Bugtraq)
  • Re: Enable DHCP using GP...?
    ... You can assign a startup script via GPO to the computer objects that will ... netsh interface ip set WINS "Local Area Connection" dhcp ...
    (microsoft.public.win2000.group_policy)
  • Re: DHCP and VBScripting
    ... I just tried to run my script on a mchine after installing the DHCP COm ... after the install, fo some reason it doesn't do this as part of the ... strText = objExec.StdOut.ReadLine ...
    (microsoft.public.scripting.vbscript)