title: AWS OpenVPN instance can't ssh to other ec2 instances of connect to web
body: <p>I set up an OpenVPN EC2 instance on AWS and it has security groups like</p>
  <p><a href="https://i.stack.imgur.com/8Ccrl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8Ccrl.png" alt="openvpn security groups" /></a></p>
  <p>I downloaded the <code>client.ovpn</code> file and can successfully connect to it like <code>sudo openvpn --config client.ovpn</code> in Ubuntu (and also via Network Manager after importing the config). All good.</p>
  <p>Now I want to make it so my other EC2 instances (that host the actual app) can only be accessed via the VPN, and can't be SSH'd into directly for example. The security group of one of these EC2 instances looks like</p>
  <p><a href="https://i.stack.imgur.com/8xTdv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8xTdv.png" alt="enter image description here" /></a></p>
  <p>where here I'm allowing inbound traffic on port 22 from the <em>Private IPv4 addresses</em> of the OVPN server.</p>
  <p>However, if I connect to the VPN and try to SSH to the app EC2 instance it just times out, nor can I access the web when connected to the VPN.
  If I allow SSH on port 22 from 0.0.0.0 then I can SSH in and no issues.</p>
  <p>Could anyone point me toward what the problem might be?</p>
  <p>Could it be because they are on different subnets?</p>