Score:0

How do I force eth0 as default?

es flag

So I have a headless Raspberry Pi 4B running Ubuntu 22.04.2 LTS, configured with static IPs in /etc/netplan/50-cloud-init.yaml... eth0:192.168.1.230 and wlan0:192.168.1.231. Generally I tend to watch performance with btop running in a terminal on my main desktop. Following a reboot I noticed that when I ssh to eth0 from another wired host on the same network the return traffic come from wlan0. However I run netplan try the problem goes away, and return traffic defaults to eth0.

# /etc/netplan/50-cloud-init.yaml
network:
version: 2
ethernets:
    eth0:
      dhcp4: no
      optional: true
      addresses:
        - 192.168.1.230/24
      routes:
        - to: default
          via: 192.168.1.254
      nameservers:
        addresses: [8.8.8.8, 1.1.1.1]
wifis:
    wlan0:
        dhcp4: no 
        optional: true
        addresses:
          - 192.168.1.231/24
        nameservers:
          addresses: [8.8.8.8, 1.1.1.1]
        access-points:
          "MyWiFi":
              password: "MyWiFiPassword"

How can I force eth0 and avoid the need for the cli foo?

zwets avatar
us flag
Turn off the WiFi on the box when its ether is connected? ([Here is a script](https://askubuntu.com/questions/1271491/disable-wifi-if-lan-is-connected)). Otherwise add `from: 192.168.1.230` to the `routes:` clause.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.