Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Oct 2008 12:43:53 -0700
From:      Freddie Cash <fjwcash@gmail.com>
To:        freebsd-stable@freebsd.org
Subject:   Re: ifconfig won't allow me to change ether address and inet address in the same command
Message-ID:  <200810211243.53844.fjwcash@gmail.com>
In-Reply-To: <d3ea75b30810211148l798ee274s77081b12962d15f4@mail.gmail.com>
References:  <d3ea75b30810211148l798ee274s77081b12962d15f4@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On October 21, 2008 11:48 am Eduardo Meyer wrote:
> Please, follow:
>
> # 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"

You can split it across two ifconfig lines using the alias feature in 
rc.conf:

ifconfig_rl0="ether 00:02:4f:0a:ce:f3"
ifconfig_rl0_alias0="inet 192.168.2.12 netmask 255.255.255.0"

We use something similar for setting interface options and vlans separate 
from adding IPs to the interface.
-- 
Freddie Cash
fjwcash@gmail.com



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