0

I have subscribed a Dedicated IP of NordVPN and followed the official instructions to install necessary packages in my AWS EC2 Ubuntu instance. I normally access the instance via AWS admin console. Yet I struggled with two issues:

  1. The terminal will always freeze when I try to execute: sudo nordvpn connect xxx where xxx is my dedicated IP's server
  2. While I don't know why the above command fails, I manage to manually connect via openvpn command with some IP rules (Ref: Allowing SSH on a server with an active OpenVPN client). However if I do not kill / disconnect the vpn connection, I cannot SSH access my EC2 instance anymore
sudo ip rule add from $(ip route get 1 | grep -Po '(?<=src )(\S+)') table 128
sudo ip route add table 128 to $(ip route get 1 | grep -Po '(?<=src )(\S+)')/32 dev $(ip -4 route ls | grep default | grep -Po '(?<=dev )(\S+)')
sudo ip route add table 128 default via $(ip -4 route ls | grep default | grep -Po '(?<=via )(\S+)')
sudo route add -host [my EC2's elastic IP] gw [my EC2's gateway]

sudo openvpn --config /etc/openvpn/ovpn_udp/xxx.nordvpn.com.udp.ovpn --daemon --auth-user-pass pass.txt --auth-nocache

So my question is:

Why the official command of NordVPN doesn't work as expected, and is there any way to make my EC2 instance SSH accessible even if the VPN is connected?

shole
  • 103

0 Answers0