oofnikj / docker-openwrt

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

Simpler version without interfaces #6

Open shivarammysore opened 4 years ago

shivarammysore commented 4 years ago

Hi, Good work on the container. It is very appropriate. It would be great to see how I can reconfigure with out interfaces so that I can run this as a container. Example:

$ docker run -it -name openwrt --network="host" --privileged openwrt_1:latest

We could add --volume ${PWD}:/etc/ to mount additional configuration as needed.

I run Open vSwitch as a container and it would be great to use OpenWRT similarly.

Any pointers to simplify configuration that you have to make it work like I requested would be great.

Thanks

oofnikj commented 4 years ago

Hi @shivarammysore, I'm glad you found it useful. I've thought about adding a volume mount to make persistence more feasible. Perhaps I will do that in the future. Since OpenWrt is such a highly versatile piece of software, without knowing more about what you're trying to achieve it will be difficult to give helpful advice.

You should encounter no issue running the container as you specified. I don't know how useful a router OS will be without interfaces -- unless you're planning on attaching interfaces through some other method.

Thanks for sharing your Open vSwitch project, it's very interesting.

shivarammysore commented 4 years ago

Hi @oofnikj Thanks for the response.
My interest is to run OpenWRT as a container on Fedora CoreOS. I have opened a bug https://github.com/openwrt/docker/issues/56 - may be you have some thoughts on how I can resolve the issues.

When we run OpenWRT as a container, I want to think about using the eth0 as a management interface to the box itself and doubles down to be the WAN interface for the OpenWRT router. Rest of the physical interfaces will be LAN ports. Note that as this is a container, we can even add veth interfaces on the box and managed by OpenWRT. We may need to punch a hole for Web Configuration (luci) access from the WAN port.

I found that mounting the /etc/config directory would make configuration to be loaded from a persistent storage. You can correct me if I am wrong.

Thoughts?

oofnikj commented 4 years ago

Hi @shivarammysore, it looks like you are doing your network configuration on the host, and you want to preserve that network configuration for OpenWrt. In this case I think running with --network=host is a valid option, making much of this script irrelevant for you.

I suggest experimenting with the command-line options for docker run and using the base openwrtorg/rootfs image available on Docker Hub.