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

Support for tunneling between two instances #13

Closed
elupus opened this issue Feb 15, 2019 · 13 comments
Closed

Support for tunneling between two instances #13

elupus opened this issue Feb 15, 2019 · 13 comments
Assignees
Milestone

Comments

@elupus
Copy link

elupus commented Feb 15, 2019

Think you could look at tunneling between two instances?

PS. Why the need for raw sockets? Is it spoofing source ip?

@alsmith
Copy link
Owner

alsmith commented Feb 16, 2019

In theory it ought to work, e.g. if you have net1 - A - net2 - B - net3 and run the relay on 'A' and 'B' then devices on net1 ought to be able to see devices on net3.

But sending packets over a longer distance where you're not necessarily in control of the routers in between isn't something that I've considered up to now. Do feel free to submit a patch, however!

raw sockets are because we muck around with the ethernet macs.

@elupus
Copy link
Author

elupus commented Feb 16, 2019 via email

@alsmith
Copy link
Owner

alsmith commented Feb 16, 2019

It actually works as-is over openvpn... for example I can run the Sonos app on my mac, connect via tunnelblick and operate the speakers at home using the relay. You'd just have to add 'tun0' to the list of interfaces that it listens on, eg

multicast-relay.py --interfaces eth0 eth1 tun0

@elupus
Copy link
Author

elupus commented Feb 16, 2019 via email

@elupus
Copy link
Author

elupus commented Feb 16, 2019

Just for reference. I actually did start on this 3 years ago https://github.com/elupus/ssdpgateway had forgotten I put it on github :)

Though now that I look at it I didn't get so far.

@agillis
Copy link

agillis commented Oct 7, 2019

I would be interested in this as well. The is why we need this feature. Imaging two subnets on the same router 10.0.1.x and 10.0.2.x you can not replace or modify the router but you want Sonos on both networks. You put a small computer on each network running the bridge and it bridges the traffic over to the other network. I would pay you to develop this feature if you are interested.

@alsmith
Copy link
Owner

alsmith commented Nov 21, 2019

Let me see what I can do - tunneling between instances ought to be fairly straightforward in fact...

@alsmith
Copy link
Owner

alsmith commented Nov 25, 2019

Hi @elupus / @agillis - engineering work has started on https://github.com/alsmith/multicast-relay/tree/remoteRelay

I haven't been able to test it at the moment, if you feel brave then have a go and do report back, otherwise I'll have to chance to test it out tomorrow evening.

@alsmith alsmith self-assigned this Nov 25, 2019
@alsmith alsmith added this to the 1.0 milestone Nov 25, 2019
@alsmith
Copy link
Owner

alsmith commented Nov 26, 2019

The code works and I can see packets being broadcast around the place. I don't quite have the ability to test this on fully-separate networks, however. @agillis ?

@alsmith
Copy link
Owner

alsmith commented Nov 28, 2019

Testing complete - I found a couple of bugs that needed to be fixed but it's now stable and it does the job. One wrinkle is that if the TCP connection between the instances goes down, it doesn't automatically recover. That'll be an enhancement for a later date.

@alsmith
Copy link
Owner

alsmith commented Nov 28, 2019

PR #22 merged.

@alsmith
Copy link
Owner

alsmith commented Nov 28, 2019

In particular, given that my testing environment consists of netA - server - netB - pi - VPN - pi - netC, where one multicast-relay is running on the server relaying packets between netA and netB, and the two Pis are running in a --remote / --listen config, I can see packets being emitted on netC that originated on netA, and vice versa. Perfect !

@elupus
Copy link
Author

elupus commented Dec 1, 2019

Nice! I will have a look!

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

No branches or pull requests

3 participants