Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Oct 2008 17:09:46 +0100 (CET)
From:      Oliver Fromme <olli@lurza.secnetix.de>
To:        freebsd-stable@FreeBSD.ORG, dudu.meyer@gmail.com
Subject:   Re: ifconfig won't allow me to change ether address and inet address in ?the same command
Message-ID:  <200810271609.m9RG9kLB020294@lurza.secnetix.de>
In-Reply-To: <d3ea75b30810211148l798ee274s77081b12962d15f4@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Eduardo Meyer wrote:
 > # ifconfig rl0 ether 00:02:4f:0a:ce:f3 inet 192.168.2.12 netmask 255.255.255.0
 > ifconfig: can't set link-level netmask or broadcast
 > 
 > # ifconfig rl0 inet 192.168.2.12 netmask 255.255.255.0 ether 00:02:4f:0a:ce:f3
 > ifconfig: ether: bad value
 > 
 > # ifconfig rl0 inet 192.168.2.12 netmask 255.255.255.0
 > # 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 192.168.2.12 netmask 255.255.255.0 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 192.168.2.12 netmask 255.255.255.0"

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

-- 
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."



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