Posted on November 4, 2020 at 12:57 am
Assuming that default ethernet network interface is eth0.
And that you added a new IP 220.127.116.11 on the VPS that got assigned to eth0:1 interface.
You can add “local 18.104.22.168” in your OpenVPN server config, e.g:
So OpenVPN will listen on the specificed IP address.
Then you need to restart OpenVPN:
Here is an example of iptables rules I used:
-P INPUT ACCEPT -P FORWARD ACCEPT -P OUTPUT ACCEPT -A INPUT -i tun0 -j ACCEPT -A INPUT -i eth0:1 -p udp -m udp --dport 1194 -j DROP -A FORWARD -i tun0 -o eth0:1 -j ACCEPT -A FORWARD -i eth0:1 -o tun0 -j ACCEPT
* From a recent test looks like is not needed to use eth0:1, just use eth0.
On client .ovpn config file I added this:
remote 22.214.171.124 1194
All works fine, however when you use the VPN client it will use the eth0 IP.
And not the specified IP 126.96.36.199 (eth0:1).
You can make sure OpenVPN uses the specified IP 188.8.131.52 like this:
- How to List All Iptables NAT Rules
- Parse or Split FTP URL in Delphi XE using TIdURI
- How to Download a File via FTP in Delphi XE
- Public FTP Server to Test Upload and Download
- How to Parse Command-Line Arguments in Bash
- How to Make Iptables Rules Persistent
- Bash Install Iptables-Persistent Automatically
- Route OpenVPN Connections Through Floating IP
- How to fix "Clickable elements too close together"
- How to fix "Text too small to read"
- Create Custom Rest Endpoints for WP Rest API
- Timestamp URLs for SHA1 SHA256 Code Sign 2021
- PHP Multi-cURL to Run Parallel cURL Requests (Example)
- The following signatures were invalid: EXPKEYSIG B188E2B695BD4743
- Best Clean Monospace Web Fonts 2021
- Add New Path to Delphi 10.4 Sydney on Library Path