Grant access to a single address

This forum is for admins who are looking to build or expand their OpenVPN setup.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
Specialist-Home-91
OpenVpn Newbie
Posts: 1
Joined: Tue Sep 14, 2021 9:24 am

Grant access to a single address

Post by Specialist-Home-91 » Tue Sep 14, 2021 9:26 am

I am trying to create a client that only has access to one machine on the local network, similar to the example shown in the official OpenVPN guide.

Code: Select all

port 56620
proto udp
dev tun
user nobody
group nogroup
persist-key
persist-tun
keepalive 10 120
server 10.8.0.0 255.255.255.0
route 10.8.1.0 255.255.255.0
route 10.8.2.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "dhcp-option DNS 94.140.14.14"
push "dhcp-option DNS 94.140.15.15"
push "redirect-gateway def1 bypass-dhcp"
dh none
ecdh-curve prime256v1
tls-crypt tls-crypt.key
crl-verify crl.pem
ca ca.crt
cert server_Vc69lZWuzsZNT4ph.crt
key server_Vc69lZWuzsZNT4ph.key
auth SHA256
cipher AES-128-GCM
ncp-ciphers AES-128-GCM
tls-server
tls-version-min 1.2
tls-cipher TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
client-config-dir /etc/openvpn/ccd
status /var/log/openvpn/status.log
verb 3
The client should have a static IP that have access via IPTables to another IP in the LAN, but unfortunately the client can only see the server that host the OpenVPN service.

Code: Select all

ifconfig-push 10.8.2.1 10.8.2.2
I added the firewall rules needed,

Code: Select all

sudo iptables -A FORWARD -i tun -s 10.8.2.0/24 -d 192.168.2.216 -j ACCEPT
Whit this configuration I can ping the OpenVPN Server host but I cannot see or interact with the target server, 192.168.2.216. am I missing something?

Thank you!

trideep
OpenVpn Newbie
Posts: 9
Joined: Tue Jul 06, 2021 7:05 am

Re: Grant access to a single address

Post by trideep » Tue Sep 14, 2021 2:45 pm

The routes to the target network must be pushed to the client. You're trying to reach 192.168.2.216 via the server which was never pushed.

Post Reply