diff --git a/docs/tech_docs/OpenWrt.md b/docs/tech_docs/OpenWrt.md index da1d2c0..b14b042 100644 --- a/docs/tech_docs/OpenWrt.md +++ b/docs/tech_docs/OpenWrt.md @@ -1,3 +1,111 @@ +Here's the updated response with the additional information on installing packages via the CLI on OpenWrt: + +### Proxmox Container Creation + +Use the following command to create a new container with reduced memory and storage: + +```bash +pct create 101 /var/lib/vz/template/cache/openwrt-rootfs.tar.xz --unprivileged 1 --arch amd64 --ostype unmanaged --hostname openwrt-0 --storage local-lvm --memory 128 --swap 0 --rootfs local-lvm:2,size=1G \ +--net0 name=eth0,bridge=vmbr0,firewall=1 \ +--net1 name=eth1,bridge=vmbr1,firewall=1 +``` + +Key changes: +- Reduced memory to 128MB (`--memory 128`) +- Disabled swap (`--swap 0`) +- Reduced rootfs size to 1GB (`--rootfs local-lvm:2,size=1G`) + +### OpenWRT Firewall Configuration + +The network interface and firewall configuration remains the same as before: + +#### **Define Network Interfaces**: +Update `/etc/config/network` to reflect `eth1` as the WAN interface: + +```bash +config interface 'wan' + option ifname 'eth1' + option proto 'dhcp' +``` + +#### **Update Firewall Settings**: +Append rules to `/etc/config/firewall` to allow SSH and HTTPS access: + +```bash +config zone + option name 'wan' + list network 'wan' + option input 'REJECT' + option output 'ACCEPT' + option forward 'REJECT' + option masq '1' + option mtu_fix '1' + +config rule + option name 'Allow-SSH' + option src 'wan' + option proto 'tcp' + option dest_port '22' + option target 'ACCEPT' + +config rule + option name 'Allow-HTTPS' + option src 'wan' + option proto 'tcp' + option dest_port '443' + option target 'ACCEPT' +``` + +### Installing Packages via CLI + +To install packages via the CLI on OpenWrt, you can use the `opkg` package management tool. Here's how to go about it: + +1. **Update the Package List**: Before installing any new packages, it's a good practice to update the list of packages to ensure you are installing the latest versions available. You can do this by running: + +``` +opkg update +``` + +2. **Install a Package**: Once the package list is updated, you can install a package by using the `opkg install` command followed by the package name. For example, if you want to install the QEMU Guest Agent, you would use: + +``` +opkg install qemu-ga +``` + +3. **Check Dependencies**: `opkg` automatically handles dependencies for the packages you install. If additional packages are required to fulfill dependencies, `opkg` will download and install them as well. + +4. **Configure Packages**: Some packages may require configuration after installation. OpenWrt might save configuration files in `/etc/config/`, and you might need to edit these files manually or through a web interface (if you have LuCI installed). + +5. **Managing Packages**: Besides installing, you can also remove packages with `opkg remove` and list installed packages with `opkg list-installed`. + +6. **Find Available Packages**: To see if a specific package is available in the OpenWrt repository, you can search for it using: + +``` +opkg list | grep +``` + +These steps should help you manage packages on your OpenWrt device from the command line. For more detailed information or troubleshooting, you can refer to the OpenWrt documentation or community forums. + +### Applying the Configuration + +After updating the configuration files: + +- **Restart Network Services**: + ```bash + /etc/init.d/network restart + ``` + +- **Reload Firewall Settings**: + ```bash + /etc/init.d/firewall restart + ``` + +This setup reduces the memory and storage footprint of the OpenWRT container while maintaining the necessary network and firewall configurations for SSH and HTTPS access. It also provides guidance on installing and managing packages using the `opkg` tool in OpenWrt. + +Remember to test connectivity, functionality, and package installations thoroughly after applying these changes to ensure the reduced resource allocation meets your requirements and the necessary packages are installed correctly. + +--- + Here's an updated OpenWRT container configuration with a smaller footprint: ### Proxmox Container Creation