Files
the_information_nexus/docs/tech_docs/OpenWrt.md

133 lines
4.2 KiB
Markdown

## Links
- [Split A GPU Between Multiple Computers - Proxmox LXC (Unprivileged)
](https://youtu.be/0ZDr5h52OOE?si=F4RVd5mA5IRjrpXU)
- [Must-Have OpenWrt Router Setup For Your Proxmox
](https://youtu.be/3mPbrunpjpk?si=WofNEJUZL4FAw7HP)
- [Docker on Proxmox LXC 🚀 Zero Bloat and Pure Performance!
](https://youtu.be/-ZSQdJ62r-Q?si=GCXOEsKnOdm6OIiz)
- [stuff](url)
## 'pct' commands
```markdown
[pct commands](https://git.crazystorm.xyz/medusa/the_information_nexus/src/branch/main/docs/tech_docs/pct.md)
```
- [pct commands](https://git.crazystorm.xyz/medusa/the_information_nexus/src/branch/main/docs/tech_docs/pct.md)
---
# Proxmox Container Setup Guide
This guide provides step-by-step instructions for setting up OpenWRT, Kali Linux, and Alpine Linux containers on Proxmox.
## OpenWRT Container Setup
### Create and Configure the OpenWRT Container
```bash
pct create 100 /var/lib/vz/template/cache/openwrt-rootfs.tar.xz --unprivileged 1 --arch amd64 --ostype unmanaged --hostname openwrt-0 --password password --tag network --storage local-lvm --memory 256 --swap 128 --rootfs local-lvm:1,size=512M --net0 name=eth0,bridge=vmbr0,firewall=1 --net1 name=eth1,bridge=vmbr1,firewall=1 --cores 1 --cpuunits 500 --onboot 1 --debug 0
```
### Start the Container and Access the Console
```bash
pct start 100
pct console 100
```
### Update and Install Packages
```bash
opkg update
opkg install qemu-ga
reboot
```
### Network and Firewall Configuration
```bash
vi /etc/config/network
/etc/init.d/network restart
vi /etc/config/firewall
/etc/init.d/firewall restart
uci add firewall rule
uci set firewall.@rule[-1].name='Allow-SSH'
uci set firewall.@rule[-1].src='wan'
uci set firewall.@rule[-1].proto='tcp'
uci set firewall.@rule[-1].dest_port='22'
uci set firewall.@rule[-1].target='ACCEPT'
uci add firewall rule
uci set firewall.@rule[-1].name='Allow-HTTPS'
uci set firewall.@rule[-1].src='wan'
uci set firewall.@rule[-1].proto='tcp'
uci set firewall.@rule[-1].dest_port='443'
uci set firewall.@rule[-1].target='ACCEPT'
uci add firewall rule
uci set firewall.@rule[-1].name='Allow-HTTP'
uci set firewall.@rule[-1].src='wan'
uci set firewall.@rule[-1].proto='tcp'
uci set firewall.@rule[-1].dest_port='80'
uci set firewall.@rule[-1].target='ACCEPT'
uci commit firewall
/etc/init.d/firewall restart
```
## Alpine Container Setup
### Create and Configure the Alpine Container
```bash
pct create 300 /var/lib/vz/template/cache/alpine-rootfs.tar.xz --unprivileged 1 --arch amd64 --ostype alpine --hostname alpine-0 --password password --tag docker --storage local-lvm --cores 2 --memory 1024 --swap 256 --rootfs local-lvm:1,size=8G --net0 name=eth0,bridge=vmbr0,firewall=1 --keyctl 1 --nesting 1 --cpuunits 1000 --onboot 1 --debug 0
```
### Enter the Container
```bash
pct enter 300
```
### System Update and Package Installation
```bash
sed -i '/^#.*community/s/^#//' /etc/apk/repositories
apk update && apk upgrade
apk add qemu-guest-agent docker openssh sudo
```
### Start and Enable Docker Service
```bash
rc-service docker start
rc-update add docker default
```
### Configure Network
```bash
setup-interfaces
service networking restart
```
### Configure and Start SSH Service
```bash
rc-update add sshd
service sshd start
vi /etc/ssh/sshd_config
service sshd restart
```
### Create a System User and Add to Docker Group and Sudoers
```bash
adduser -s /bin/ash medusa
addgroup medusa docker
echo "medusa ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/medusa
```
### Test Docker Installation
```bash
docker run hello-world
```
## Kali Linux Container Setup
### Create and Configure the Kali Linux Container
```bash
pct create 200 /var/lib/vz/template/cache/kali-default-rootfs.tar.xz --unprivileged 1 --arch amd64 --ostype debian --hostname kali-0 --password password --tag tools --storage local-lvm --cores 2 --memory 2048 --swap 1024 --rootfs local-lvm:1,size=10G --net0 name=eth0,bridge=vmbr0,firewall=1 --cpuunits 1500 --onboot 1 --debug 0 --features nesting=1,keyctl=1
```
With these steps, you'll have OpenWRT, Alpine Linux with Docker, and Kali Linux containers set up on your Proxmox environment. Remember to adjust the configurations, usernames, and passwords according to your specific requirements and security best practices.