Hi, how are you?
I would like to understand what can be happening in my setup (attached figure). I have 03 VM´s (all with SO-Linux), just one with echo-server application, the others with echo-client app.
"VM-lwip":
- eth0 and tty0 (pyshical netwoking and serial interfaces)
- running a server-echo app (lwip user). This app creates two netifs:
> netif-0: connected to eth0 - ip: 10.0.2.180, mask: 255.255.255.0
> netif-1: connected to serial (PPP protocol) - ip: 10.0.3.183, mask: 255.255.255.0.
- Then it binds to "IP_ADDR_ANY" address to receive packages (netconn_recv).
"VM-0":
- pyshical network interface (eth0) connected to same subnetwork of "VM-lwip".
"VM-1":
- pyshical serial interface (PPP) connected to "VM-lwip"
I do not use TUN/TAP and brigde. The "access" components shown in the attached figure can receive/transmit data from/to eth and serial. That works fine, no problem.
When I run the echo-client from VM-0 sending packets to IP associated to netif-0, all works fine, no problem.
But when I run the echo-client from VM-1(PPP stablished) sending packets to netif-1 IP adrress, the lwip processes the packages and put the reply packages to netif-0.
I have been investigating and I think that the problem is associated to PPP netif netmask (ever 255.255.255.255). Please, see the "get_mask" function and "netif_add" call both codes in the "lwip/src/netif/ppp/ppp.c" file.
Thus, the "ip4_route" function does not match the appropriate netif, in this case the netif-1, and returns the default-netif (netif-0, associated to eth0). Then the outgoing packets are forwarding to eth and not to serial. When the client-echo is run in VM#0 the all works fine because the match happens.
Please, is it correct?
PS: Sergio R. Caprile tried to help me about this issue.
Thanks.
--