apache / apache/nuttx

Prioritize Ethernet or WiFi over PPP

Open
#7,104 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
4k
Forks
1.7k
Avg merge
1d 17h
Merged PRs (30d)
237

Description

I have successfully configured a dual-interface connection on ESP32 (TTGO T-Call):

```sh
nsh> pppd &
[...] CONNECT
nsh> ifconfig
wlan0 Link encap:Ethernet HWaddr 98:cd:ac:7a:81:e0 at UP
inet addr:192.168.10.236 DRaddr:192.168.10.1 Mask:255.255.255.0

ppp0 Link encap:TUN at UP
inet addr:10.97.10.240 DRaddr:192.168.254.254 Mask:0.0.0.0

nsh> route
SEQ TARGET NETMASK ROUTER
1. 0.0.0.0 0.0.0.0 192.168.254.254
```

However, ping shows that modem connection is preferred over WiFi:
```log
nsh> ping 8.8.8.8
PING 8.8.8.8 56 bytes of data
56 bytes from 8.8.8.8: icmp_seq=0 time=630 ms
56 bytes from 8.8.8.8: icmp_seq=1 time=360 ms
56 bytes from 8.8.8.8: icmp_seq=2 time=490 ms
56 bytes from 8.8.8.8: icmp_seq=3 time=580 ms
56 bytes from 8.8.8.8: icmp_seq=4 time=370 ms
56 bytes from 8.8.8.8: icmp_seq=5 time=520 ms
56 bytes from 8.8.8.8: icmp_seq=6 time=630 ms
56 bytes from 8.8.8.8: icmp_seq=7 time=400 ms
56 bytes from 8.8.8.8: icmp_seq=8 time=550 ms
56 bytes from 8.8.8.8: icmp_seq=9 time=640 ms
10 packets transmitted, 10 received, 0% packet loss, time 10100 ms
nsh> ifdown ppp0...OK
nsh> ping 8.8.8.8
PING 8.8.8.8 56 bytes of data
56 bytes from 8.8.8.8: icmp_seq=0 time=30 ms
56 bytes from 8.8.8.8: icmp_seq=1 time=20 ms
56 bytes from 8.8.8.8: icmp_seq=2 time=20 ms
56 bytes from 8.8.8.8: icmp_seq=3 time=20 ms
56 bytes from 8.8.8.8: icmp_seq=4 time=20 ms
56 bytes from 8.8.8.8: icmp_seq=5 time=20 ms
56 bytes from 8.8.8.8: icmp_seq=6 time=20 ms
56 bytes from 8.8.8.8: icmp_seq=7 time=20 ms
56 bytes from 8.8.8.8: icmp_seq=8 time=20 ms
56 bytes from 8.8.8.8: icmp_seq=9 time=20 ms
10 packets transmitted, 10 received, 0% packet loss, time 10100 ms
```

Changing the order of network configuration doesn't help.
It looks like on Linux, this is handled by route metrics (`ifmetric` command).
Is there a way to achieve this on NuttX?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.