- PHP 85.9%
- Shell 14.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| config | ||
| lang | ||
| scripts | ||
| src | ||
| tests | ||
| .gitignore | ||
| composer.json | ||
| phpunit.xml | ||
| plugin.json | ||
| README.md | ||
| update.json | ||
Pelican Extended OpenWrt Bridge
Pelican plugin that creates and maintains OpenWrt port forwards for assigned Pelican allocations.
When a Pelican allocation is assigned to a server, the plugin creates an
OpenWrt firewall redirect. When the allocation is removed, the redirect is
removed again. All managed OpenWrt rules use the fixed prefix pelican_.
Features
- Synchronizes assigned Pelican allocations to OpenWrt port forwards.
- Uses SSH key authentication.
- Forwards
allocation.portto the same port onallocation.ip. - Uses
tcp udpby default. - Creates stable OpenWrt rule names like
pelican_42. - Adds a read-only admin allocation list with search, manual sync button, and free-allocation cleanup.
- Provides a reconcile command for dry-runs, repair, and cleanup.
Example OpenWrt rule for allocation ID 42:
uci set firewall.pelican_42=redirect
uci set firewall.pelican_42.target='DNAT'
uci set firewall.pelican_42.name='pelican_42'
uci set firewall.pelican_42.src='wan'
uci set firewall.pelican_42.dest='lan'
uci set firewall.pelican_42.proto='tcp udp'
uci set firewall.pelican_42.src_dport='25565'
uci set firewall.pelican_42.dest_ip='192.168.1.20'
uci set firewall.pelican_42.dest_port='25565'
uci set firewall.pelican_42.enabled='1'
uci commit firewall
service firewall reload
Installation
Download the release ZIP from the Gitea repository releases:
pelican-extended-openwrt-bridge.zip
Upload it in the Pelican admin panel:
Admin -> Plugins -> Import from file
After importing, click install for Pelican Extended OpenWrt Bridge.
The ZIP must contain this structure:
pelican-extended-openwrt-bridge/plugin.json
pelican-extended-openwrt-bridge/src/...
pelican-extended-openwrt-bridge/config/...
OpenWrt SSH Key
Create a key :
ssh-keygen -t ed25519 -f ~/.ssh/openwrt_id_ed25519
Copy the public key to OpenWrt:
ssh-copy-id -i ~/.ssh/openwrt_id_ed25519.pub root@192.168.1.1
If ssh-copy-id does not work with OpenWrt/Dropbear, use:
cat ~/.ssh/openwrt_id_ed25519.pub | ssh root@192.168.1.1 'mkdir -p /etc/dropbear && cat >> /etc/dropbear/authorized_keys && chmod 600 /etc/dropbear/authorized_keys'
Test the login:
ssh -i ~/.ssh/openwrt_id_ed25519 root@192.168.1.1
The OpenWrt SSH user must be able to run:
uci
service firewall reload
Plugin Settings
Configure the plugin in the Pelican plugin settings:
- Enable synchronization
- OpenWrt host, for example
192.168.1.1 - SSH port, usually
22 - SSH username, usually
root - Private key, paste the full private key text
- Private key passphrase, only if your key has one
- Source zone, usually
wan - Destination zone, usually
lan - Protocol, default
TCP + UDP - SSH timeout, default
10 - Scheduled sync interval in minutes,
0disables scheduled sync
Leave the Private key field empty when editing settings if you want to keep the already saved key.
The private key is stored base64-encoded in .env to keep Laravel dotenv
parsing valid.
Reconcile Command
Use the reconcile command to compare Pelican allocations with OpenWrt rules.
Dry-run:
php artisan openwrt-bridge:sync --dry-run
Apply changes:
php artisan openwrt-bridge:sync
This command updates all assigned allocations and removes stale OpenWrt
redirects whose names start with pelican_.
The same cleanup can also be started from the admin allocation list with the
Sync button.
The admin allocation list also has a Delete free button for deleting
allocations without a server assignment. Assigned allocations are kept.
Set a scheduled sync interval in the plugin settings to run the same cleanup
through Laravel's scheduler. For example, 15 runs the sync about every 15
minutes. Set it to 0 to disable scheduled syncs.
Troubleshooting
Install button only says "Plugin install started in the background"
Pelican installs plugins through a Laravel queue job. If the queue worker is not running, the UI may show the background message but nothing else happens.
Run this inside the Pelican container or on the Pelican server:
cd /var/www/html
php artisan p:plugin:install pelican-extended-openwrt-bridge
If a previous install attempt left a stale queue/cache state, clear it:
php artisan cache:clear
php artisan optimize:clear
php artisan queue:clear
OpenWrt rules do not appear
Run a dry-run first:
php artisan openwrt-bridge:sync --dry-run
Then check:
- The plugin is enabled.
- The allocation is assigned to a server.
allocation.ipis the internal LAN IP OpenWrt should forward to.- The pasted SSH private key matches the public key installed on OpenWrt.
- Source and destination zones match your OpenWrt firewall setup.
SSH authentication fails
Test SSH manually from the Pelican container:
ssh -i /path/to/test/key root@192.168.1.1
For the plugin itself, paste the private key into the plugin settings instead of using a file path.