This repository includes a script and sample config file for setting up openwrt as docker container on host machine via podman. The script generates a systemd service unit file along with unit.start and unit.stop scripts.
- Download and export openwrt rootfs tarball (generic-ext4-rootfs.img.gz),
- Adjust config.yaml accordingly (check the sample config.yaml for details),
- Run gen_script.py to generate unit.start, unit.stop and <config.service_name>.service,
- Install and enable the generated <config.service_name>.service. For more details, please refer to the sample config.yaml.
- Due to the behavior mentioned in moby/moby#34337, the fw3 doesn't work as expected. Please include the preboot.init.d into /etc/init.d and enable it to avoid this issue.
- Please load the needed kernel modules on the host machine before start the openwrt container. I may implement loading these modules on start in the future.
If you want to change sysctl options related to network, please change it by executingUse config.sysctl directories in the config.yaml to config sysctl params.ip netns <netns> exec sysctl -w <key>=<value>
. I may include these as optional params in the config in the future.