https://github.com/mahdadghasemian/openvpn-bridge-config
https://github.com/mahdadghasemian/openvpn-bridge-config
openvpn-server ssh-tunnel vpn-server
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mahdadghasemian/openvpn-bridge-config
- Owner: MahdadGhasemian
- Created: 2023-07-21T07:18:04.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-12T02:58:20.000Z (over 1 year ago)
- Last Synced: 2025-02-04T16:14:46.993Z (4 months ago)
- Topics: openvpn-server, ssh-tunnel, vpn-server
- Language: Shell
- Homepage:
- Size: 18.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## On Server B (Foreign Server):
```shell
$ mkdir openvpn
$ cd openvpn
$ sudo curl -s https://raw.githubusercontent.com/MahdadGhasemian/openvpn-bridge-config/main/install-upstream.sh -o ./install-upstream.sh && chmod +x ./install-upstream.sh && ./install-upstream.sh open-vpn-port ca-passphrase server-b-ssh-port server-a-ip port-on-server-a
```Once the script finishes, It will print a command as follows, please run it on your intranet server :
```shell
sudo curl -s https://raw.githubusercontent.com/MahdadGhasemian/openvpn-bridge-config/main/install-bridge.sh | bash -s server-b-ssh-port port-on-server-a open-vpn-port server-b-ip
```## On Server A (Intranet server):
```shell
$ sudo curl -s https://raw.githubusercontent.com/MahdadGhasemian/openvpn-bridge-config/main/install-bridge.sh | bash -s server-b-ssh-port port-on-server-a open-vpn-port server-b-ip
```## Add new user:
After setup, run the following command to add a new user on the **`Server B`**.
This will create a new `USERNAME.ovpn` file that you can download and add to your client applications.
```shell
$ ./add_user.sh USERNAME PASSWORD
```## Example

### on the server B (Foreign Server):
```shell
$ sudo curl -s https://raw.githubusercontent.com/MahdadGhasemian/openvpn-bridge-config/main/install-upstream.sh -o ./install-upstream.sh && chmod +x ./install-upstream.sh && ./install-upstream.sh 7766 ca1234 2221 87.248.156.100 4445
```### on the server A (Intranet server):
```shell
$ sudo curl -s https://raw.githubusercontent.com/MahdadGhasemian/openvpn-bridge-config/main/install-bridge.sh | bash -s 2221 4445 7766 65.108.83.101
```### Add a user:
We're gonig to add a user named `user1` with the password `1234`.
On the server B, inside the openvpn folder, run following command:
```shell
$ ./add_user.sh user1 1234
```Once it finishes, a file called `user1.ovpn` will be generated inside the folder. Download it and add to your client app.