oofnikj / docker-openwrt

OpenWrt running in Docker
GNU General Public License v2.0
310 stars 63 forks source link

Question: How to use it for routing between subnets ? #23

Closed guny74 closed 3 years ago

guny74 commented 3 years ago

Hello,

I have a question. I use a "guest Wifi" to secure my home net from "smart home IP camera". My main router does not allow connecting to the "guest wifi" from home net.

I use a rpi 4 under Docker.

But for Live stream, i want to connect to the camera in subnet. So my idea was, to activate the wlan (in the docker container of the openwrt) with a connection to "guest wifi" an configure routing/Firewall between the subnets.

I have no idea how to start....

On default running in an container using mcvlan ip, I get an HXR timeout error on showing interface....

Any idea how I can achive my work ?

Thank you

Regards

oofnikj commented 3 years ago

Hi, not sure I understand your situation. Are you using docker-openwrt on your RPi 4 as your main router that is broadcasting more than one SSID? Or two separate routers for each network?

There shouldn't be any functional difference between using OpenWrt natively vs. in Docker on your RPi. If you want to access a device on your camera network from a device on your main network, you must ensure that your firewall rules and routing configuration allow for it.

You may find one of my write-ups, VLANs and wifi, helpful.

guny74 commented 3 years ago

Hello,

I think my first idea was rubbish....

I will keep my main router (does not allow routing between the home net and guest wifi net). So know I think I neet an device with one net card in the home net and one wifi connetion at the wifi net. The device (open wrt docker ?) has to make a 1:1 NAT for each device i want to access in the guest wifi.

I think I could do this with openwrt in a docker, but I think it does not run properly. So first I want to start the openwrt, on start I see the following errors

2021-03-28T11:59:42.703763600Z Failed to resize receive buffer: Operation not permitted

2021-03-28T11:59:42.725690058Z RTNETLINK answers: Operation not permitted

2021-03-28T11:59:42.727558355Z RTNETLINK answers: Operation not permitted

2021-03-28T11:59:42.739645418Z Press the [f] key and hit [enter] to enter failsafe mode

2021-03-28T11:59:42.739714381Z Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level

2021-03-28T11:59:45.828343068Z Failed to send flush request: Operation not permitted

2021-03-28T11:59:45.836543480Z RTNETLINK answers: Operation not permitted

and at many menus e.g. network --> interfaces I get an HXR time out.

I use the ofnik/openwrt:19.07.7-armvirt-32 ready image

Is there a documentation about command & parameter to start the docker container ?

Thanks

Regards

guny74 commented 3 years ago

Hello,

On "menu e.g. network --> interfaces I get an HXR time out.

Any idea ?

I also have a deeper look at the system logs

an see that the "dnsmasq" crashes in a loop.... also iny Idea ?

I there an other way / image to going on to my "project" ?

Thatnk you.

Reagards / Happy eastern

Thorsten

oofnikj commented 3 years ago

Hi @guny74, I hope you have been able to figure out your issue. Please re-open this issue or alternatively open a new one if you continue to have problems.

hllhll commented 3 years ago

For your original question: The default configuration of this project is having LAN and WLAN bridged; The solution is to remove the bridging and handle them independently (static IP, DHCP for the guest wifi, etc.), it worked for me.