Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi-subnet local network sharing #2674

Closed
altaic opened this issue Apr 15, 2021 · 8 comments
Closed

multi-subnet local network sharing #2674

altaic opened this issue Apr 15, 2021 · 8 comments

Comments

@altaic
Copy link

altaic commented Apr 15, 2021

Issue report

Operating system: macOS 11.2.3

App version: 2021.2

Issue description

Local network sharing only works for a single subnet, but many local networks have multiple subnets, e.g. 192.168.0.5 needs to communicate with 192.168.23.2. Please add a setting for the local network netmask, or at least default to /16.

@faern
Copy link
Member

faern commented Apr 16, 2021

If you enable local network sharing you can already send traffic to any private IP range. So this is already possible. You just need to set up your routing table correctly.

The VPN tunnel sucks up any traffic that is destined for the otherwise default route. So if you are on the network 192.168.0.0/24 and want to communicate with 192.168.1.0/24 but you don't have a dedicated routing table entry for it then it will not work. Because your LAN is not properly set up. In that case you rely on the traffic being sent to your router and from there correctly routed to your other local subnet.

If your router that bridges your two subnets is at 192.168.0.1 and you want to allow talking to all of 192.168.1.0/24 then run this in a terminal:

sudo route -n add -net 192.168.1.0/24 192.168.0.1

@faern
Copy link
Member

faern commented Apr 28, 2021

I'm closing this as it's not a missing feature. Or at least should not be. It should work correctly if you set routes correctly. Please re-open if there is something preventing this from working as intended.

@mickdekkers
Copy link

Here's the command for Windows in case anyone else needs it:

route -p ADD 192.168.1.0 MASK 255.255.255.0 192.168.0.1

Adjust the subnet, the mask and router IP respectively as you need them 🙂

@ghost
Copy link

ghost commented Jul 31, 2022

Is there any way to set up a routing table on Android or any other workaround? Thanks!

@faern
Copy link
Member

faern commented Jul 31, 2022

Make your router advertise it? If your router provides access to multiple networks, and you use DHCP in your network, you probably want to make your router advertise all those networks

@ghost
Copy link

ghost commented Aug 1, 2022

Thanks a lot.
However, I do not know much about networking and am learning.
I would like to try this on a router (openwrt),
but I don't know how to achieve this, can you please help me?
What do you mean by Make my router advertise it?

I searched and found that something called BGP...is that what you are talking about?

@faern
Copy link
Member

faern commented Sep 9, 2022

No, BGP is something different. You don't want to use BGP on your LAN :)

I'm not that familiar with OpenWrt, but this looks like what you want: https://www.reddit.com/r/openwrt/comments/pywj4d/question_how_to_push_route_table_routes_down_to/

@SimonBrazell
Copy link

FYI -

I got it working via OpenWRT settings, add the following to the /etc/config/dhcp file for the interface you want the routes pushed from (e.g. lan):

config dhcp 'lan'
	option interface 'lan'
        ...
	list dhcp_option '249,192.168.3.0/24,192.168.1.1'
	list dhcp_option '121,192.168.3.0/24,192.168.1.1'

The above would be similar to running this on the client device - sudo route -n add -net 192.168.3.0/24 192.168.1.1.

These can be added via Luci too at Interfaces » lan » DHCP Server » Advanced Settings » DHCP-Options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants