Deploy OpenWrt with Docker ComposeUse Docker to deploy OpenWrt with Docker Compose.jpgUse Docker to deploy OpenWrt with Docker Compose, it's easy to create and manage containers, making it an ideal solution for deploying OpenWrt on embedded devices.Table of Contents FeaturesNetworking InformationThe latest ImageStart to DeployModify OpenWrt login IP Set OpenWrt to bypass mode (SideRouter)Features kiddin9's OpenWrt firmware offers customizable routers with the latest version and kernel, self-built plug-in warehouse, and easy customization.OpenWrt official OpenWrt-22.03 branch version, Kernel 5.15, synchronized with the latest official source code.The original firmware is extremely pure. It only includes basic Internet access functions by default, and plug-ins can be selected online.The self-built plug-in repository includes almost all open source plug-ins.Customize through supes.top without requiring professional knowledge, and generate it in one minute.One-click OTA firmware update in the background.One-click bypass route (SideRouter) and one-click switch IPv6.Supports online installation of all Kmod kernel modules.Replaces Uhttpd with Nginx, supporting reverse proxy, WebDAV, and more.Out-of-the-box (OOTB) feature.Networking Information Before we begin, let's find out the networking information on the Linux system we will be using to deploy OpenWrt.ip routedefault via 10.1.1.1 dev eth0 metric 20210.1.1.0/24 dev eth0 scope link src 10.1.1.97172.17.0.0/16 dev docker0 scope link src 172.17.0.1This command will display the routing table of the system, which includes the default gateway, subnet, and interface information.NameParameterInterfaceeth0Default Gateway10.1.1.1Subnet10.1.1.0/24Enable the NIC (Network Interface Controller) promiscuous mode.This is necessary for the OpenWrt container to access the internet.ip link set eth0 promisc onIf unsure which interface to use, we can run the following command to automatically detect and enable promiscuous mode:ip link set $(ip route | awk '/default/ {print $5}') promisc onTo check the promiscuous mode status, run the following command:ip -d link | grep "promiscuity 1"If the output shows "promiscuity 1", then promiscuous mode is enabled.Download the latest Image Download the latest OpenWrt image via Download or customize the OpenWrt firmware for your device In this scenario, use Docker or LXC type for the architecture of the x86_x64 system. 2023-05-17_081822.pngwget https://supes.top/releases/targets/x86/64/openwrt-04.18.2023-x86-64-generic-rootfs.tar.gz--2023-05-15 16:50:30-- https://supes.top/releases/targets/x86/64/openwrt-04.18.2023-x86-64-generic-rootfs.tar.gzResolving supes.top (supes.top)... 104.21.4.157Connecting to supes.top (supes.top)|104.21.4.157|:443... connected.HTTP request sent, awaiting response... 200 OKLength: 98339727 (94M) [application/octet-stream]Saving to: ‘openwrt-04.18.2023-x86-64-generic-rootfs.tar.gz’openwrt-04.18.2023-x86-64-gen 100%[=================================================>] 93.78M 61.5MB/s in 1.5s2023-05-15 16:50:32 (61.5 MB/s) - ‘openwrt-04.18.2023-x86-64-generic-rootfs.tar.gz’ saved [98339727/98339727]Once the image is downloaded, import it into Dockerdocker import openwrt-04.18.2023-x86-64-generic-rootfs.tar.gz supes_openwrtsha256:a31010a2bdc1b008522980d94da145883b663fb2fc86e91eacb85f22b0850cd0Verify that the image has been imported successfullydocker imagesREPOSITORY TAG IMAGE ID CREATED SIZEsupes_openwrt latest 36f25cd1cee7 6 seconds ago 275MBStart to Deploy Using a Docker Compose file to define our container configuration. Create a new file named "docker-compose.yml" with the following YAML code:cat >> docker-compose.yml << EOF version: '3.8' services: openwrt: image: supes_openwrt container_name: openwrt command: /sbin/init privileged: true restart: always networks: openwrt-macvlan: ipv4_address: 10.1.1.11 networks: openwrt-macvlan: driver: macvlan driver_opts: parent: eth0 ipam: config: - subnet: 10.1.1.0/24 gateway: 10.1.1.1 EOFThis Docker Compose file defines a single service named "openwrt" that uses the "supes_openwrt" image we imported earlier. Specifies that the container should be run in privileged mode and restarted automatically if it stops. Defines a network named "openwrt-macvlan" that uses the "macvlan" driver to create a virtual network interface for the container. The network is assigned an IP address of 10.1.1.11 with a subnet of 10.1.1.0/24 and a gateway of 10.1.1.1.To start the deploymentdocker compose up -d[+] Running 2/2✔ Network root_openwrt Created ✔ Container openwrt StartedTo check the status of the container, run the following command:docker compose psIf everything is working correctly, you should see the "openwrt" service running with the status.NAME IMAGE COMMAND SERVICE CREATED STATUS PORTSopenwrt supes_openwrt "/sbin/init" openwrt About a minute ago Up About a minuteModify OpenWrt login IP Access the OpenWrt containerdocker exec -it openwrt shBusyBox v1.35.0 (2023-04-30 14:20:01 UTC) built-in shell (ash)The default login IP is 10.0.0.1. Use the IP 10.3.3.11 instead, and adjust it according to your personal situation.sed -i 's/10.0.0.1/10.1.1.11/' /etc/config/network && /etc/init.d/network restartSet OpenWrt to bypass mode (SideRouter) Use the new IP address 10.1.1.11 login to OpenWRT via Browser and set up SideRouter mode.Default login password : root2023-05-16_114018.png2023-05-16_114336.pngConclusion It supports one-click updates, bypass route, IPv6 switch, and online installation of all Kmod kernel modules. It replaces Uhttpd with Nginx, supporting reverse proxy, WebDAV, and more. All features are OOTB, making it easy for non-technical users. Thanks to the author for this useful resource.Reference Author GitHub Page下載或定製適用於您裝置的OpenWrt韌體Docker版OpenWrt旁路由安装设置教程Related VPS uses Docker deployment to automatically renew freenom domain nameDocker Application of OneCloudDeploy KMS with DockerLet NPM (Nginx Proxy Manager) and FRP (Fast Reverse Proxy) share 80/443 ports with wildcard domainUse Docker to Deploy FRP ServicesInstall Docker and Docker Compose via shell scriptDeploy FRP server and client services using Docker via shell script
2021年了, 大家還記得迅雷賺錢寶嗎? 記一次OpenWrt軟件安裝
2021年了, 大家還記得迅雷賺錢寶嗎? 記一次OpenWrt軟件安裝[shadow]_DSC6228.JPG[/shadow]前言:​ 我是接盤俠，前後入手20部1-2代的迅雷賺錢寶， 因為已經沒有賺錢能力，加上官方的風控問題,積在賬目內的幾千塊也提不出來， 一直在家吃灰。 無意中在恩山論壇找到[賺錢寶1代2代3代openwrt官網固件線刷包]貼文， 發現賺錢寶還有點折騰餘溫， 就有了這篇的記錄。2021-05-13_113036.png重要的要說三次!!!多謝大佬dybjxx適配了1,2,3代的OpenWrt官網固件!多謝大佬dybjxx適配了1,2,3代的OpenWrt官網固件!多謝大佬dybjxx適配了1,2,3代的OpenWrt官網固件!賺錢寶1代2代3代openwrt官網固件線刷包本貼分多個部份:刷機掛載外置USB硬碟SMB分享filebrowser(網頁管理介面，可用於上傳、刪除、預覽、重新命名和編輯您的文件)aria2 (強大又輕巧的下載工具)ttyd (網頁版終端機)簡單導航頁面CIFS 用戶端 (連接或掛載SAMBA伺服器)NFS 用戶端 (連接或掛載NFS伺服器)AdGuard Home (官方腳本傻瓜安裝)京東簽到插件OpenClash小猫咪插件1. 刷機[[返回目錄]]請支持原作者賺錢寶1代2代3代openwrt官網固件線刷包, [[下載刷機包及刷機軟件]].雙公USB線連接電腦及賺錢寶開啟USB_Burning_Tool刷機軟件按住復位鍵及通電賺錢寶2021-05-07_075536.png如圖示即已連線電腦及可刷機狀態2021-05-07_075706.png左上角的File導入固件及按Start開始刷機2021-05-07_080427.png當顯示100%即刷機完成, 可按Stop停止, 移除USB線及斷開電源.2021-05-07_080611.png重新通電及插上網線可以在路由器的DHCP列表找到賺錢寶的IP地址2021-05-07_080741.png瀏覽器打開賺錢寶IP網址, 免密碼登入.2021-05-07_162532.png2021-05-07_162551.png最好設定一下路由密碼方便往後SSH登入及軟件安裝2021-05-07_081122.png我是用Windows的Terminal登入到路由器. 2021-05-07_081429.png軟件安裝前這步很重要. 2021-05-07_081344.png如果是二代賺錢寶需要安裝resize2fs改一下分區表 (*一代不用)2021-05-07_081514.png未改分區表時只有206.8M可用2021-05-07_081606.png改分區表後有2.8G可用空間2. 掛載外置USB硬碟[[返回目錄]]安裝分區軟件 fdiskFDISK_01.PNG圖示我已安裝FDISK_02.PNG插入外置的USB硬碟, 用 fdisk -l 查看, 可找到外置的USB硬碟在/dev/sda 空間為465.78 GiB (即500G)FDISK_03.PNG刪除舊有分區, 建立新的分區并重新格式化為ext4mkdir -p /mnt/sda1建立掛載目錄FDISK_04.PNG用mount掛載USB硬碟, 可查看已經掛載成功最後編輯 /etc/rc.load 加入開機自啟動mount /dev/sda /mnt/sda1/ exit 0在exit 0上一行加入額外:如果想對NTFS支援讀寫，就需要安裝ntfs-3g (即可免除上面格式化為ext4的動作)，還可以很方便地轉到windows讀取。FDISK_05.PNG3. SMB分享 (Windows 共享目錄)[[返回目錄]]2021-05-07_095804.png安裝samba軟件opkg install samba36-server luci-app-samba2021-05-07_095940.png2021-05-07_100316.png2021-05-13_132107.png4. filebrowser[[返回目錄]]File Browser是網頁文件管理介面，可用於上傳、刪除、預覽、重新命名和編輯您的文件,是一種遠程文件管理器,可以安裝在大部分伺服器上,設定其路徑,然後透過一個 Web 界面可以輕鬆地存取文件。登陸SSH及安裝wget作準備opkg update && opkg upgrade wget && opkg install ca-certificates2021-05-07_092052.pngwget https://github.com/filebrowser/filebrowser/releases/download/v2.15.0/linux-armv7-filebrowser.tar.gz下載filebrowsertar xzf linux-armv7-filebrowser.tar.gz2021-05-07_092318.png解壓縮filebrowser將filebrowser 二進制文件移動到執行目錄 及 執行filebrowser 測試filebrowser -a 0.0.0.0 -p 8080 -r /-a 0.0.0.0 監聽地址即所有-p 8080 監聽端口-r / 管理目錄 / 為所有2021-05-14_090511.png最後編輯 /etc/rc.load 加入開機自啟動filebrowser -a 0.0.0.0 -p 8080 -r / exit 0在exit 0上一行加入來自filebrowser/filebrowser5. aria2 (強大又輕巧的下載工具)[[返回目錄]]支援了 HTTP、HTTPS、FTP、SFTP、BitTorrent (BT 種子) 和 Metalink 等通訊協定。2021-05-07_103040.pngSSH安裝aria2及建立下載目錄2021-05-07_114236.png2021-05-07_114327.png配置Aria22021-05-07_105207.png下載速度2021-05-07_105157.pngCPU的占用6. ttyd [[返回目錄]]網頁版終端機2021-05-10_075756.pngttyd -p 7681 login &運行及測試2021-05-13_141701.png最後編輯 /etc/rc.load 加入開機自啟動ttyd -p 7681 login & exit 0在exit 0上一行加入來自: tsl0922/ttyd7. 簡單導航頁面[[返回目錄]]2021-05-07_124635.png將導航頁面文件解壓縮到SMB的Public分享目錄2021-05-13_144509.png用記事本修改index.html內容的IP為自己賺錢寶的IP地址.2021-05-07_124015.png在SSH查看目錄路徑是否正確及 在/www/目錄建立軟連結ln -s /mnt/sda1/www/dash/ariang/ /www/如之前安裝aria2了, 也可一併建立ariang軟連結.2021-05-07_154442.png在瀏覽器輸入賺錢寶的IP地址/dash/就可以開啟導航頁面啟導航頁链接: 提取码: e7qv8. CIFS 用戶端 [[返回目錄]]連接或掛載網路上的SAMBA伺服器, 如NAS2021-05-10_082855.pngopkg install kmod-fs-cifs kmod-nls-base kmod-nls-utf8 kmod-crypto-hmac kmod-crypto-md5 kmod-crypto-misc cifsmountSSH進入及安裝2021-05-10_085941.png掛載我NAS SMB分享目錄username=guest 是因為設定了免密碼連線mount -t cifs //20.13.3.250/Backup /mnt/cifs -o username=admin,password=admin,vers=1.0如果NAS的SMB分享設定帳號密碼, 可用上面的命令.username=使用者帳號password=密碼最後編輯 /etc/rc.load 加入開機自啟動mount -t cifs //20.13.3.250/Backup /mnt/cifs -o username=guest,rw,vers=1.0 exit 0在exit 0上一行加入9. NFS 用戶端 [[返回目錄]]連接或掛載NFS伺服器因為CIFS客戶端不能掛載到DSM的SMB分享目錄, 所以就有NFS的嘗試.2021-05-10_080854.pngopkg update && opkg install nfs-utils kmod-fs-nfs kmod-fs-nfs-v4 kmod-fs-nfs-v3SSH登入及安裝NFS 用戶端2021-05-10_081555.png2021-05-10_081559.png2021-05-10_081610.png2021-05-10_081616.pngDSM的NFS伺服器設定2021-05-10_081841.pngmount -t nfs 20.13.3.13:/volume1/Public /mnt/nfs/ -o nolock賺錢寶的掛載及測試最後編輯 /etc/rc.load 加入開機自啟動mount -t nfs 20.13.3.13:/volume1/Public /mnt/nfs/ -o nolock exit 0在exit 0上一行加入10. AdGuard Home (官方腳本傻瓜安裝)[[返回目錄]]2021-05-10_102251.pngcurl -sSL https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh | shSSH登入, 執行官方腳本. 2021-05-13_150858.png瀏覽器輸入賺錢寶的IP地址+端口3000 開啟ADGUARD設定來自: AdguardTeam/AdGuardHome11. 京東簽到插件[[返回目錄]]2021-05-13_111102.pngopkg update opkg install node wget luaSSH登入安裝依賴2021-05-13_111154.pngwget --no-check-certificate https://github.com/jerrykuku/luci-app-jd-dailybonus/releases/download/v1.0.5/luci-app-jd-dailybonus_1.0.5-20210316_all.ipk下載ipk2021-05-13_111246 - install.png安裝京東簽到插件2021-05-13_151121.png來自大佬: jerrykuku/luci-app-jd-dailybonus12. OpenClash小猫咪插件[[返回目錄]]opkg update opkg install luci opkg install luci-base opkg install iptables opkg install dnsmasq-full opkg install coreutils opkg install coreutils-nohup opkg install bash opkg install curl opkg install jsonfilter opkg install ca-certificates opkg install ipset opkg install ip-full opkg install iptables-mod-tproxy opkg install kmod-tun opkg install luci-compat SSH登入, 安裝依賴CLASH_01.PNGwget --no-check-certificate https://github.com/vernesong/OpenClash/releases/download/v0.42.05-beta/luci-app-openclash_0.42.05-beta_all.ipk opkg install luci-app-openclash_0.42.05-beta_all.ipk下載及安裝CLASH_02.PNGwget --no-check-certificate https://github.com/vernesong/OpenClash/releases/download/Clash/clash-linux-armv7.tar.gz下載 Clash內核CLASH_03.PNG解壓到 /etc/openclash/core/文件夾==========================Collected errors問題CLASH_04.PNGCLASH_05.PNG安裝插件遇到Collected errors, 可根據內容移除dnsmasq再重新安裝==========================重啟賺錢寶後, 開啟插件及設定CLASH_07.PNGCLASH_08.PNGCLASH_09.PNGCLASH_10.PNG來自大佬:vernesong關於固件建議:反覆測試, 重啟後沒有全部執行在/etc/rc.local部份命令或腳本, 也嘗試到crontab 使用@reboot 或者到fstab掛載NFS 或SMB 也不能, 重啟後部份服務還是需要手動開啟,但不影響使用. 建議使用的固件只是少一點問題, 也不能全部解決 或者我能力有限. (求大佬們解惑)一代固件:2-18.img2-19.img (建議使用)二代的固件:2-18-3G.img (建議使用)2-19-3G.img關於功拜:2021-05-07_081450.png待機1.7W2021-05-07_095000.png連外置USB2.5吋硬碟 3.8W2021-05-07_102504.png連外置USB2.5吋硬碟 全速運轉時功拜 4.4W結語:迅雷賺錢寶， 你賺錢了嗎?相關連結: 繼續折騰迅雷賺錢寶 PRO (二代) -- Wire­Guard 的安裝與使用折騰迅雷賺錢寶 PRO (二代) -- armbian 軟件安裝