OpenVPN Control Panel for Restricted Network.
Project description
OpenVPN Control Panel for Restricted Network
Installation
In order to run along with OpenVPN server, the ROOT privilege is required.
sudo pipx install ovpncp
OpenVPN Server Setup
Make sure the client-to-client directive is disabled:
;client-to-client
Enable CCD & make it exclusive:
client-config-dir /etc/openvpn/ccd
ccd_exclusive
Enable the scripts of client connection:
client-connect /opt/ovpncp/scripts/client-connect.sh
client-disconnect /opt/ovpncp/scripts/client-disconnect.sh
Restart the server:
sudo systemctl restart openvpn
Start the application:
sudo -i ovpncp
Basic Usage
Init server by calling API with cURL:
curl -X POST http://127.0.0.1:8000/server
Check the health of OpenVPN server:
curl -X GET http://127.0.0.1:8000/server/health
Setup Client
Create the client:
curl -X POST http://127.0.0.1:8000/clients \
-d '{"name": "client_1"}'
Create the gateway client for private network:
curl -X POST http://127.0.0.1:8000/clients \
--data-binary @- << EOF
{
"name": "gateway_1",
"cidr": "192.168.1.0/24"
}
EOF
Package the client certificate:
curl -X PUT http://127.0.0.1:8000/clients/client_1/package-cert
Download the archive:
curl -X GET http://127.0.0.1:8000/clients/client_1/download-cert
Assign IP to the client:
curl -X PUT http://127.0.0.1:8000/clients/client_1/assign-ip \
-d '{"ip": "10.8.0.2"}'
Unassign IP from the client:
curl -X DELETE http://127.0.0.1:8000/clients/client_1/unassign-ip
Setup Restricted Network
IMPORTANT:
make sure drop all forwarding on tun0 by default:
sudo iptables -A FORWARD -i tun0 -j DROP
Create the network:
curl -X POST http://127.0.0.1:8000/networks \
--data-binary @- << EOF
{
"source_name": "client_1",
"destination_name": "edge_device_1",
}
EOF
Create the network with a gateway with private network behind it:
curl -X POST http://127.0.0.1:8000/networks \
--data-binary @- << EOF
{
"source_name": "client_1",
"destination_name": "gateway_1",
"private_network_addresses": "192.168.1.1,192.168.1.2,192.168.1.3"
}
EOF
Drop the network:
curl -X DELETE http://127.0.0.1:8000/networks/1
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ovpncp-0.1.3.tar.gz.
File metadata
- Download URL: ovpncp-0.1.3.tar.gz
- Upload date:
- Size: 25.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ab5f94eb447632a0d8c2be16f5e52be83aaf978daaf15c929d5e38be3a13411
|
|
| MD5 |
ea1fc29c1cb8c5cc5057398d1a0cd30c
|
|
| BLAKE2b-256 |
959ca3a68bfef9c0e66441619c220b9b121295b75c0f05d124ae57f26660cb4e
|
Provenance
The following attestation bundles were made for ovpncp-0.1.3.tar.gz:
Publisher:
package.yml on scia-iot/ovpncp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ovpncp-0.1.3.tar.gz -
Subject digest:
5ab5f94eb447632a0d8c2be16f5e52be83aaf978daaf15c929d5e38be3a13411 - Sigstore transparency entry: 191797181
- Sigstore integration time:
-
Permalink:
scia-iot/ovpncp@4c23bed68ac895fbb6c938fdca89ed772256a1cc -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/scia-iot
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
package.yml@4c23bed68ac895fbb6c938fdca89ed772256a1cc -
Trigger Event:
release
-
Statement type:
File details
Details for the file ovpncp-0.1.3-py3-none-any.whl.
File metadata
- Download URL: ovpncp-0.1.3-py3-none-any.whl
- Upload date:
- Size: 20.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e343cf189b56fee119d81214ff258aa8ce5659e78f6fa2076feafda729938019
|
|
| MD5 |
400149f84900b43b6087e47a0da735bb
|
|
| BLAKE2b-256 |
d3843b58fefe8102b566c9eca688d687a50bc30ffd5201faae3914b8046d55e8
|
Provenance
The following attestation bundles were made for ovpncp-0.1.3-py3-none-any.whl:
Publisher:
package.yml on scia-iot/ovpncp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ovpncp-0.1.3-py3-none-any.whl -
Subject digest:
e343cf189b56fee119d81214ff258aa8ce5659e78f6fa2076feafda729938019 - Sigstore transparency entry: 191797184
- Sigstore integration time:
-
Permalink:
scia-iot/ovpncp@4c23bed68ac895fbb6c938fdca89ed772256a1cc -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/scia-iot
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
package.yml@4c23bed68ac895fbb6c938fdca89ed772256a1cc -
Trigger Event:
release
-
Statement type: