ifconfig won't allow me to change ether address and inet address in ?the same command

Oliver Fromme olli at lurza.secnetix.de
Mon Oct 27 09:09:49 PDT 2008

Eduardo Meyer wrote:
 > # ifconfig rl0 ether 00:02:4f:0a:ce:f3 inet netmask
 > ifconfig: can't set link-level netmask or broadcast
 > # ifconfig rl0 inet netmask ether 00:02:4f:0a:ce:f3
 > ifconfig: ether: bad value
 > # ifconfig rl0 inet netmask
 > # ifconfig rl0 ether 00:02:4f:0a:ce:f3
 > I ask you some help, how can I accomplish both tasks with rc_ng? In /etc/rc.conf
 > ifconfig_rl0="inet netmask ether 00:02:4f:0a:ce:f3"
 > Won't allow me to do what I want. Any suggestions? I would like like
 > to edit /etc/rc.local and any other kind of "workaround". Can rc.conf
 > issue ifconfig twice for the same nic?
 > Or can ifconfig accomplish this task by someway else other than
 > issuing the command twice?

Others have already suggested several workarounds.
Another possibility is to set only the IP via rc.conf:

ifconfig_rl0="inet netmask"

And set the MAC address with an interface start script
which should be named /etc/start_if.rl0 in your case
and contain this line:

ifconfig rl0 ether 00:02:4f:0a:ce:f3

Best regards

Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606,  Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758,  Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr:  http://www.secnetix.de/bsd

"What is this talk of 'release'?  We do not make software 'releases'.
Our software 'escapes', leaving a bloody trail of designers and quality
assurance people in its wake."

More information about the freebsd-stable mailing list