Two NICs, Two Networks through one Docker? Possible?


Recommended Posts

So I came across a video back in december from a YTuber name SpaceInvader One who did a video about using unraid as an IP camera system.  This particular video was about setting up the Shinobi IP camera app in a docker container to be configured either using a VLAN on a managed switch or through a 2nd NIC on a separate network from the main LAN with an un-managed switch.  I went with the latter as I already had a spare NIC and old un-managed POE switch.  I popped in my card and is now eth1 in unraid. As well as the switch and a test IP camera.  Unfortunately from there I've spent hours fiddling around with no success in getting Shinobi to work as it did in the YT video.  The video itself focuses more on setting up a VLAN instead of using a 2nd NIC. This setup was appealing to me as I liked the fact of having the non-name cameras not having direct access to my main LAN or the internet.

The problem I'm having is when after I install the docker container and go through the setup.  When I to open the WebUI, the browser won't connect to the IP i've set for eth1 / Br1.  When in bridge or host I can access Shinobi as I do with my other installed docker (Plex, Krusader, Cadvisor).  What am I doing wrong here?

Inkedscreencapture-192-168-0-125-Settings-NetworkSettings-2020-01-31-01_03_03_LI.thumb.jpg.254a1588214f07a36eba1a0d93f1097e.jpg

 

screencapture-192-168-0-125-Docker-2020-01-31-01_02_26.thumb.png.c8c3d15068cf9fdd441875c90101a3bb.png

 

screencapture-192-168-0-125-Settings-DockerSettings-2020-01-31-01_02_51.thumb.png.4d94a776260fcd213765fed70a24cafb.png

 

screencapture-192-168-0-125-Docker-UpdateContainer-2020-01-31-01_32_37.thumb.png.06775456ca5a8822469f1bdf10e24e4b.png

Edited by TheBawse
Link to comment

You created a second network 192.168.5.x. For Unraid to be able to reach this network, it will use your router (gateway) to get there.

 

In other words you must configure your router to participate and relay (route) between the two networks 192.168.0.x and 192.168.5.x

 

Another approach is to reserve eth1 solely for Docker containers and these containers reside in the same network as Unraid itself.

Do the following under Docker setttings (stop the Docker service):

 

1. Uncheck the assignment of eth0 (eth0 is not used for Docker)

2. Specify the assignment of eth1 as 192.168.0.0/24 with gateway 192.168.0.1.

3. Define a DHCP pool for br1 which does not conflict with your router's DHCP. Eg. 192.168.0.128/25

4. Give your container a fixed IP address, e.g. 192.168.0.10

 

Link to comment

Hi,

I don't want my dockers to be run through eth1, only specifically the Shinobi docker.  I have other dockers like PLEX that are accessible by several media devices in my home through eth0 that also need internet access.  I wanted a new separate network (eth1) through a 2nd NIC just for the IP cameras and have them isolated from all my devices and the internet of eth0.  I only wanted Shinobi to have access to eth1 through unraid and I would in turn block all devices of eth1 from seeing any network past unraid by blocking IP's in the Shinobi settings.  Sorry if I'm not making sense.  I've never been great with custom network setups but I hope this diagram I made might clarify what my end goal is.  Thanks for your help.

unraid.png.b9b5ef567f7bf879b206307b6eb0ce23.png

Edited by TheBawse
Link to comment
36 minutes ago, TheBawse said:

I wanted a new separate network (eth1) through a 2nd NIC just for the IP cameras and have them isolated from all my devices and the internet

Do the following:

 

- In network settings assign eth1 with address 192.168.5.1 /24 and NO gateway

- In docker settings check the eth1 network (no modifications required)

- In docker settings: Enable host access to custom networks

- Configure your docker container to use br1 and a fixed address, e.g. 192.168.5.10

 

Link to comment
On 1/31/2020 at 11:31 AM, bonienl said:

Do the following:

 

- In network settings assign eth1 with address 192.168.5.1 /24 and NO gateway

- In docker settings check the eth1 network (no modifications required)

- In docker settings: Enable host access to custom networks

- Configure your docker container to use br1 and a fixed address, e.g. 192.168.5.10

 

Thanks Craftsman.  I finally found time to try the settings in your post.  I still cannot get it to work.  This issue I'm now having is when I start the docker and click to open the WebUI.  The browser times out on the set IP address (192.168.5.3:8080) and the shinobi login won't come up.


Inkedscreencapture-192-168-0-176-Settings-NetworkSettings-2020-02-08-02_12_11_LI.thumb.jpg.93875b61592464384478cfb36dc3dfe4.jpg

 

1171136089_Screenshot(11).thumb.png.9810e6ae96e2c768f918852db141c6b5.png

 

801742154_Screenshot(12).thumb.png.90c1102522b7e481e8cd64e4ef221371.png

Edited by TheBawse
Link to comment
  • 2 months later...
  • 2 months later...

You have to install the FireFox docker on Unraid.

Then use that to connect to the Webui of the dockers you connected to your secondary lan.

 

This works if you add the second lan as a "ip4 custom network" and set "Host access to custom networks: Enbled" in the Docker setting.

Edited by jamesbaker
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.