I am running openvpn 2.3.2 on an ubuntu 14.04 box, the following server/client configuration works for tcp perfectly:
server:
server 10.8.0.0 255.255.255.0
push "dhcp-option DNS 10.8.0.1"
dev tun
proto tcp
port 53
ping 290
verb 3
comp-lzo
ifconfig-pool-persist ipp.txt
status openvpn-status.log
client-to-client
duplicate-cn
persist-key
persist-tun
dh dh2048.pem
ca ca.crt
cert server.crt
key server.key
log '/var/log/openvpn/openvpn.log'
client:
client
dev tun
proto udp
remote x.x.x.x
port 53
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert client.crt
key client.key
comp-lzo
verb 5
ping-restart 0
remote-cert-tls server
redirect-gateway def1
dhcp-option DNS 8.8.8.8
However if I change `proto tcp` to `proto udp` on both file, the client would still connect, but can not access internet through server.
I have:
# cat /proc/sys/net/ipv4/ip_forward
1
# ufw status
Status: active
To Action From
-- ------ ----
53 ALLOW Anywhere
80 ALLOW Anywhere
53 (v6) ALLOW Anywhere (v6)
80 (v6) ALLOW Anywhere (v6)
and in /etc/ufw/before.rules:
# START OPENVPN RULES
# NAT table rules
*nat
:POSTROUTING ACCEPT [0:0]
# Allow traffic from OpenVPN client to eth0
-A POSTROUTING -s 10.8.0.0/8 -o eth0 -j MASQUERADE
COMMIT
# END OPENVPN RULES
These are all changes I made to default ufw settings.
Anything else to look at?