[LEDE-DEV] Routing two interfaces on same subnet

Baptiste Clenet bapclenet at gmail.com
Wed Jul 6 00:05:41 PDT 2016


Ok Thanks Tobias,
I will try to implement it.
So if user plugged ethernet to the internet provider router and wifi
is also connected, they will be no problem?

2016-07-06 2:16 GMT+02:00 Tobias Welz <tw at wiznet.eu>:
> Bridging in client mode is not supported by most devices.
> That's why you need a "pseudo bridge" with relayd here:
> https://wiki.openwrt.org/doc/recipes/relayclient
>
>
> On 05.07.2016 23:14, Baptiste Clenet wrote:
>>
>> Ok.
>> I've got a router with one ethernet port and wifi in STA mode. The
>> user which is going to use the router will be able to connect this
>> router to internet router either by ethernet or wifi.
>> So if he plugs ethernet and decide to connect his router by wifi also,
>> ethernet and wifi will be on same network (same subnet).
>> Is it clearer?
>> Currently, when I start my board, I've got this config even if
>> ethernet is unplugged (wifi STA connects automatically):
>> 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
>>
>> Then I can't ping my router because of the route on eth0
>> May I use a bridge in this set up?
>>
>>
>> 2016-07-05 20:26 GMT+02:00 Tobias Welz <tw at wiznet.eu>:
>>>
>>> I think we need to know more about your setup, and what you want to
>>> achieve.
>>> Let's say we have LAN and WAN interfaces as ethernet ports, and also
>>> WIFI.
>>>
>>> Should the WIFI be in AP or in STA mode?
>>> Shall wifi be bridged to LAN or to the WAN interface?
>>>
>>>
>>> -------- Original Message --------
>>> Subject: Re: [LEDE-DEV] Routing two interfaces on same subnet
>>> From: Baptiste Clenet <bapclenet at gmail.com>
>>> To: Tobias Welz <tw at wiznet.eu>
>>> Cc: lede-dev at lists.infradead.org
>>> Date: 5.7.2016 19:33:02
>>>>
>>>> Wifi and ethernet are in client mode.
>>>> pseudo bridge with relayd? Can you describe a bit?
>>>>
>>>> 2016-07-05 19:24 GMT+02:00 Tobias Welz <tw at wiznet.eu>:
>>>>>
>>>>> Hi,
>>>>> it's just a little problem if you are in in client mode, then you need
>>>>> a
>>>>> pseudo bridge with relayd.
>>>>> If you use AP mode then you can just bridge LAN and WIFI together,
>>>>> which
>>>>> is
>>>>> the default anyway. A factory default will bring you to this setting,
>>>>> turn
>>>>> on wifi and you are done.
>>>>> Regards Tobias
>>>>>
>>>>> -------- Original Message --------
>>>>> Subject: Re: [LEDE-DEV] Routing two interfaces on same subnet
>>>>> From: Baptiste Clenet <bapclenet at gmail.com>
>>>>> To: Tobias Welz <tw at wiznet.eu>
>>>>> Cc: lede-dev at lists.infradead.org
>>>>> Date: 5.7.2016 19:15:42
>>>>>>
>>>>>> Hi Tobias,
>>>>>> I see, I tried to bridge them, but I got a problem, I'll try again.
>>>>>> Isn't it a problem if both interfaces are connected to same network in
>>>>>> a
>>>>>> bridge?
>>>>>>
>>>>>> 2016-07-05 19:04 GMT+02:00 Tobias Welz <tw at wiznet.eu>:
>>>>>>>
>>>>>>> Hello,
>>>>>>> for me it looks a bit strange, why not put both interfaces together
>>>>>>> on
>>>>>>> Layer
>>>>>>> 2 - so bridge them together - which is the default anyway? It looks
>>>>>>> very
>>>>>>> strange to me, to split that stuff on layer 3 with the same subnet,
>>>>>>> which
>>>>>>> now need a lot of hacking to bring it to work again, which i
>>>>>>> personally
>>>>>>> would like to avoid in a production environment.
>>>>>>> For me it looks like a "wrong" approach - what is the special need to
>>>>>>> doing
>>>>>>> it in this way?
>>>>>>> What is the problem with using a bridge over these two interfaces
>>>>>>> which
>>>>>>> should just run out of the box?
>>>>>>> Regards Tobias
>>>>>>>
>>>>>>>
>>>>>>> -------- Original Message --------
>>>>>>> Subject: [LEDE-DEV] Routing two interfaces on same subnet
>>>>>>> From: Baptiste Clenet <bapclenet at gmail.com>
>>>>>>> To: lede-dev at lists.infradead.org
>>>>>>> Date: 4.7.2016 10:14:26
>>>>>>>>
>>>>>>>> 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:/#
>>>>>>>>
>>>>>>>> How can I can solve the problem?
>>>>>>>> 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,
>>>>>>>>
>>>>
>>
>>
>
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev



-- 
Baptiste



More information about the Lede-dev mailing list