# Failover Mode Between Ethernet and Wireless Interfaces



## gibb (Feb 24, 2017)

Hi,

I'm fairly new to FreeBSD and managed to install 11 RELEASED on my HP Pavilion dm3-1130us notebook.  Now, I'd like to set up failover between wired ethernet device and wifi interface as described in the example 30.3 of the FreeBSD handbook.

In there, it says "_The wlan0 device was created from iwn0 wireless interface, which will be configured with the MAC address of the Ethernet interface._"  How was wlan0 created from iwn0?  What is iwn0?  My wlan0 was created from ath0 during the installation.  Does that mean iwn0 mentioned in the handbook is ath0 in my case?

I think I'm a bit confused with different interface names there...  Any help would be appreciated.

Thanks in advance.
-gibb


----------



## SirDice (Feb 24, 2017)

gibb said:


> Does that mean iwn0 mentioned in the handbook is ath0 in my case?


Yes.


----------



## kafka0 (Feb 24, 2017)

gibb said:


> What is iwn0?


The section 11.5.1 Locating the correct driver in the Handbook explains how FreeBSD attributes names to you NICs.


----------



## gibb (Feb 24, 2017)

SirDice said:


> Yes.



> SirDice,
Thanks for your reply.  If that's the case, I'm getting "ifconfig: interface ath0 does not exit" when I follow its example at assigning MAC address to wifi interface as below:

`ifconfig ath0 ether xx:xx:xx:xx:xx:xx
ifconfig: interface ath0 does not exist`

`ifconfig -l
re0 lo0 wlan0`

I have loaded ath in the /boot/loader.conf as if_ath_load="YES"

Am I missing a step at somewhere?  Why is it failing to assign a MAC address to ath0?

Thanks in advance.
-gibb


----------



## kafka0 (Feb 24, 2017)

gibb said:


> > SirDice,
> Thanks for your reply.  If that's the case, I'm getting "ifconfig: interface ath0 does not exit" when I follow its example at assigning MAC address to wifi interface as below:
> 
> `ifconfig ath0 ether xx:xx:xx:xx:xx:xx
> ...



Please read the link I gave you carefully ("FreeBSD uses the driver name followed by the order in which the card is detected at boot to name the NIC. For example, sis2 is the third NIC on the system using the sis(4) driver."). You can't configure your ath0 NIC because you don't have one. Instead, you have a NIC using the driver iwn, named iwn0. This is what ifconfig is telling you here: on your system, there's no ath0 NIC. Whenever you see ath0, replace it with iwn0.


----------



## SirDice (Feb 24, 2017)

I don't have a wireless interface so I can't check it but if I recall correctly wireless interfaces don't show up with ifconfig(8) any more on FreeBSD 11.0. I believe the handbook needs some updating in this respect as the process changed somewhat on 11.0. I'm looking for you but can't find the "new" procedure at short notice. 

As you already have a wlan0 try setting the MAC address there; `ifconfig wlan0 ether .....`
Not sure if that's correct though, as I said, I can't test/verify it myself.


----------



## gibb (Feb 24, 2017)

kafka0 said:


> You can't configure your ath0 NIC because you don't have one. Instead, you have a NIC using the driver iwn, named iwn0. This is what ifconfig is telling you here: on your system, there's no ath0 NIC. Whenever you see ath0, replace it with iwn0.



> kafka0

Thanks for your reply but I have to disagree with you.  ath0 is the one that I have on my system as I originally created wlan0 from ath0 when I configured wifi using following command and wlan0 is working fine:

`ifconfig wlan0 create wlandev ath0`

Also, ath0 is discovered during the boot:


```
ath0: <Atheros 9285> mem 0xf1000000-0xf100ffff irq 17 at device 0.0 on pci3
[ath] AR9285 Main LNA config: LNA2
[ath] AR9285 Alt LNA config: LNA1
[ath] LNA diversity enabled, Diversity enabled
[ath] Enabling diversity for Kite
ath0: [HT] enabling HT modes
ath0: [HT] 1 stream STBC receive enabled
ath0: [HT] 1 RX streams; 1 TX streams
ath0: AR9285 mac 192.2 RF5133 phy 14.0
ath0: 2GHz radio: 0x0000; 5GHz radio: 0x00c0
```

Beside, when I replaced ath0 with iwn0 as suggested, I still get the same interface does not exist error, which is why I'm very much confused here.

Thanks in advance,
-gibb


----------



## kafka0 (Feb 24, 2017)

gibb said:


> > kafka0
> 
> Thanks for your reply but I have to disagree with you.  ath0 is the one that I have on my system as I originally created wlan0 from ath0 when I configured wifi using following command and wlan0 is working fine:



Apologies, I read the post too quickly and mixed the two interfaces! *I* should be reading things more carefully...



SirDice said:


> I don't have a wireless interface so I can't check it but if I recall correctly wireless interfaces don't show up with ifconfig(8) any more on FreeBSD 11.0.



I believe net.wlan.devices should show them: sysctl -a | grep wlan
Not sure what else can be done through that.
But I can't test this either...


----------



## `Orum (Feb 25, 2017)

This behavior was changed with FreeBSD 11, and the physical interfaces are no longer listed by ifconfig.  I recommend configuring them in rc.conf according to the bottom of handbook example 30.3 (which is the same way you would configure them in FreeBSD 10.3), and letting the scripts do the work.  You can check without rebooting by running `service netif restart` as root.

If it's still not working, post here, and I can show you my example configuration; it's on my work laptop, otherwise I would post it here now.  Also, although I don't believe it affects you (as you have an ath(4) card), but iwn(4) cards suffer numerous problems under 11.0 to the point where I recommend just running 10.3 instead.


----------



## gibb (Feb 28, 2017)

`Orum said:


> This behavior was changed with FreeBSD 11, and the physical interfaces are no longer listed by ifconfig.  I recommend configuring them in rc.conf according to the bottom of handbook example 30.3 (which is the same way you would configure them in FreeBSD 10.3), and letting the scripts do the work.  You can check without rebooting by running `service netif restart` as root.
> 
> If it's still not working, post here, and I can show you my example configuration; it's on my work laptop, otherwise I would post it here now.  Also, although I don't believe it affects you (as you have an ath(4) card), but iwn(4) cards suffer numerous problems under 11.0 to the point where I recommend just running 10.3 instead.



> `Orum

Instead of running those commands in the console, I updated the rc.conf file and it seems working.  
Thank you all.


----------



## `Orum (Mar 1, 2017)

gibb said:


> Instead of running those commands in the console, I updated the rc.conf file and it seems working.


rc.conf is automatically applied every time you boot.  The command was just if you wanted to avoid rebooting.


----------



## forgiven_noob (Feb 7, 2020)

`Orum said:


> rc.conf is automatically applied every time you boot.  The command was just if you wanted to avoid rebooting.


I realize it has been a while but can i see your rc.conf?


----------



## `Orum (Feb 13, 2020)

Sure, here's the relevant networking bits:

```
ifconfig_em0="up"
wlans_ath0="wlan0"
ifconfig_wlan0="WPA"
cloned_interfaces="lagg0"
ifconfig_lagg0="up laggproto failover laggport em0 laggport wlan0 DHCP"
```


----------

