I am running OpenVPN server on server (EC2 node on AWS). I am using this server as an access to internal AWS network.
In order to route traffic from my PC (VPN client) to restricted AWS resource via whitelisted VPN IP I am using those commands:
sudo route add xx.xx.xx.xx tun0
after the VPN connection is up, where xx.xx.xx.xx
is the address of the restricted resource.
The traffic to OpenVPN server is allowed on port 1194 UDP only. I would like to connect to OpenVPN server on port 22 (SSH), but this is not allowed.
Is it possible to route traffic, so I connect to VPN then the traffic on port 22 (only) is routed through VPN itself?
The sudo route add xx.xx.xx.xx tun0
where xx.xx.xx.xx
is the IP of the VPN server doesn't work, as it routes all the traffic through VPN, including the VPN connection itself, effectively breaking the connection.