qNAP direct wired

My qNAP has 2 LAN interfaces, is there any reason why I can’t connect my Raspberry Pi hard wired over a straight cable to one interface so it has direct access on a made up IP (doesn’t matter it’s not routing) and then use a wifi Dongle to access and control it.

Would OSMC etc. get confused over routing IP with the hard wired non routable network?

and then second interface on the qNAP connected to the normal network for access via my PC etc.

I’m separating them out as where the qNAP, Pi are the only route back to the normal network is over powerline adapters.

This would only work if you configure tethering on OSMC but in that case OSMC would not have any internet access which would trouble your time setting, updating and any addons that need internet access.

Sorry I don’t understand?

Can I not have the LAN Rj45 and a wifi dongle working at the same time or is it a routing traffic issue?

OSMC is designed to automatically switch between wifi and wired depending on the wired cable being plugged in.
The only mode that supports both interfaces active is “tethering” which means Internet on the wired interface and LAN on the WiFi.
If you want something else you would need to configure Connman yourself or use another network manager

There is a further complication. If you want to connect two computers directly to each other, you need a “crossover” cable. This is normally taken care of in the router or switch, but if you don’t connect via a router, you need a special cable.

Both the Pi and QNAP supports Auto MDI-X
http://elinux.org/RPi_Hardware#Components

Interesting. The humble Pi is surprisingly versatile.

Straight/crossover I knew what I meant :slight_smile:

In this post How to use wifi and lan? - #15 by sam_nazarko Sam talks about

sam_nazarko

Jul '16


nevercomeback:

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

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.

So it certainly sounds doable and easy.

I’m also investigating whether I can just plug the Pi and qNAP into the same powerline unit that the traffic doesn’t go out over the power line, this would be simpler and keep the traffic ‘closer’.

I’ve certainly succeeded in getting my Pi to work on ethernet and WiFi at the same time but both interfaces were on the same subnet and using DHCP, so it’s probably doable, though your requirement is more complicated and connman has a tendency to get in the way sometimes.

Unfortunately /etc/rc.local now runs quite early in the boot sequence and connman commands might be ineffective if run there. You can do a small experiment and run /sbin/ifconfig in /etc/rc.local and see what’s up and running when it runs (from the system journal). I only ever manage to see the loopback interface (lo),

If you place a small switch before the powerline adapter, it might give you what you’re looking for without the need for any complicated configuration.

I don’t understand why this is so complicated. Many people here seem to indicate that the Pi can’t operate on both networks simultaneously. Not only is that untrue, but would be SOOOOO un-linux-like to not allow multi-homed operation. And while I’ve never done a Pi/Kodi in the configuration you’re talking about, I’ve set up many a PC running linux to do this.

Let’s call the network and connection that is direct over ethernet between the Pi and the QNap PiNap.

So, if your “real” network that is routable to the internet is 192.168.1.0/24…

Set up the PiNap network on a totally different subnet, say 192.168.3.0/24, statically setting the QNAP’s secondary interface 192.168.3.1 and the PI’s ethernet interface to 192.168.3.2. Set the subnet mask but DO NOT set a default gateway on either end.

Now, configure the wifi on the Pi to access the “real” network, and the QNAP’s primary interface to access to do the same. You can use DHCP or Static here. Just make sure that the Primary Gateway address points to the IP of your router (probably 192.168.1.1).

Then, when adding sources to the Pi, make sure you use the IP of the qNap that is on the PiNap network, 192.168.3.1.

Now, with all this said… I’m not sure what advantage this would give the OP. Just leave them all on the same network and be done with it. The throughput on the wifi connection is likely to be as fast or even faster than the 10/100 Nic in the pi, so I fail to see what advantage this multi-homed setup would give.

Well nobody mentioned that it is not possible to communicate on both interfaces at the same time but the fact is by default OSMC is supporting these two modes:
Default: either wired or wireless interface active
Tethering: Both interface active (wired = wan and wireless = lan)

All other combinations are also clearly possible jut not supported by OSMC by default

Given this sequence:

1 Initially connect via ethernet, then
2 Configure the internal WiFi adapter using connmanctl

I had no problems having two simultaneous interfaces on a pi3 (and across different subnets this time).

osmc@osmc:~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,DYNAMIC,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:00:be:f9 brd ff:ff:ff:ff:ff:ff
    inet 192.168.8.33/24 brd 192.168.8.255 scope global eth0
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,DYNAMIC,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:55:eb:ac brd ff:ff:ff:ff:ff:ff
    inet 192.168.11.70/24 brd 192.168.11.255 scope global wlan0
       valid_lft forever preferred_lft forever
osmc@osmc:~$ ip route
default via 192.168.8.4 dev eth0 
192.168.8.0/24 dev eth0  proto kernel  scope link  src 192.168.8.33 
192.168.8.1 dev eth0  scope link 
192.168.11.0/24 dev wlan0  proto kernel  scope link  src 192.168.11.70 
192.168.11.1 dev wlan0  scope link 

And it survives a reboot without the need for anything in /etc/rc.local or the need for any tethering.

Well the units plug into an AV-500 powerline unit and as I’ve free’d up the TV connection and have a spare port for simplicity I’ll just plug the Pi and qNAP into this and as asked elsewhere the traffic with stay within the switch chip so problem solved.

Thanks all but it’s interesting the complexities of such a simple issue sometimes :slight_smile: