Several default IP routes

Hi,

On my device, I have several network interfaces, including Wifi for internet access, and Ethernet for the local network.

Capture1

Here the “first” default route is via wlp4s0.

If I want to ping my device from 10.xxx, I cannot. I have a timeout error.

How do I need to configure the network to be able to use both network at the same time ? Using enp2s0 for all connection from/to 10.153.16.0/24, and wlp4s0 for all others connection ?

Thanks

Hi Lucas,

You need to tell the software you’re using the network interface it should use. I’m not sure if there is a way to do this automatically given the destination address, but for example ping has the -I argument, and most platforms/runtimes allow you to implement this at the application level (i.e. Node.js allows you to set the local address when opening sockets)

Hi,
Thank for the reply.
Ok, I agree in the case of outbound connection. But in my case I’m trying to ping the gateway, so inbound.
Do you have an idea why I cannot reach the gateway? Is there a tool on balena to debug this and see incomming packets ?

Thanks

Hi Lucas,

I see what you mean now. So a device from 10.xxx cannot ping 10.153.16.1? If so, that’d be strange. Does sending non-ICMP packets work?

You can try running tshark (https://www.wireshark.org/docs/wsug_html_chunked/AppToolstshark.html) and seeing if the gateway receives the ICMP requests, but then drops them afterwards.

Yes, this is the weird behavior I have.
Thanks for the tool, i’ll try to investigate.

Hi,

I removed the default route via 10.153.16.1 and add a new one:
ip route add 10.153.16.0/24 via 10.153.16.1 dev enp2s0

Now I have:
image

But still I cannot ping my device:
image

Do you have any idea ?

Thanks

I see the screenshot of a Windows command prompt. Does the Windows machine have a 10.153.16.0/24 IP address? Is the Windows machine able to ping 10.153.16.1? I assume that 10.153.16.1 is some WiFi router – neither the Windows machine, nor the balenaOS device – please confirm.

ping uses ICMP by default; check also that the 10.153.16.1 router is not dropping it. If 10.153.16.1 is a laptop with “Internet Connection Sharing” instead of a “real” WiFi router, this could especially be the case. Check also the Windows machine is not running a strict firewall that drops ICMP. Some of these issues can be ruled out by trying to ping other devices, or other laptops on the same subnet.