mirror of
https://github.com/luscis/openlan.git
synced 2026-04-22 23:07:11 +08:00
f8d8982da9
- Fix typos across all docs (Generage, roootfs, Upgrating, Githup, exmaple, Singapo) - Fix broken YAML syntax in proxy.md (missing closing bracket) - Fix duplicate/misnumbered list steps in install.md and multiarea.md - Add language specifiers (bash/yaml/text) to all fenced code blocks - Fix MD022/MD031/MD012/MD014/MD025 markdown lint issues - Separate shell commands from YAML config into distinct code blocks - Add emoji icons to all headings across every doc file - Update docs/README.md index to include all doc links with icons - Fill in empty Socks Proxy section in proxy.md Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
100 lines
2.6 KiB
Markdown
100 lines
2.6 KiB
Markdown
# 🐳 Deployment OpenLAN by Docker Compose
|
|
|
|
Please ensure you already installed the following softwares:
|
|
|
|
* docker
|
|
* docker-compose
|
|
|
|
## 📥 Download config's source package
|
|
|
|
```bash
|
|
wget https://github.com/luscis/openlan/releases/download/v25.4.1/config.tar.gz
|
|
```
|
|
|
|
## 📂 Unarchive it to your rootfs
|
|
|
|
```bash
|
|
tar -xvf config.tar.gz -C /opt
|
|
```
|
|
|
|
## ✏️ Now you can edit your network
|
|
|
|
```bash
|
|
[root@example openlan]# cd /opt/openlan/etc/openlan/switch/network
|
|
[root@example network]#
|
|
[root@example network]# cat ./example.yaml
|
|
name: example
|
|
bridge:
|
|
address: 172.32.100.40/24
|
|
[root@example network]#
|
|
```
|
|
|
|
## 🔄 Update image version
|
|
|
|
You can find the latest version on [docker hub](https://hub.docker.com/r/luscis/openlan/tags).
|
|
|
|
```bash
|
|
[root@example network]# cd /opt/openlan
|
|
[root@example openlan]# sed -i -e 's/:latest.x86_64/:v25.4.1.x86_64/' docker-compose.yml
|
|
[root@example openlan]#
|
|
```
|
|
|
|
## 🚀 Bootstrap OpenLAN by compose
|
|
|
|
```bash
|
|
[root@example openlan]# docker-compose up -d
|
|
[root@example openlan]#
|
|
[root@example openlan]# docker-compose ps
|
|
Name Command State Ports
|
|
-----------------------------------------------------------------
|
|
openlan_ipsec_1 /var/openlan/script/ipsec.sh Up
|
|
openlan_proxy_1 /usr/bin/openlan-proxy -co ... Up
|
|
openlan_switch_1 /var/openlan/script/switch ... Up
|
|
```
|
|
|
|
## ⬆️ Upgrading OpenLAN and backup OpenVPN
|
|
|
|
```bash
|
|
[root@example openlan]# cd /opt/openlan
|
|
[root@example openlan]# mkdir -p var/openlan
|
|
[root@example openlan]# docker cp openlan_switch_1:/var/openlan/openvpn ./
|
|
[root@example openlan]# docker-compose down
|
|
[root@example openlan]# vi docker-compose.yml
|
|
```
|
|
|
|
```yaml
|
|
version: 2.3
|
|
services:
|
|
ipsec:
|
|
restart: always
|
|
image: luscis/openlan:v25.4.1.x86_64.deb
|
|
privileged: true
|
|
network_mode: host
|
|
entrypoint: [/var/openlan/script/ipsec.sh]
|
|
volumes:
|
|
- /opt/openlan/etc/ipsecd.d:/etc/ipsec.d
|
|
- /opt/openlan/run/pluto:/run/pluto
|
|
switch:
|
|
restart: always
|
|
image: luscis/openlan:v25.4.1.x86_64.deb
|
|
privileged: true
|
|
network_mode: host
|
|
entrypoint: [/var/openlan/script/switch.sh, start]
|
|
volumes:
|
|
- /opt/openlan/etc/openlan:/etc/openlan
|
|
- /opt/openlan/etc/ipsecd.d:/etc/ipsec.d
|
|
- /opt/openlan/run/pluto:/run/pluto
|
|
proxy:
|
|
restart: always
|
|
image: luscis/openlan:v25.4.1.x86_64.deb
|
|
privileged: true
|
|
network_mode: host
|
|
entrypoint: [/usr/bin/openlan-proxy, -conf, /etc/openlan/proxy.yaml, -log:file, /dev/null]
|
|
volumes:
|
|
- /opt/openlan/etc/openlan:/etc/openlan
|
|
```
|
|
|
|
```bash
|
|
[root@example openlan]# docker-compose up -d
|
|
```
|