FlightAware Discussions

Both Wireless and Wired enabled

Hello Aviation Geeks.

I just got my Piaware up and running. And I was wondering when I enable both Wired and Wireless in the Piaware config file, will the Wireless interface work as a backup of the wired interface and vice versa ?

Thanks

Be aware that you will get two IPs for you local network.
Depending on which link is active, that’s where your local map is.

It should work with a default Raspbian install, i’m not quite sure what the piaware image does in this configuration.

I usually have Wi-Fi (wlan0) enabled.

If i plug in wired Ethernet (eth0) it switches quite quickly to wired.

Interface eth0 has a metric of 1
Interface wlan0 has a metric of 2

Therefore it defaults to eth0 if available.

S

1 Like

It works as i had both interfaces enabled by chance. But it doesn’t make sense at all :wink:

What exactly doesn’t make sense?

The situation i described above occurs on a piaware image. It works this way on most versions of Unix/Xenix/ Linux and other variants i have seen in the last 30 years.

S

Sorry, misunderstood.
In some cases it makes sense having both interfaces enabled :wink:

Gentlemen,

Thank you for all the replies. Cool !.

I just enabled the Wifi and the LAN interace on the PI, and I see both are now connected. The primary interface used to connect to Flightaware is the LAN interface now.
When I monitor my Wifi network I do actually see the pi connected to the wifi, and sending some tcp packets, but PiAware is currently not using the interface.

Thank you verry much for the great support !

I may have understood what you meant by your comment .:wink:

Why enable both if only one is going to be used? Doesn’t that cause more stuff to be loaded at boot up, and all the ‘consequences’ that derive from that?

Some network configurations might require it.

What consequences?

It’s nice pretty much for only one use-case i can imagine though:
Regularly relocating the RPi for testing and still wanting Ethernet in regular or testing operation.

Ethernet connection normally don’t need a backup, they just work.

On the other hand, there is no real drawback.

LOL, little background info on my question. I have a pretty good stable 1gb LAN here, but I also have a good Wifi mesh network. As I was searching for a nice place to install my antenna and my PI, some places would be better connected on Wifi and others on both or cable only. . So depending on the location of the PI I wanted to make 1 config that fits all my options. :).

Btw I have the Pi now on cable and Wifi connected, and the Cable is uploading data to flightaware, but I see that the Skyview map works on both Cable and wifi. :slight_smile:

We use it on FlightFeeders to remotely diagnose wifi problems.

The default raspbian setup will entirely tear down the wifi association when a wired connection appears (or at least it used to, maybe that’s changed); that makes diagnosing wifi problems on headless systems much harder.

Mine doesn’t, but i’m not sure if i changed it from dhclient to dhcpcd.

Anyway that’s indeed a good use :slight_smile:

One little remark, my PI is using static IP addresses on both interfaces perhaps thats why It keeps working.

The vanilla piaware image 3.7.1 that I have installed on my test Pi has both wlan0 and eth0 configured and if the cable is plugged in both interfaces are active and receive an IP address from DHCP.

The default setup has a Metric of 1 for the eth0 interface and Metric 2 for the wlan0 interface so that Ethernet traffic uses the lan0 interface preferentially.

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         fritz.box       0.0.0.0         UG    1      0        0 eth0
default         fritz.box       0.0.0.0         UG    2      0        0 wlan0
192.168.178.0   0.0.0.0         255.255.255.0   U     0      0        0 wlan0
192.168.178.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0

The eth0 interface is removed from the routing table when the Ethernet cable is unplugged and both interfaces remain when the eth0 cable is plugged in.

Yes, that’s the expected behavior with a piaware image.

For most internet-connected software, the vanilla NAT inside a home router will mess things up if two different addresses are active in the same time on one device.
It can also lead to layer 2 loops when multicast is used by any installed software.

To prevent that, default Linux behavior is that, even if the WiFi is marked as “connected”, when LAN is active, the WiFi is actually in stand-by.
Windows goes a step further and de-activates WiFi when LAN is connected.

Each interface presents a different MAC and different DHCP client identifier (same DUID, different IAID). A DUID-aware DHCP server will handle this as two different interfaces for the same device. A DUID-unaware DHCP server will handle this as two completely separate devices.

Please explain how this can cause any problems with NAT, because I don’t see it.

Any sort of routing / switching loop isn’t going to happen, simply because these images default to disabling IP forwarding.

I can remember that i had lots of error messages regarding WiFi after i’ve setup PiAware on my device because i did not configure it properly (I use a LAN connection).

This stopped only after i have disabled the WiFi interface. So from my perspective both are up and running anc can be configured independently. There seem to be
no automatic disconnect from WiFi if a cable is plugged in.

Same case here. Everything works smoother with LAN connection when WiFi is disabled, but that might be related to the way WiFi is implemented inside Pi (USB connection).