Re: how to add flags to ifconfig at boot

2006-09-21 Thread Bill Schoolcraft
--- David Kelly [EMAIL PROTECTED] wrote:

 On Mon, Sep 18, 2006 at 12:38:30PM -0400, Robert Huff wrote:
  
  David Kelly writes:
  
Or if one needs to ifconfig earlier in the startup process then
 put
one's script in /etc/start_if.em0
  
  It is my understanding (and experience) this only works when
  
  ifconfig_em0=
  
  in /etc/rc.conf.
 
 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
 
 -- 
 David Kelly N4HHE, [EMAIL PROTECTED]

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.

TIA
#

#!/bin/sh
ifconfig wi0 ssid nwname
ifconfig wi0 wepmode on
ifconfig wi0 192.168.1.222 broadcast 192.168.1.255 netmask
255.255.255.0
ifconfig wi0 up
wicontrol wi0 wepkey 0x1465466964
route add default 192.168.1.1

#




___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: how to add flags to ifconfig at boot

2006-09-21 Thread David Kelly
On Thu, Sep 21, 2006 at 07:24:21AM -0700, Bill Schoolcraft wrote:
 --- David Kelly [EMAIL PROTECTED] 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, [EMAIL PROTECTED]

Whom computers would destroy, they must first drive mad.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: how to add flags to ifconfig at boot

2006-09-18 Thread Lowell Gilbert
Per olof Ljungmark [EMAIL PROTECTED] writes:

 How can I add flags to ifconfig at boot time, i.e. I want it to start
 with 'ifconfig em0 -tso' ?

Add the flag to the ifconfig_em0 line in rc.conf(5).
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: how to add flags to ifconfig at boot

2006-09-18 Thread David Kelly
On Mon, Sep 18, 2006 at 10:04:18AM -0400, Lowell Gilbert wrote:
 Per olof Ljungmark [EMAIL PROTECTED] writes:
 
  How can I add flags to ifconfig at boot time, i.e. I want it to start
  with 'ifconfig em0 -tso' ?
 
 Add the flag to the ifconfig_em0 line in rc.conf(5).

Or if one needs to ifconfig earlier in the startup process then put
one's script in /etc/start_if.em0

I don't know what -tso does, but the start_if thing comes in very handy
if one changes the MAC address on a NIC, say, for cable modem use
without bothering one's ISP tech support. Also for setting the MAC
address at boot before dhclient starts.

-- 
David Kelly N4HHE, [EMAIL PROTECTED]

Whom computers would destroy, they must first drive mad.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: how to add flags to ifconfig at boot

2006-09-18 Thread Robert Huff

David Kelly writes:

  Or if one needs to ifconfig earlier in the startup process then put
  one's script in /etc/start_if.em0

It is my understanding (and experience) this only works when

ifconfig_em0=

in /etc/rc.conf.



Robert Huff
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: how to add flags to ifconfig at boot

2006-09-18 Thread David Kelly
On Mon, Sep 18, 2006 at 12:38:30PM -0400, Robert Huff wrote:
 
 David Kelly writes:
 
   Or if one needs to ifconfig earlier in the startup process then put
   one's script in /etc/start_if.em0
 
   It is my understanding (and experience) this only works when
 
   ifconfig_em0=
 
   in /etc/rc.conf.

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

-- 
David Kelly N4HHE, [EMAIL PROTECTED]

Whom computers would destroy, they must first drive mad.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]