{"id":24283612,"url":"https://github.com/containercraft/ccio-openwrt","last_synced_at":"2025-09-25T03:30:47.512Z","repository":{"id":43271213,"uuid":"159083134","full_name":"ContainerCraft/ccio-openwrt","owner":"ContainerCraft","description":"CCIO Distribution of OpenWRT in LXD","archived":false,"fork":false,"pushed_at":"2020-03-29T19:00:21.000Z","size":3499,"stargazers_count":13,"open_issues_count":2,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-07T02:13:41.098Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ContainerCraft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-25T23:06:21.000Z","updated_at":"2023-05-28T14:52:45.000Z","dependencies_parsed_at":"2022-09-06T07:54:28.217Z","dependency_job_id":null,"html_url":"https://github.com/ContainerCraft/ccio-openwrt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ContainerCraft/ccio-openwrt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContainerCraft%2Fccio-openwrt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContainerCraft%2Fccio-openwrt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContainerCraft%2Fccio-openwrt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContainerCraft%2Fccio-openwrt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ContainerCraft","download_url":"https://codeload.github.com/ContainerCraft/ccio-openwrt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContainerCraft%2Fccio-openwrt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276853751,"owners_count":25716190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-25T02:00:09.612Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-16T04:16:59.293Z","updated_at":"2025-09-25T03:30:47.255Z","avatar_url":"https://github.com/ContainerCraft.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenWRT LXD Gateway on bare Ubuntu OS\nDefault LAN IP: 192.168.1.1    \nDefault Credentials:    \nUsername: root    \nPassword: admin    \n    \nTested on Ubuntu Bionic 18.04 LTS   \nInstructions intended for use on clean Ubuntu OS with one physical nic port (ens3 in this guide)   \nNOTICE: No previous configuration of network/ovs/lxd accounted for.\n    \n#### 00. Add CCIO remote\n````sh\nlxc remote add ccio https://images.braincraft.io --public --accept-certificate\n````\n\n#### 01. Install Packages\n````sh\napt update \u0026\u0026 apt upgrade -y \u0026\u0026 apt dist-upgrade -y\napt install -y openvswitch-switch ifupdown lxd\n````\n\n#### 02. Eliminate netplan due to ovs support (BUG: 1728134)\n````sh\nsed 's/^/#/g' /etc/netplan/*.yaml\n````\n\n#### 03. Create default \"interfaces\" file\n````sh\ncat \u003c\u003cEOF \u003e/etc/network/interfaces\n# /etc/network/interfaces\nauto lo                                                                                   \niface lo inet loopback\n\n# Run interfaces.d config files\nsource /etc/network/interfaces.d/*.cfg\nEOF\n````\n\n#### 04. Create wan bridge interfaces file\n````sh\ncat \u003c\u003cEOF \u003e/etc/network/interfaces.d/wan.cfg\nallow-hotplug wan\niface wan inet manual\nEOF\n````\n\n#### 05. Create ens3 interfaces file\n###### (Substitute 'ens3' for your devices physical port)\n````sh\ncat \u003c\u003cEOF \u003e/etc/network/interfaces.d/ens3.cfg\n# Raise ens3 on ovs-br 'wan' with no IP\nallow-hotplug ens3\niface ens3 inet manual\nEOF\n````\n\n#### 06. Create lan bridge interfaces file\n````sh\ncat \u003c\u003cEOF \u003e/etc/network/interfaces.d/lan.cfg\nallow-hotplug lan\niface lan inet manual\nEOF\n````\n\n#### 07. Create mgmt0 interfaces file\n````sh\ncat \u003c\u003cEOF \u003e/etc/network/interfaces.d/mgmt0.cfg\n# Raise host mgmt0 iface on ovs-br 'lan' with no IP\nallow-hotplug mgmt0\niface mgmt0 inet static\n  address 192.168.1.5\n  gateway 192.168.1.1\n  netmask 255.255.255.0\n  nameservers 192.168.1.1\n  mtu 1500\nEOF\n````\n\n#### 08. Create WAN Bridge \u0026\u0026 add WAN port to bridge\n````sh\novs-vsctl add-br wan -- add-port wan ens3\n````\n\n#### 09. Generate unique MAC address for mgmt0 iface\n````sh\nexport HWADDRESS=$(echo \"$HOSTNAME lan mgmt0\" | md5sum | sed 's/^\\(..\\)\\(..\\)\\(..\\)\\(..\\)\\(..\\).*$/02\\\\:\\1\\\\:\\2\\\\:\\3\\\\:\\4\\\\:\\5/')\n````\n\n#### 10. Create LAN Bridge \u0026\u0026 add LAN Host MGMT0 Virtual Interface to Bridge\n````sh\novs-vsctl add-br lan -- add-port lan mgmt0 -- set interface mgmt0 type=internal -- set interface mgmt0 mac=\"$HWADDRESS\"\n````\n\n#### 11. Initialize LXD\n````sh\ncat \u003c\u003cEOF | lxd init --preseed\nconfig:\n  images.auto_update_interval: \"0\"\ncluster: null\nnetworks: []\nstorage_pools:\n- config:\n    size: 64GB\n  description: \"\"\n  name: default\n  driver: btrfs\nprofiles:\n- config: {}\n  description: \"\"\n  devices:\n    eth0:\n      name: eth0\n      nictype: macvlan\n      parent: lan\n      type: nic\n    root:\n      path: /\n      pool: default\n      type: disk\n  name: default\nEOF\n````\n\n#### 12. Create OpenWRT LXD Profile\n````sh\nlxc profile copy default openwrt\nlxc profile set openwrt security.privileged true\nlxc profile device set openwrt eth0 parent wan\nlxc profile device add openwrt eth1 nic nictype=bridged parent=lan\n````\n\n#### 13. Launch Gateway\n````sh\nlxc launch bcio:openwrt gateway -p openwrt \u0026\u0026 sleep 30 \u0026\u0026 lxc list\n````\n\n#### 15. Reboot host system \u0026 inherit!\n````sh\nreboot\n````\n\n## FINISHED!!\nFind your WebUI in a lan side browser @ 192.168.1.1    \n    \n    \n---------------------------------------------------------------------------------    \n    \n    \n## ProTip 1:\nEnable Luci WebUI on WAN port 80\n````sh\nlxc exec gateway -- enable-webui-on-wan'\n````\n\n    \n    \n## ProTip 2:\nUse as physical network gateway by adding 2nd physical NIC to ovs bridge 'lan'    \n(Substitute 'ens6' for your devices physical port)    \n    \n#### Create ifupdown config for physical lan port\n````sh\ncat \u003c\u003cEOF \u003e/etc/network/interfaces.d/ens6.cfg\n# Raise ens6 on ovs-br 'wan' with no IP\nallow-hotplug ens6\niface ens6 inet manual\nEOF\n````\n    \n#### Add physical lan port to ovs bridge 'lan'\n````sh\novs-vsctl add-port lan ens6\n````\n    \n    \n---------------------------------------------------------------------------------    \n# CREDITS:\n  - https://github.com/openwrt\n  - https://github.com/mikma/lxd-openwrt\n  - https://github.com/DavBfr/lxd-openwrt\n  - https://github.com/melato/openwrt-lxd \n  - http://www.gnuton.org/blog/2016/02/lxc-on-openwrt/\n  - https://forum.archive.openwrt.org/viewtopic.php?id=67358\n  - https://discuss.linuxcontainers.org/t/run-openwrt-inside-lxd/1469\n  - https://www.reddit.com/r/openwrt/comments/7c9kkr/openwrtlede_in_docker_x86_64/\n  - https://discuss.linuxcontainers.org/t/lxd-success-on-openwrt-privileged-containers-but-problems-with-unprivileged/1729\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontainercraft%2Fccio-openwrt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcontainercraft%2Fccio-openwrt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontainercraft%2Fccio-openwrt/lists"}