multiple ports/interfaces

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

multiple ports/interfaces

Ranran
Hello,

Does lwip support using multiple ports (physical interface) ?

Is there any example showing how we should configure more than one port ?

Thank you,
ranran

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: multiple ports/interfaces

goldsimon@gmx.de
On 04.10.2018 17:14, Ranran wrote:
> Does lwip support using multiple ports (physical interface) ?

Yes. Do you want a single IP address or each netif with its own IP?
For a single IP address, you need something like a switch (see
bridgeif.c for a start).

> Is there any example showing how we should configure more than one port?

That depends on the above question.


Simon

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: multiple ports/interfaces

Ranran
On Thu, Oct 4, 2018 at 9:28 PM [hidden email] <[hidden email]> wrote:
>
> On 04.10.2018 17:14, Ranran wrote:
> > Does lwip support using multiple ports (physical interface) ?
>
> Yes. Do you want a single IP address or each netif with its own IP?
> For a single IP address, you need something like a switch (see
> bridgeif.c for a start).
>

I need to have each netif with its own IP.

> > Is there any example showing how we should configure more than one port?
>
> That depends on the above question.
>
Is there a simple example for multiple netif each with itw own IP ?

Thank you very much,
ranran

>
> Simon
>
> _______________________________________________
> lwip-users mailing list
> [hidden email]
> https://lists.nongnu.org/mailman/listinfo/lwip-users

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: multiple ports/interfaces

goldsimon@gmx.de


Ranran wrote:

>On Thu, Oct 4, 2018 at 9:28 PM [hidden email] <[hidden email]>
>wrote:
>>
>> On 04.10.2018 17:14, Ranran wrote:
>> > Does lwip support using multiple ports (physical interface) ?
>>
>> Yes. Do you want a single IP address or each netif with its own IP?
>> For a single IP address, you need something like a switch (see
>> bridgeif.c for a start).
>>
>
>I need to have each netif with its own IP.

That's no problem. You only might get routing problems when the two netifs are in the same subnet.

>> > Is there any example showing how we should configure more than one
>port?
>>
>> That depends on the above question.
>>
>Is there a simple example for multiple netif each with itw own IP ?

No. Just call netif_add etc. for each netif.


Simon

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: multiple ports/interfaces

Ranran
On Sun, Oct 7, 2018 at 11:52 AM goldsimon <[hidden email]> wrote:

>
>
>
> Ranran wrote:
> >On Thu, Oct 4, 2018 at 9:28 PM [hidden email] <[hidden email]>
> >wrote:
> >>
> >> On 04.10.2018 17:14, Ranran wrote:
> >> > Does lwip support using multiple ports (physical interface) ?
> >>
> >> Yes. Do you want a single IP address or each netif with its own IP?
> >> For a single IP address, you need something like a switch (see
> >> bridgeif.c for a start).
> >>
> >
> >I need to have each netif with its own IP.
>
> That's no problem. You only might get routing problems when the two netifs are in the same subnet.
>
> >> > Is there any example showing how we should configure more than one
> >port?
> >>
> >> That depends on the above question.
> >>
> >Is there a simple example for multiple netif each with itw own IP ?
>
> No. Just call netif_add etc. for each netif.
>

I understand.
Should I than do bind to a specific ip address (according to netif),
in order to bind the socket to the netif  interface?

Thank you,
ranran

>
> Simon
>
> _______________________________________________
> lwip-users mailing list
> [hidden email]
> https://lists.nongnu.org/mailman/listinfo/lwip-users

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: multiple ports/interfaces

goldsimon@gmx.de
On 07.10.2018 17:42, Ranran wrote:

> On Sun, Oct 7, 2018 at 11:52 AM goldsimon <[hidden email]> wrote:
>>
>>
>> Ranran wrote:
>>> On Thu, Oct 4, 2018 at 9:28 PM [hidden email] <[hidden email]>
>>> wrote:
>>>> On 04.10.2018 17:14, Ranran wrote:
>>>>> Does lwip support using multiple ports (physical interface) ?
>>>> Yes. Do you want a single IP address or each netif with its own IP?
>>>> For a single IP address, you need something like a switch (see
>>>> bridgeif.c for a start).
>>>>
>>> I need to have each netif with its own IP.
>> That's no problem. You only might get routing problems when the two netifs are in the same subnet.
>>
>>>>> Is there any example showing how we should configure more than one
>>> port?
>>>> That depends on the above question.
>>>>
>>> Is there a simple example for multiple netif each with itw own IP ?
>> No. Just call netif_add etc. for each netif.
>>
> I understand.
> Should I than do bind to a specific ip address (according to netif),
> in order to bind the socket to the netif  interface?

Either that or bind to device (setsockopt(SO_BINDTODEVICE) or
*_bind_netif(), depending on which API you use).

Simon

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users