in FreeBSD ifconfig cannot setup and configure interface with some extra parameters
example: ifconfig xl0 inet 192.168.1.1/24 ether aa:bb:cc:dd:..... will lead to error
correct way:
ifconfig xl0 inet 192.168.1.1/24
in rc.conf
AND additional interface configure in
/etc/start_if.xl0
ifconfig xl0 ether ether aa:bb:cc:dd:.....
patch:
--- newsvn/etc/rc.d/rcconf.sh.orig 2009-11-12 17:10:55.000000000 +0000
+++ newsvn/etc/rc.d/rcconf.sh 2009-11-02 16:32:19.000000000 +0000
@@ -72,7 +72,6 @@
-i "wakeon[. = 'off']" -o " -wol " -b \
-i "count(polling) > 0" -o " polling" -b \
-i "string-length(mtu) > 0" -v "concat(' mtu ',mtu)" -b \
- -i "string-length(extraoptions) > 0" -v "concat(' ',extraoptions)" -b \
-m "wireless" \
-v "concat(' ssid ',ssid,' channel ',channel)" \
-i "string-length(standard) > 0" -v "concat(' mode ',standard)" -b \
@@ -98,10 +97,22 @@
-b \
${configxml_file} | /usr/local/bin/xml unesc`
${configxml_file} | /usr/local/bin/xml unesc`
+
+
if [ -n "${_ifconfig_args}" ]; then
eval /usr/local/sbin/rconf attribute set "ifconfig_${_ifn}" "${_ifconfig_args}"
fi
if [ -n "${_ifconfig_extra_options}" ]; then
configxml_get "//interfaces/lan/ipaddr"
configxml_get "//interfaces/lan/gateway"
-i "string-length(extraoptions) > 0" -v "concat(' ',extraoptions)" -b \
-m "wireless" \
-v "concat(' ssid ',ssid,' channel ',channel)" \
-i "string-length(standard) > 0" -v "concat(' mode ',standard)" -b \
@@ -149,11 +159,23 @@
-b \
${configxml_file} | /usr/local/bin/xml unesc`
_ifconfig_extra_options=`/usr/local/bin/xml sel -t -m "//interfaces/*[name() = 'opt${_id}']" \
/bin/rm -f /etc/start_if.${_ifn}
fi
_id=$(( ${_id} - 1 ))
rcconf.sh.patch
Is this patch for 0.7 or trunk (0.8)?
I got sources as in documentation from
svn co https://freenas.svn.sourceforge.net/svnroot/freenas/trunk svn
from yesterday
This is for 0.8 (FreeBSD 8.0) but will be switched to Linux very soon.
uname -r
7.2-RELEASE
ifconfig em0 inet 10.7.12.30/24 ether 08:00:27:ee:86:3e
ifconfig: ether: bad value
ifconfig em0 inet 10.7.12.30/24
grep start_if /etc/network.subr
I think this is a patch for 0.7 too.