Issues with WiFi aliases and connectivity

Hi all,
I have a set network aliases in /etc/rc.conf to use them in my jails.

# Adding alias for wlan0 for jails
ifconfig_wlan0_alias0="inet netmask 0xffffff00 broadcast"
ifconfig_wlan0_alias1="inet netmask 0xffffff00 broadcast"
ifconfig_wlan0_alias2="inet netmask 0xffffff00 broadcast"
ifconfig_wlan0_alias3="inet netmask 0xffffff00 broadcast"
ifconfig_wlan0_alias4="inet netmask 0xffffff00 broadcast"
ifconfig_wlan0_alias5="inet netmask 0xffffff00 broadcast"

when I start my desktop sometimes it doesn't create all the aliases (few of them will be missing) and consequently some of the jails won't have network.

I usually restart my wlan0 service netif restart wlan0. And when I do that all the alias will be loaded correctly but will wlan0 won't connect to the SSID.

~ % ifconfig -a
msk0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
    ether 00:1d:72:f0:48:dc
    media: Ethernet autoselect
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
    inet6 ::1 prefixlen 128
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
    inet netmask 0xff000000
    groups: lo
wlan0: flags=8c43<UP,BROADCAST,RUNNING,OACTIVE,SIMPLEX,MULTICAST> metric 0 mtu 1500
    ether 00:21:6b:51:73:20
    inet netmask 0xffffff00 broadcast
    inet netmask 0xffffff00 broadcast
    inet netmask 0xffffff00 broadcast
    inet netmask 0xffffff00 broadcast
    inet netmask 0xffffff00 broadcast
    inet netmask 0xffffff00 broadcast
    media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
    status: no carrier
    ssid "" channel 157 (5785 MHz 11a)
    regdomain FCC country US authmode WPA1+WPA2/802.11i privacy MIXED
    deftxkey UNDEF txpower 23 bmiss 10 mcastrate 6 mgmtrate 6 scanvalid 60
    wme roaming MANUAL bintval 0
    groups: wlan

As you see all the aliases are there but the SSID comes as "" and the router IP is missing.
I tried to check the dhclient
:~ % sudo dhclient wlan0
wlan0: no link .............. giving up
I tried using ifconfig to set manually the ssid and the IP they will show up but still won't have internet.

Eventually I have to disable the aliases in rc.conf and restart wlan0 to have the internet back (connection to the router). No matter how much I try it doesn't work... Any help will be appreciated.
Last edited by a moderator:
You can remove the aliases from the interface and add the IP to the jail's configuration. That way the IP will be dynamically added/removed when you start/stop the jail.
Thanks, well I am using ezjail to manage my jails and checking the configuration in /usr/local/etc/ezjail/source_jail for example; I can see the IPs are there
% cat /usr/local/etc/ezjail/source_jail
# To specify the start up order of your ezjails, use these lines to
# create a Jail dependency tree. See rcorder(8) for more details.
# PROVIDE: standard_ezjail

export jail_source_jail_hostname="source.jail"
export jail_source_jail_ip=""
export jail_source_jail_rootdir="/usr/jails/source.jail"
export jail_source_jail_exec_start="/bin/sh /etc/rc"
export jail_source_jail_exec_stop=""
export jail_source_jail_mount_enable="YES"
export jail_source_jail_devfs_enable="YES"
export jail_source_jail_devfs_ruleset="devfsrules_jail"
export jail_source_jail_procfs_enable="YES"
export jail_source_jail_fdescfs_enable="YES"
export jail_source_jail_image=""
export jail_source_jail_imagetype=""
export jail_source_jail_attachparams=""
export jail_source_jail_attachblocking=""
export jail_source_jail_forceblocking=""
export jail_source_jail_zfs_datasets=""
export jail_source_jail_cpuset=""
export jail_source_jail_fib=""
export jail_source_jail_parentzfs=""
export jail_source_jail_parameters="allow.raw_sockets=1"
export jail_source_jail_post_start_script=""
export jail_source_jail_retention_policy=""

yet when it is not set as alias in the interface my jail will be offline
Add the interface:
export jail_source_jail_ip="wlan0|"
Brilliant.... thanks so much. This solved the issue and another issue I have with the jails.
Cheers :)