NETWORK, advanced beginner - using 2 active networking connections at the same time in Max?

Pierre Alexandre Tremblay's icon

Hello

I wonder if we can select which connection UDPsend is using. I know we can select IP and port, but it would be fantastic to be able the networking connection (en0, en1, etc)

Any pointers welcome

pa

Kasper's icon

Hi PA

not sure if it answers your question, but I was able to access from one max patch 2 different networks (one Wi-Fi the other ethernet cable). A little tricky to set-up (the order of connections, changing pref etc) but once it is set up it is stable (I used it many times on stage and much more during rehearsals, never crashed). if this was your question, I can send you more precise info. Best
Kasper

Pierre Alexandre Tremblay's icon

Kasper, this is exactly what I want to do and I'm not afraid of tricky setups ;-)

Send along!

Thanks

Hugobox's icon

Normally your OS routes the packets to the right interface but in some cases like broadcasting, packets can go in the wrong tube. On windows you can play with the Automatic Metric feature (http://www.ezlan.net/metrics.html) to set an order of priority between different ethernet interfaces. TBH I havn't fully tested this so I'm interested in knowing how you guys manage.

Jesse's icon

You'd need to provide a bit more context to what you're trying to accomplish and why.

Typically your computer's routing table would properly forward packets to the appropriate interface based on the subnet/mask that each interface is on. In other words, in a simplified example:

en0 is at 192.168.1.100, mask 255.255.255.0
en1 is at 10.0.0.10, mask 255.255.255.0

If you send a packet to IP address 192.168.1.200 it should be automatically routed via en0
If you send a packet to IP address 10.0.0.20 it should be automatically routed via en1

If you're trying to communicate with IP address outside of your subnet then these would likely be routed via what you've selected as the primary interface. This is OS dependent.

Kasper's icon

hi PA

in a project I needed to have 2 networks : A/ one based on an ethernet cable (this one was for the lights which were driven by a LanBox connected to the computer) and B/ a wi-fi connection between 3 computers. It was done with a Mac. So...

_I desactivate the wi-fi, go to "network preferences", redefine the order of services (définir l'ordre des services - since it is a french OS) and put Ethernet on the top of the line. Validate (or is it apply ?). Then I connected my network (Lan box) - in my case it was 192.168.1.76 777, but this is probably just because this is what the lanbox wants to see. This one is then rock solid, never had any problem
_then activate the wi-fi, and in network prefs redefine the order of services again, putting wi-fi on top, and apply. And a second network works ! (it was 169.254.230.20 7000 in my case)

Took me some time to find it, but then it always was super solid. Hope it helps
kasper

Kasper's icon

just forgot to say that i was sending data (call it PING) to the 2 networks just to keep them alive. Not sure if it is needed, but did not hurt.

Pierre Alexandre Tremblay's icon

Hello

A quick update: it all works now. The two routers have to have different IP addresses, obviously. The order in the system pref is important as Kasper mentioned. Interestingly, I discovered a lot of trouble shooting in the terminal. Commands like ifconfig to see the list of 'interfaces' and their status. And 'route' to eventually get completely manual and route a given ip to a specific 'interface'. and ping, to check that it works ;-)

The auto-routing made by the re-ordering of the 'interfaces' as proposed by Kasper works perfectly though.

Thanks all for your help.

p