Hello people, and thanks to everyone for having put up this amazing community alongside with all the documentations available.
This is my first time setting up an OpenVPN ptp server, therefore I do apologise in advantage for all the newbees questions I might come up with.
A shot brief about my home network before I get any further. The OpenVPN Server is hosted on my OpenWrt router, which at the same time acts like a modem dialling the pppoe on the Vigor 120 modem which is set to work in MPOA (half bridge), and still on the Vigor 120 modem I have set up a DMZ on the OpenWrt router allowing all the data coming IN/OUT.
Vigor 120 modem: 192.168.0.1
OpenWrt router: 192.168.1.1
OpenVPN Server: 192.168.1.1
I can ping/access any OpenVPN clients connected from any clients connected to my local network and I can ping/access any clients connected on my local network from any OpenVPN clients connected. Basically the only problem is that the clients connected to the OpenVPN server for some reason are unable to access to the internet, unable to ping external DNS and IP.
I have spent two long sleepless days trying to figure this out, but in the end I believe this is getting beyond my pay grade.
Here is the server config.
port 1194
proto udp
dev tun
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/HomeVPN.crt
key /etc/openvpn/easy-rsa/keys/HomeVPN.key
dh /etc/openvpn/easy-rsa/keys/dh1024.pem
ifconfig-pool-persist /tmp/ipp.txt
server 10.8.0.0 255.255.255.0
push "route 192.168.1.0 255.255.255.0"
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
client-config-dir ccd
client-to-client
keepalive 10 120
persist-key
persist-tun
status /tmp/openvpn-status.log
verb 3
/etc/config/firewall
config zone
option network 'vpn'
option name 'vpn'
option input 'ACCEPT'
option forward 'REJECT'
option output 'ACCEPT'
config forwarding
option dest 'lan'
option src 'vpn'
config forwarding
option dest 'vpn'
option src 'lan'
config forwarding
option src 'lan'
option dest 'wan'
/etc/firewall.user
iptables -t nat -A PREROUTING -p udp -i pppoe-wan --dport 1194 -j ACCEPT;
iptables -A INPUT -p udp -i pppoe-wan --dport 1194 -j ACCEPT;
iptables -I INPUT -i tun+ -j ACCEPT;
iptables -I FORWARD -i tun+ -j ACCEPT;
iptables -I OUTPUT -o tun+ -j ACCEPT;
iptables -I FORWARD -o tun+ -j ACCEPT;
# NAT the VPN client traffic to the internet
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o pppoe-wan -j MASQUERADE;
#
iptables -A FORWARD -i tun+ -o pppoe-wan -m state --state RELATED,ESTABLISHED -j ACCEPT;
iptables -A FORWARD -i pppoe-wan -o tun+ -m state --state RELATED,ESTABLISHED -j ACCEPT;
route /on the server
Destination Gateway Genmask Flags Metric Ref Use Iface
default 151.6.156.72 0.0.0.0 UG 0 0 0 pppoe-wan
10.8.0.0 10.8.0.2 255.255.255.0 UG 0 0 0 tun0
10.8.0.2 * 255.255.255.255 UH 0 0 0 tun0
151.6.156.72 * 255.255.255.255 UH 0 0 0 pppoe-wan
192.168.1.0 * 255.255.255.0 U 0 0 0 br-lan
Some logs when a client connects to the server
Mon Mar 17 03:58:57 2014 OpenVPN 2.3.2 mips-openwrt-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [MH] [IPv6] built on Mar 13 2014
Mon Mar 17 03:58:57 2014 Diffie-Hellman initialized with 1024 bit key
Mon Mar 17 03:58:57 2014 Socket Buffers: R=[163840->131072] S=[163840->131072]
Mon Mar 17 03:58:57 2014 TUN/TAP device tun0 opened
Mon Mar 17 03:58:57 2014 TUN/TAP TX queue length set to 100
Mon Mar 17 03:58:57 2014 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Mon Mar 17 03:58:57 2014 /sbin/ifconfig tun0 10.8.0.1 pointopoint 10.8.0.2 mtu 1500
Mon Mar 17 03:58:57 2014 /sbin/route add -net 10.8.0.0 netmask 255.255.255.0 gw 10.8.0.2
Mon Mar 17 03:58:57 2014 UDPv4 link local (bound): [undef]
Mon Mar 17 03:58:57 2014 UDPv4 link remote: [undef]
Mon Mar 17 03:58:57 2014 MULTI: multi_init called, r=256 v=256
Mon Mar 17 03:58:57 2014 IFCONFIG POOL: base=10.8.0.4 size=62, ipv6=0
Mon Mar 17 03:58:57 2014 ifconfig_pool_read(), in='client_Pietro-pkcs,10.8.0.4', TODO: IPv6
Mon Mar 17 03:58:57 2014 succeeded -> ifconfig_pool_set()
Mon Mar 17 03:58:57 2014 IFCONFIG POOL LIST
Mon Mar 17 03:58:57 2014 client_Pietro-pkcs,10.8.0.4
Mon Mar 17 03:58:57 2014 Initialization Sequence Completed
Mon Mar 17 04:00:47 2014 192.168.1.186:55758 TLS: Initial packet from [AF_INET]192.168.1.186:55758, sid=c9673af3 53a8cc0d
Mon Mar 17 04:00:47 2014 192.168.1.186:55758 VERIFY OK: depth=1, C=IT, L=Taranto, O=OpenWrt Home Router, OU=HomeVPN, CN=Homerouter, name=HomeVPN, emailAddress=kernel.panic007@gmail.com
Mon Mar 17 04:00:47 2014 192.168.1.186:55758 VERIFY OK: depth=0, C=IT, L=Taranto, O=OpenWrt Home Router, OU=HomeVPN, CN=client_Pietro-pkcs, name=HomeVPN, emailAddress=kernel.panic007@gmail.com
Mon Mar 17 04:00:47 2014 192.168.1.186:55758 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Mon Mar 17 04:00:47 2014 192.168.1.186:55758 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Mon Mar 17 04:00:47 2014 192.168.1.186:55758 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Mon Mar 17 04:00:47 2014 192.168.1.186:55758 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Mon Mar 17 04:00:47 2014 192.168.1.186:55758 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 1024 bit RSA
Mon Mar 17 04:00:47 2014 192.168.1.186:55758 [client_Pietro-pkcs] Peer Connection Initiated with [AF_INET]192.168.1.186:55758
Mon Mar 17 04:00:47 2014 client_Pietro-pkcs/192.168.1.186:55758 MULTI_sva: pool returned IPv4=10.8.0.6, IPv6=(Not enabled)
Mon Mar 17 04:00:47 2014 client_Pietro-pkcs/192.168.1.186:55758 MULTI: Learn: 10.8.0.6 -> client_Pietro-pkcs/192.168.1.186:55758
Mon Mar 17 04:00:47 2014 client_Pietro-pkcs/192.168.1.186:55758 MULTI: primary virtual IP for client_Pietro-pkcs/192.168.1.186:55758: 10.8.0.6
Mon Mar 17 04:00:50 2014 client_Pietro-pkcs/192.168.1.186:55758 PUSH: Received control message: 'PUSH_REQUEST'
Mon Mar 17 04:00:50 2014 client_Pietro-pkcs/192.168.1.186:55758 send_push_reply(): safe_cap=940
Mon Mar 17 04:00:50 2014 client_Pietro-pkcs/192.168.1.186:55758 SENT CONTROL [client_Pietro-pkcs]: 'PUSH_REPLY,route 192.168.1.0 255.255.255.0,redirect-gateway def1 bypass-dhcp,dhcp-option DNS 8.8.8.8,dhcp-option DNS 8.8.4.4,route 10.8.0.0 255.255.255.0,topology net30,ping 10,ping-restart 120,ifconfig 10.8.0.6 10.8.0.5' (status=1)
I do apologise for the extremely long post. I am going to post the client conf alongside with some logs on the following post.
Thanks