Score:0

Seeking help with routing internet connection from wifi to client in ethernet network using netplan

al flag

Wondering if I might be able to get some help using netplan. I have it setup as I think it should work, using an Odroid C2 running Ubuntu 22.04.1 LTS (GNU/Linux 3.16.85-65 aarch64):

internet router <<>> odroid c2's wifi <<>> odroid c2's ethernet <<>> client using fixed ip address

Note: I have enabled ipv4 and ipv6 forwarding in /etc/sysctl.conf

The ip address from the router to the odroid is dynamically set, in the 192.168.0.0 network (currently 192.168.0.154)

The IP address of the client is fixed, in the 10.0.5.0 network (10.0.5.100).

Clients connected to the wifi network can all connect to the odroid via SSH, the client on ethernet can ssh to the odroid too, but there's no internet connection to it.

Below is the netplan setup I am using, referencing the 'Configuring source routing' section here: https://netplan.io/examples/

root@odroid:~# nano /etc/netplan/99_config.yaml

network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
        dhcp4: false
        dhcp6: false
        addresses:
         - 10.0.5.1/24
        routes:
         - to: default
           via: 10.0.5.1
         - to: 10.0.5.0/24
           via: 10.0.5.1 
           table: 101
        routing-policy:
         - from: 10.0.5.0/24
           table: 101
  wifis:
    wlan0:
        dhcp4: true
        access-points:
         "network.name":
           password: "network.password"
        routes:
         - to: 192.168.0.0/24
           via: 192.168.0.1
           table: 102
        routing-policy:
         - from: 192.168.0.0/24
           table: 102

This gives the following routing on the 10.0.5.100 client:

root@odroid:~# ip route | column -t
10.0.5.0/24     dev  eth0         proto  kernel  scope  link    src  10.0.5.1

And on a client on the 192.168.0.0 subnet:

root@odroid:~# ip route | column -t
default         via  10.0.5.1     dev    eth0    proto  static                              
default         via  192.168.0.1  dev    wlan0   proto  dhcp    src  192.168.0.154  metric  600
10.0.5.0/24     dev  eth0         proto  kernel  scope  link    src  10.0.5.1               
192.168.0.0/24  dev  wlan0        proto  kernel  scope  link    src  192.168.0.154          
192.168.0.1     dev  wlan0        proto  dhcp    scope  link    src  192.168.0.154  metric  600

Any help would be much appreciated!

Simon avatar
al flag
I have also been trying to use the 'metric' option to route 'from:' 'via:' and 'to:' between the two subnets, but this displays the same issue. Clients connected to the wifi network can all connect to the odroid via SSH (using either root@10.0.5.1 or root@192.168.0.154), the client on ethernet can ssh to the odroid too (using either root@10.0.5.1 or root@192.168.0.154), but there's no access to the internet passed to it.
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.