[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] 2 netifs and using netif_set_default() problems

From: address@hidden
Subject: Re: [lwip-users] 2 netifs and using netif_set_default() problems
Date: Mon, 28 Jan 2019 19:57:31 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

Am 28.01.2019 um 19:16 schrieb Sergio R. Caprile:
So, so far:

When switching default interface with connections open, traffic stops
going out on the former default interface (A) but starts going out on
the new one (B), but using the former address (addrA):
Default interface is A, traffic is going from addrA to addrX outside the
local network, default interface is switched to B, and then I can see
Ethernet frames on B with the addrA, being sent to the default gateway
(on B).

The point is... Being that lwIP does not route, is it allowed to call
netif_set_default() with connections open ? Is there anything else to
check/prevent ? (in addition to properly dropping connections and
starting them again as on an address change)
Simon, guys ?

Well, lwIP *does* route: it sends packets to a default route if the destination IP is outside of the subnets of all the netifs.

So as long as you have a default gateway set on both netifs and that gateway can route to the wherever you want to connect (route, not NAT!), the remote host won't even notice: the packet's IP addresses will remain the same, they will only take a different route to the destination.

Of course, that's different with NAT gateways. You won't want to switch to/from such a gateway by switching default netifs, as here, your externally visible IP will change...


reply via email to

[Prev in Thread] Current Thread [Next in Thread]