I have configured a network with the following topology:
Gateway (10.0.0.1) | tun0 | |-----------------------| 10.0.0.0/16 | | | tun0 | tun0 Host A (10.0.1.1) Host B (10.0.2.1) | wlan0 | wlan0 | | | 10.0.1.0/24 |----------------| 10.0.2.0/24 | | | | wlan0 | wlan0 | wlan0 Client A (10.0.1.2) Client B (10.0.2.2) Client C (10.0.2.3)
At the moment, hosts A and B can ping the gateway and each other. Also. each client can ping the host directly connected to it as well as the other clients connected to that host. However, I would like each device to be able to ping all other devices on the network (e.g., Client A can ping Client B, Host A can ping Client C, et cetera).
I have attempted several methods of going about configuring each host to allow packet forwarding between clients, other hosts, and the gateway. The first method I have tried is using iptables on each host to forward traffic between the subnets. While I have had success using tutorials such as this one on Adafruit to allow clients to ping the hosts and the gateway, these did not allow other hosts to ping the clients. I also tried solutions such as this one to route traffic between subnets, but they seem to not work with overlapping subnets. I also attempted to create a bridge interface on each host that bridged tun0 and wlan0, with no success.
I am open to changing the configuration of IP addresses on this network provided the ability for all devices to connect to all other devices is preserved.