[LEDE-DEV] Routing two interfaces on same subnet

Baptiste Jonglez baptiste at bitsofnetworks.org
Mon Jul 4 01:57:07 PDT 2016


On Mon, Jul 04, 2016 at 10:14:26AM +0200, Baptiste Clenet wrote:
> Hi,
> 
> On my board, I've got a wifi and an ethernet interfaces on the same
> subnet (192.168.0.0/24). Problem is if ethernet cable is unplugged I
> can't use wifi anymore, see
> 
> root at eisox:/# ip route
> default via 192.168.0.50 dev eth0  proto static
> 192.168.0.0/24 dev eth0  proto kernel  scope link  src 192.168.0.85
> 192.168.0.0/24 dev apcli0  proto kernel  scope link  src 192.168.0.80
> Here, ethernet is unplugged and wifi connected to other router so I
> can't use the wifi (ping failed in both direction).
> 
> If I delete eth route, it works.
> root at eisox:/# ip route del 192.168.0.0/24 dev eth0
> root at eisox:/# ip route
> default via 192.168.0.50 dev eth0  proto static
> 192.168.0.0/24 dev apcli0  proto kernel  scope link  src 192.168.0.80
> root at eisox:/#

Does it?  Your default route still points at eth0.

> How can I can solve the problem?

It's very simple: don't use the same subnet on two different interfaces...

This is not even specific to OpenWRT/LEDE, this is just generally asking
for trouble.

> I won't know the status of Wifi and Ethernet so I would like that both
> can work if they are plugged.
> 
> Or how to disable one interface is the other one is connected (like if
> ethernet is plugged, allow only ethernet to work, if it is unplugged,
> allow only wifi)
> 
> Cheers,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20160704/65769d30/attachment.sig>


More information about the Lede-dev mailing list