I started with a fresh Centos 7.2 instance and disabled the firewall and selinux.
Server IP: 10.250.0.2
Server Subnet: 10.250.0.0/16
Tun0 Interface IP: 10.254.254.1
Tun0 Interface Subnet: 10.254.254.0/24
Client IP: 10.0.0.1
Client Subset: 10.0.0.0/24
Here is server_tun.conf:
;local a.b.c.d
;proto tcp
proto udp
;dev tap0
dev tun
;dev-node MyTap
ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/server.crt
key /etc/openvpn/keys/server.key # This file should be kept secret
dh /etc/openvpn/keys/dh2048.pem
;topology subnet
server 10.254.254.0 255.255.255.0
ifconfig-pool-persist ipp.txt
;server-bridge 10.250.0.2 255.255.255.0 10.250.0.3 10.254.0.254
push "route 10.250.0.0 255.255.0.0"
client-config-dir ccd
route 10.0.0.0 255.255.255.0
;learn-address ./script
;push "redirect-gateway def1 bypass-dhcp"
;push "dhcp-option DNS 208.67.220.220"
client-to-client
keepalive 10 120
;tls-auth /etc/openvpn/keys/ta.key 0 # This file is secret
;cipher BF-CBC # Blowfish (default)
;cipher AES-128-CBC # AES
;cipher DES-EDE3-CBC # Triple-DES
comp-lzo
;max-clients 100
user nobody
group nobody
persist-key
persist-tun
status openvpn-status.log
;log openvpn.log
;log-append openvpn.log
verb 3
;mute 20
Here is the ccd file for the client:
[/code]
iroute 10.0.0.0 255.255.255.0
[/code]
The docs go on to say:
Next, you must set up a route on the server-side LAN gateway to route the VPN client subnet (10.8.0.0/24) to the OpenVPN server (this is only necessary if the OpenVPN server and the LAN gateway are different machines).
I'm not sure I did this right. The gateway for a GCE slice is the first ip on the subnet, which in this case is 10.250.0.1. In the network settings for the 10.250.0.0/16 (in the GCS web front-end) I added a route for both the 10.254.254.0/24 and 10.0.0.0/24 subnets, and made the "next hop" point to the OpenVPN server (presumably ip address 10.250.0.2).
In addition, in the firewall settings for the subnet I made sure port 1194 was open for any source.
When I start the server I see this:
Fri Mar 18 05:31:31 2016 OpenVPN 2.3.10 x86_64-redhat-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Jan 4 2016
Fri Mar 18 05:31:31 2016 library versions: OpenSSL 1.0.1e-fips 11 Feb 2013, LZO 2.06
Fri Mar 18 05:31:31 2016 Diffie-Hellman initialized with 2048 bit key
Fri Mar 18 05:31:31 2016 Socket Buffers: R=[212992->212992] S=[212992->212992]
Fri Mar 18 05:31:31 2016 ROUTE_GATEWAY 10.250.0.1
Fri Mar 18 05:31:31 2016 TUN/TAP device tun0 opened
Fri Mar 18 05:31:31 2016 TUN/TAP TX queue length set to 100
Fri Mar 18 05:31:31 2016 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Fri Mar 18 05:31:31 2016 /usr/sbin/ip link set dev tun0 up mtu 1500
Fri Mar 18 05:31:31 2016 /usr/sbin/ip addr add dev tun0 local 10.254.254.1 peer 10.254.254.2
Fri Mar 18 05:31:31 2016 /usr/sbin/ip route add 10.0.0.0/24 via 10.254.254.2
Fri Mar 18 05:31:31 2016 /usr/sbin/ip route add 10.254.254.0/24 via 10.254.254.2
Fri Mar 18 05:31:31 2016 GID set to nobody
Fri Mar 18 05:31:31 2016 UID set to nobody
Fri Mar 18 05:31:31 2016 UDPv4 link local (bound): [undef]
Fri Mar 18 05:31:31 2016 UDPv4 link remote: [undef]
Fri Mar 18 05:31:31 2016 MULTI: multi_init called, r=256 v=256
Fri Mar 18 05:31:31 2016 IFCONFIG POOL: base=10.254.254.4 size=62, ipv6=0
Fri Mar 18 05:31:31 2016 ifconfig_pool_read(), in='ads-120elm-pfsense,10.250.0.3', TODO: IPv6
Fri Mar 18 05:31:31 2016 succeeded -> ifconfig_pool_set()
Fri Mar 18 05:31:31 2016 IFCONFIG POOL LIST
Fri Mar 18 05:31:31 2016 Initialization Sequence Completed
I don't know where that 10.254.254.2 address is coming from.
I am able to connect from the pfsense client, but I cannot ping the ip addresses of either the tun or eth interfaces from a computer on the client lan, nor can I ping any computer on the client lan from the server side, or the gateway, or the 10.254.254.4/5/6 address I see mentioned in the server's console output when the cllient connects.
Fri Mar 18 05:42:27 2016 69.115.109.60:45723 TLS: Initial packet from [AF_INET]69.115.109.62:45723, sid=34f4556a 9aae74a9
Fri Mar 18 05:42:30 2016 69.115.109.60:45723 VERIFY OK: depth=1, C=US, ST=CA, L=Newark, O=ADS, OU=MyOrganizationalUnit, CN=ads-vpn-server-1, name=EasyRSA, emailAddress=me@mymail.com
Fri Mar 18 05:42:30 2016 69.115.109.62:45723 VERIFY OK: depth=0, C=US, ST=CA, L=Newark, O=ADS, OU=MyOrganizationalUnit, CN=ads-pfsense, name=EasyRSA, emailAddress=me@mymail.com
Fri Mar 18 05:42:31 2016 69.115.109.62:45723 WARNING: 'dev-type' is used inconsistently, local='dev-type tun', remote='dev-type tap'
Fri Mar 18 05:42:31 2016 69.115.109.62:45723 WARNING: 'link-mtu' is used inconsistently, local='link-mtu 1542', remote='link-mtu 1574'
Fri Mar 18 05:42:31 2016 69.115.109.62:45723 WARNING: 'tun-mtu' is used inconsistently, local='tun-mtu 1500', remote='tun-mtu 1532'
Fri Mar 18 05:42:31 2016 69.115.109.62:45723 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Fri Mar 18 05:42:31 2016 69.115.109.62:45723 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Fri Mar 18 05:42:31 2016 69.115.109.62:45723 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Fri Mar 18 05:42:31 2016 69.115.109.62:45723 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Fri Mar 18 05:42:31 2016 69.115.109.62:45723 Control Channel: TLSv1.2, cipher TLSv1/SSLv3 DHE-RSA-AES256-GCM-SHA384, 2048 bit RSA
Fri Mar 18 05:42:31 2016 69.115.109.62:45723 [ads-120elm-pfsense] Peer Connection Initiated with [AF_INET]69.115.109.62:45723
Fri Mar 18 05:42:31 2016 ads-120elm-pfsense/69.115.109.62:45723 MULTI_sva: pool returned IPv4=10.254.254.6, IPv6=(Not enabled)
Fri Mar 18 05:42:31 2016 ads-120elm-pfsense/69.115.109.62:45723 MULTI: Learn: 10.254.254.6 -> ads-120elm-pfsense/69.115.109.60:45723
Fri Mar 18 05:42:31 2016 ads-120elm-pfsense/69.115.109.62:45723 MULTI: primary virtual IP for ads-120elm-pfsense/69.115.109.60:45723: 10.254.254.6
Fri Mar 18 05:42:33 2016 ads-120elm-pfsense/69.115.109.62:45723 PUSH: Received control message: 'PUSH_REQUEST'
Fri Mar 18 05:42:33 2016 ads-120elm-pfsense/69.115.109.62:45723 send_push_reply(): safe_cap=940
Fri Mar 18 05:42:33 2016 ads-120elm-pfsense/69.115.109.62:45723 SENT CONTROL [ads-120elm-pfsense]: 'PUSH_REPLY,route 10.250.0.0 255.255.0.0,route 10.254.254.0 255.255.255.0,topology net30,ping 10,ping-restart 120,ifconfig 10.254.254.6 10.25
4.254.5' (status=1)
I'm only able to ping 10.254.254.6, and only from the client side.
The settings on the client side are the same as in the image in my last post:
I've tried with and without the remote networks set explicitly on the client side.
I've tried tcp instead of udp.
I've tried disabling the firewall and selinux.
I've tried the tap0 interface and server-bridge method. I was able to get the bridge-start script working by adding the default gateway at the end of the script. Unfortunately, though the docs said that computers on the server lan would be visible out of the box, they were not. As far as making the client-side subnet available to the server-side, I do not know enough about pfsense to follow that part of the docs (which is not descriptive).
Any help is much appreciated.