Software developer here, trying to get his sysadmin-foo up and running by setting up an OpenVPN server on amazon EC2 to access all the internal resources there. Here's how I envision that on a fresh Ubuntu 12.04 Canonical AMI:
Local network / EC2 Cloud, 10.*.*.*/255.0.0.0
172.16.20.*/ ,'
255.255.255.0 ,' +-----------------+
.' |Amazon DNS server|
| ,'| 172.16.0.23 |
+---------------+ | ,' +-----------------+
| Workstation | | ,'
| XXX | +-------,'------+
| 172.16.20.1 | XXXX | OpenVPN server|
+------`.-------+ \ XX 10.23.45.67 `-. +-------------+
\ '. +---------------+ `-. Second server
+--------`.---+ | | 10.23.45.68 |
|Local server | \ +-------------+
| 172.16.20.2 | \
+-------------+ \
Clients can connect to the VPN (even on iPhone), but I'm having trouble to get a full overview of which subsystems i need to check.
Here are my goals for the setup:
- VPN clients should be able to access internal resources via the vpn, the rest of the internet should be routed via the local gateway
- VPN clients should be able to access all servers the OpenVPN server can access
- VPN clients should use the Amazon DNS server at
172.16.0.23
as their primary dns server, because that server resolves Amazon's generated hostnames to internal ip addresses (i.e.ec2-45-67-8-9.eu-west-1.compute.amazonaws.com
would resolve to10.23.45.67
when resolved by that server, but to45.67.8.9
everywhere else) - VPN clients should see each other
Here's how I configured /etc/openvpn/server.conf
(just the interesting bits, i hope):
persist-tun
server 172.16.10.0 255.255.255.0
push "route-gateway 172.16.10.1"
push "route 10.0.0.0 255.0.0.0"
push "route 172.16.0.23"
push "dhcp-option DNS 172.16.0.23"
However, I'm not sure which parts of these the openvpn server does for me:
- Do I need to configure iptables on the server ? If so, how ?
- Do I need to set routes on the server (besides the ones being pushed to the client) ? If so, which and how ?
- What other networking software am I missing that causes my clients not to connect successfully ?