Is it possible to access the host running OpenVPN server through the tunnel itself on Linux (openSUSE)?
For example, if my OpenVPN host's* VPN IP is 10.125.0.1
and its public IP is 1.2.3.4
, I would like traffic sent to 1.2.3.4
to go through the tunnel (I'm trying to bypass an SSH-restricting firewall). However, SSHing to both 10.125.0.1
and 1.2.3.4
fails even with the VPN on.
I assume SSH connections are simply blocked from the tun
/tap
interfaces (10.125.0.1
) on the OpenVPN host which is fine, but connections to 1.2.3.4
should still go through surely.
I checked the routing table on my SSH client machine* and the default route is in fact the VPN interface, but the connections to 1.2.3.4
still go through the LAN gateway route:
// Route to VPN Server
user@host:~> sudo ip route get <OpenVPN Host IP>
<OpenVPN Host IP> via <LAN Gateway IP> dev wlan0 src <LAN Host IP> uid 0
cache
// Route to Google's DNS
user@host:~> sudo ip route get 8.8.8.8
8.8.8.8 via <VPN Gateway IP> dev vpn src <VPN Host IP> uid 0
cache
(For clarity, the VPN interface on my client machine is called vpn
)
I know it's possible to do this on a phone (Android) because it works (SSH) with the OpenVPN app but is it possible and if so, how can it be done on desktop?
I guess in a way my question is, what's the difference between the OpenVPN mobile app and the desktop (Linux) version?
* Additional Info
OpenVPN Server:
- Ubuntu 18.04 machine
- Technically runs
SoftEther
VPN server but with OpenVPN emulation. This cannot be the source of the problem as the desired results are achievable on mobile with OpenVPN app - Public IP
1.2.3.4
and private (VPN) IP10.125.0.1
- Is VPN gateway
OpenVPN Client:
- openSUSE Leap 15.1 machine
- Successfully connects to OpenVPN server
- All traffic other than that to the
OpenVPN Server
IP goes through VPN - Connection created and managed through NetworkManager
- Can ping the OpenVPN server host (both IPs) but this happens over the LAN route rather than VPN
I feel like my wording of the question is overcomplicated so please ask for clarification in the comments if needs be.
Thank you in advance