I have set up openvpn on ubuntu 18.04 and created several users with success using
https://github.com/angristan/openvpn-install. (I port forward from the router to the server.)
Now I am trying to set up restricted access following
https://openvpn.net/community-resources/configuring-client-specific-rules-and-access-policies/.
I want 10.8.1.0/24 to only have access to 192.168.1.1. Here is what I have done.
0. Create
client1 using
https://github.com/angristan/openvpn-install with default setup and it works fine with private ip 10.8.0.6.
1. Add push "route 10.8.1.0 255.255.255.0" in server.config
2. For
client1, I put "ifconfig-push 10.8.1.1 10.8.1.2" to ccd/client1
3. iptables -A FORWARD -i tun0 -s 10.8.1.0/24 -d 192.168.1.1 -j ACCEPT
When try to connect on the client side, it returns the following error:
There was an error attempting to connect to the selected server. Error message: addr_pair_mask_parse_error: AddMaskPair parse error 'ifconfig' 10.8.1.1/10.8.1.2: ipv4_exception: malformed netmask
Did I miss something? I notices that using the openvpn-install setup, client1 has private ip 10.8.0.6. Should I change it first? Thanks in advance!