Solved Can't make IP aliases through /etc/rc.conf

Hello! I am trying to set up IP aliases and have been following the handbook (11.6 Virtual Hosts) on how to do this. It seems to work if I do it directly in console with # ifconfig wlan0 inet 192.168.1.10/32 alias, then the console is read:

Code:
inet 192.168.1.65 netmask 0xffffff00 broadcast 192.168.1.255
   inet 192.168.1.10 netmask 0xffffffff broadcast 192.168.1.10
   nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
   media: IEEE 802.11 Wireless Ethernet OFDM/54Mbps mode 11g
   status: associated

However if I put the configuration for it in /etc/rc.conf I, after boot, start with
Code:
status: no carrier
and the Internet connection isn't working. This can be helped by manually connecting with # wpa_supplicant but I will rather have this work on boot. Is there any other solution for this without having to do some rc-scripting?

PS. I think that my wireless network card supports aliases since why would I otherwise be able to create them manually? Also have tried any kind of combinations of the "alias-texts" without any functioning result on reboot, currently they are commented. Process wpa_supplicant runs as it should.

Working /etc/rc.conf
Code:
wpa_supplicant_enable="YES"
wlans_ath0="wlan0"
#ifconfig_wlan0="WPA DHCP"
ifconfig_wlan0="inet 192.168.1.65 netmask 255.255.255.0 ssid TN_private
_C6237F WPA mode 11g"
#ifconfig_wlan0_alias0="inet 192.168.1.10 netmask 255.255.255.255"
defaultrouter="192.168.1.254"
#ifconfig_wlan0_aliases="inet 192.168.1.65/24 inet 192.168.1.10/32 ssid
 TN_private_C6237F"
create_args_wlan0="country SE regdomain ETSI"
gateway_enable="YES"

/etc/wpa_supplicant.conf
Code:
ctrl_interface=/var/run/wpa_supplicant
eapol_version=2
ap_scan=1
fast_reauth=1

network={
ssid="TN_private_C6237F"
scan_ssid=0
psk="thisisasecret"
priority=5
}
network={
        priority=0
        key_mgmt=NONE
 
Hello,
I have done it this way, for a normal network card named "xlo"; and it works:

May this can help you:
Code:
 defaultrouter="192.168.0.1"

 #hints: netmask 255.255.255.0 = 0xffffffe0
 ifconfig_xl0="inet 192.168.0.14 netmask 0xffffffe0"
 ifconfig_xl0_alias0="inet 192.168.0.20  netmask 0xffffffe0"
 ifconfig_xl0_alias1="inet 192.168.0.21 netmask 0xffffffe0"
 ifconfig_xl0_alias2="inet 192.168.0.32 netmask 0xffffffe0"
I see in your code one "...alias" has no number, but I can not confirm that this is the problem.
 
However if I put the configuration for it in /etc/rc.conf I, after boot, start with
Code:
status: no carrier
and the Internet connection isn't working.
See rc.conf(5). Every example you'll find there uses the hexadecimal format to specify the netmask or uses the CIDR notation, but not what you used.

So my advice would be to change that first:

Code:
ifconfig_wlan0_alias0="inet 192.168.1.10/32"
 
Back
Top