How to use wifi and lan?

Hello,

after reading the scetion Setting up your network connection and fumbling around for a while, i was not able to figure out how to use wifi and lan simultaneously.

What i want to do is the following:

  • using the lan port with a static IP address to connect to my NAS via nfs for media files.
  • using the wifi port with a DHCP address to connect to my router for internet connection.

The NAS is not connected to the router and should have no connection to the internet. Both networks have different IP adress and netmask.

Another - less preferred - option is, having both networks on one lan cable, using two virtual interfaces (i.e. eth0:0 and eth0:1) with different IP adress and netmask.

Any help is very appreciated.

Regards,
nevercomeback

That is very sad news!

Would you pick this up as a feature request?

Regards,
nevercomeback

This is dependant on connman.

I have a patch for it, but it needs more work.

It’s on the list. Feel free to build connman-osmc and implement the support or have a go. We want to run scripts via their interface ideally.

But there are more challenges, like implementing real if-up.d support which acts on interface and not for all devices.

Thank you in advance!

That would make OSMC the first mediacenter-distro to cope with this challenge. XBIAN and OpenELEC are also not able to handle more than one interface so far.

I got a solution!

Sadly it is not possible with OSMC, but it is with Raspbian! With hopefully kind permission of the OSMC Team i’d like to explain my workaround:

Raspbian uses dhcpcd to configure the Interfaces which is capable to handle multiple interfaces.

After installing Raspbian and following the below-mentioned tutorials, I got it running…

So, I got something running but the intention was to have OSMC doing the job. May I suggest to use dhcpcd for configuring the interfaces within OSMC like raspbian does?

Apologies, but I think I misread your post, as I saw a comment from @DBMandrake about if-up support, and that’s what I was referring to when I said I had a patch, albeit needing some more work.

OSMC uses ConnMan to configure network interfaces. dhcpd is too command line interface oriented for the typical use case, and we must make things as easy as possible for the majority of users. With that said, it sounds like you are trying to get tethering working? If your network device supports this, you can enable tethering in My OSMC -> Network -> Wireless.

You can likely also adjust network settings manually with connmanctl to achieve what you are after.

Sam

@sam_nazarko I don’t think tethering is what he’s after.

Oh, he wants both technologies on at once. This can be done manually, but ConnMan does not support enabling both connections by default. A simple rc.local or init script can set up the second connection, without issue.

Hi Sam,

no, tethering is definitely not my intention. I just want to keep two networks separated while using them via two interfaces simultaneously.

If you want to make things as easy as possible for the majority of users dhcpd might not be the worst choice. It seems to be very well preconfigured in raspbian. Quite honestly I had only to enter SSID and PSK into /etc/wpa_supplicant/wpa_supplicant.conf to get wifi interface running, wired interface was running out of the box…

…I don’t do any programming at all, but I believe you already transfer the user input (such as SSID, PSK, manual IP…) from GUI into some config files, do you?

Connman is the network manager in use in OSMC. Replacing that with or running dhcpd in conjunction with, is not a trivial thing. Demand for such a niche use case is also almost non existent. :wink:

Just type

connmanctl
help

And you should be able to work out how to get it working.

When I understand your requirements a bit better, we can likely implement some GUI support. It sounds like you just want to configure one interface as DHCP and one as WiFi. You can already do this in My OSMC -> Network.

@ActionA: I’m quite unsure about the niche use case. I’m on the hunt for some days, getting a solution and got pretty often indicators for a demand, when people got attentive and understood what it is meant for…

@sam_nazarko: You almost got me. The wifi interface with DHCP for internet, the wired interface with static IP for NAS. Both used at once.

When I tried with My OSMC -> Network I was able to configure what I want, but one interface only. I wasn’t able to configure both.

Configure WiFi. Unplug it.
Configure Ethernet.

Plug both in.

To enable both at once:

sudo connmanctl
scan wifi

You’ll get a list of services.

Add connmanctl connect ....................................... to /etc/rc.local.

thank you, I’ll try that, but have to overwrite my running raspbian…

…think I’ll get a second SD for alternative OSMC installation in a few days.

Keep tuned, I’ll report!

This “niche” application is exactly what I’m looking for ! But, can’t quite understand all the technical jargon in this post :frowning: I have OSMC fresh install on my Pi 2. I can get wired connection to my NAS (through a switch, NAS and Pi setup with static IP’s) and I get wifi connection to my router. But, if I have both enabled in the OSMC network setting and try and play a video off the NAS, OSMC just hangs :frowning:

If wireless disabled, then videos play off wired connection no problem, but now I have no internet connection…