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

Freddie Cash fjwcash at gmail.com
Tue Oct 21 12:44:03 PDT 2008


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 at gmail.com


More information about the freebsd-stable mailing list