Decided to collect the info after all before sleeping.
Will read pages tomorrow.
Here are the two conf files without comments, note that the serverlocal is used by an openvpn instance which only allows clients to access the LAN and not the Internet (a split tunnel config), whereas the serverweb.conf file is also channeling web traffic via the tunnel.
Currently they share the ccd directory, which is probably not good...:
port 1198
proto udp
dev tun
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/AGIVPN.crt
key /etc/openvpn/easy-rsa/keys/AGIVPN.key # This file should be kept secret
dh /etc/openvpn/easy-rsa/keys/dh2048.pem
topology subnet
server 10.8.1.0 255.255.255.0 'nopool'
ifconfig-pool 10.8.1.2 10.8.1.127 255.255.255.0
ifconfig-pool-persist ipp2.txt
push "route 10.0.0.0 255.255.255.0"
client-config-dir /etc/openvpn/ccd
keepalive 10 120
tls-auth /etc/openvpn/easy-rsa/keys/ta.key 0 # This file is secret
cipher AES-256-CBC
comp-lzo
max-clients 20
user openvpn
group nogroup
persist-key
persist-tun
status /etc/openvpn/log/openvpn-status2.log
log /etc/openvpn/log/openvpn2.log
verb 4
explicit-exit-notify 1
port 1199
proto udp
dev tun
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/AGIVPN.crt
key /etc/openvpn/easy-rsa/keys/AGIVPN.key # This file should be kept secret
dh /etc/openvpn/easy-rsa/keys/dh2048.pem
topology subnet
server 10.8.0.0 255.255.255.0 'nopool'
ifconfig-pool 10.8.0.2 10.8.0.127 255.255.255.0
client-config-dir /etc/openvpn/ccd
ifconfig-pool-persist ipp.txt
push "route 10.0.0.0 255.255.255.0"
push "redirect-gateway def1 bypass-dhcp"
keepalive 10 120
tls-auth /etc/openvpn/easy-rsa/keys/ta.key 0 # This file is secret
cipher AES-256-CBC
comp-lzo
max-clients 20
user openvpn
group nogroup
persist-key
persist-tun
status /etc/openvpn/log/openvpn-status.log
log /etc/openvpn/log/openvpn.log
verb 4
explicit-exit-notify 1
And here is the ccd file for the client who will only be granted access to a single server on the LAN and therefore has to get a known IP address. As you can see it uses a network handled by serverlocal (and the name is actually my own Common Name for testing purposes):
File name = ccd/BosseB_AGI
ifconfig-push 10.8.1.130 255.255.255.0
And the corresponding ovpn file:
client
dev tun
proto udp
remote vpn.xxxxx.com 1198
resolv-retry infinite
nobind
persist-key
persist-tun
mute-replay-warnings
remote-cert-tls server
key-direction 1
cipher AES-256-CBC
comp-lzo
verb 1
mute 20
next follow the certificates and keys
Server side network configuration (edited out statistics and loopback/wifi adapters):
Gateway is not listed but is 10.0.0.1/24
ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.0.235 netmask 255.255.255.0 broadcast 10.0.0.255
tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
inet 10.8.0.1 netmask 255.255.255.0 destination 10.8.0.1
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 100 (UNSPEC)
tun1: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
inet 10.8.1.1 netmask 255.255.255.0 destination 10.8.1.1
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 100 (UNSPEC)
Currently IPTABLES are empty except for the nat table:
----- table nat ------
-A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
-A POSTROUTING -s 10.8.1.0/24 -o eth0 -j MASQUERADE
That's about it.
I can connect as it is and I am getting the IP address set in the ccd file, so that part seems to work.
But right now I have
full access to the local LAN, which is what I want to limit.