I have been thinking about this as well and wondering if Network Manager
would be the right place to put functionality like this.

   First you'd have to have a way to determine that the wired and wireless
networks are actually the same L2 network. (Detection that the GW address
from DHCP is actually the same MAC+IP for both the wired and wireless
connections? Or manual configuration?)

   Then there's the question of "which MAC address will the outside world be
talking to"? If you have a wired and wireless NIC in a laptop, you'll have
two unique L2 addresses. You could forget about the factory assigned ones
anduse a virtual MAC address, but that could get messy. To keep it simple
(and avoid MAC moves) you could just send a gratuitous ARP (or a few) on the
interface that just took over. Network Manager would have to make sure that
the stack only ever is aware of the "floating" IP address on the current
active interface.

   To simplify the problem, you could assume that the wireless network is
always the "backup" network. If you're connected physically, you'd always
want to use that.

   I think this setup would work for most home users on basic NAT routers,
but could break on networks with security features such as DHCP snooping,
which would try to match up L2 addresses to known assigned L3 addresses. To
solve this, the idea of a virtual MAC could be revisted. (or have some logic
to re-assign the wired NIC's MAC address to the wireless interface that is
"backing it up"... but that may cause other, different security issues if
someone is expecting only "wireless MACs" on wireless-only ports or vice
versa)

   So it would go something like this:

1. User plugs in a wired network. Network Manager performs normal DHCP
procedures, if configured.
2. User plugs in a wireless network. Network Manager performs normal DHCP
procedures, if configured.
3. After >1 network is connected, Network Manager checks DHCP-provided
gateway address to determine if the IP address is the same as the IP address
on the other network.
3a. If yes, Network Manager sends an ARP request to the each gateway to
determine if the MAC address is the same
3b. If yes, [optional?] Network Manager could send a packet to itself (on
the opposite interface) on each of the wired and wireless interfaces, and
check if it receives it to ensure connectivity
3c. If yes [optional?] Network Manager prompts the user, asking if he/she
wants to use the wireless network as a backup for the wired network. (with a
dialog to "never ask me  again for this wireless network")
3c. If yes, Network Manager asks the DHCP client to release the IP address
for the wireless network. We won't be needing it. (unless we want to keep it
around to test L3 connectivity)
4. If the wired network is unplugged, Network Manager will assign its IP
address to the "backup" wireless network (and send a gratuitous ARP
indicating the same)
5. If the wired network is plugged back in, instead of running the DHCP
client right away, ARP for the gateway to determine if it's the same nework.

5a. If the gateway has the same IP/MAC address, delete the IP address from
the wireless network, assign it to the wired network, and send a gratuitous
ARP out on the wired network.

   Certainly this isn't the first time someone has thought of doing this. Is
a feature like this already planned? (I checked
http://live.gnome.org/NetworkManagerToDo and "Multiple Active Devices"
sounds similar, but not quite like this...)

Regards,
Mike Pontillo

On Mon, Apr 27, 2009 at 12:57 PM, Nicolò Chieffo
<[email protected]>wrote:

> Sorry, I couldn't explain myself. I don't want to use both connections
> at the same time
> What I'm looking for, is the ability to have a "backup" connection. If
> one looses internet connectivity, the other will work automatically.
>
> Currently in this situation the wired connection supersedes the
> wireless one, and if the wired router gets disconnected, I will loose
> internet, even if I could reach it through the wireless connection.
> _______________________________________________
> NetworkManager-list mailing list
> [email protected]
> http://mail.gnome.org/mailman/listinfo/networkmanager-list
>
_______________________________________________
NetworkManager-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/networkmanager-list

Reply via email to