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>
112 lines
3.0 KiB
Markdown
Executable File
112 lines
3.0 KiB
Markdown
Executable File
# 🌐 Multiple Area Example
|
|
|
|
## 🗺️ Topology
|
|
|
|
```text
|
|
192.168.1.20/24 192.168.1.21/24
|
|
| |
|
|
Access1 -- Hotel Wifi --> Switch(NJ) <--- Other Wifi --- Access2
|
|
|
|
|
|
|
|
Internet
|
|
|
|
|
|
|
|
Switch(SH) - 192.168.1.10/24
|
|
|
|
|
|
|
|
+------------------------+---------------------------+
|
|
^ ^ ^
|
|
| | |
|
|
Office Wifi Home Wifi Hotel Wifi
|
|
| | |
|
|
Access3 Access4 Access5
|
|
192.168.1.11/24 192.168.1.12/24 192.168.1.13/24
|
|
```
|
|
|
|
## ⚙️ Configure Central Switch for Nanjing
|
|
|
|
Global configure:
|
|
|
|
```bash
|
|
[root@switch-nj ~]# cd /etc/openlan/switch
|
|
[root@switch-nj ~]# cat > switch.yaml <<EOF
|
|
crypt:
|
|
secret: f367aa429ed2
|
|
EOF
|
|
```
|
|
|
|
Network configure:
|
|
|
|
```bash
|
|
[root@switch-nj ~]# cd network
|
|
[root@switch-nj ~]# cat > private.yaml <<EOF
|
|
name: private
|
|
bridge:
|
|
name: br-em2
|
|
address: 192.168.1.66/24
|
|
subnet:
|
|
endAt: 192.168.1.99
|
|
startAt: 192.168.1.80
|
|
openvpn:
|
|
listen: 0.0.0.0:1166
|
|
subnet: 172.32.66.0/24
|
|
EOF
|
|
[root@switch-nj ~]# openlan cfg co
|
|
[root@switch-nj ~]# systemctl restart openlan-switch
|
|
```
|
|
|
|
Add two access users on private network:
|
|
|
|
```bash
|
|
[root@switch-nj ~]# openlan us add --name admin@private --role admin
|
|
[root@switch-nj ~]# openlan us add --name access1@private
|
|
[root@switch-nj ~]# openlan us add --name access2@private
|
|
```
|
|
|
|
## ⚙️ Configure Central Switch for ShangHai
|
|
|
|
Global configure:
|
|
|
|
```bash
|
|
[root@switch-sh ~]# cd /etc/openlan/switch
|
|
[root@switch-sh ~]# cat > switch.yaml <<EOF
|
|
crypt:
|
|
secret: 7519e54d12c5
|
|
EOF
|
|
```
|
|
|
|
Network configure:
|
|
|
|
```bash
|
|
[root@switch-sh ~]# cd network
|
|
[root@switch-sh ~]# cat > private.yaml <<EOF
|
|
name: private
|
|
bridge:
|
|
name: br-em2
|
|
address: 192.168.1.88/24
|
|
subnet:
|
|
endAt: 192.168.1.150
|
|
startAt: 192.168.1.100
|
|
openvpn:
|
|
listen: 0.0.0.0:1188
|
|
subnet: 172.32.88.0/24
|
|
links:
|
|
- connection: address-of-switch-nj
|
|
password: get-it-from-switch-nj
|
|
username: admin
|
|
crypt:
|
|
secret: f367aa429ed2
|
|
EOF
|
|
[root@switch-sh ~]# openlan cfg co
|
|
[root@switch-sh ~]# systemctl restart openlan-switch
|
|
```
|
|
|
|
Add three access users on private network:
|
|
|
|
```bash
|
|
[root@switch-sh ~]# openlan user add --name admin@private --role admin
|
|
[root@switch-sh ~]# openlan user add --name access3@private
|
|
[root@switch-sh ~]# openlan user add --name access4@private
|
|
[root@switch-sh ~]# openlan user add --name access5@private
|
|
```
|