Client cannot connect to server connection or other network devices

Business solution to host your own OpenVPN server with web management interface and bundled clients.
Post Reply
Wublide
OpenVpn Newbie
Posts: 3
Joined: Mon Nov 21, 2016 12:05 am

Client cannot connect to server connection or other network devices

Post by Wublide » Mon Nov 21, 2016 12:40 am

Hi all

Im' trying to configure an openvpn server on my new raspberry and after configuring and creating two profiles (one "split" for only local connection and one "full" for full connection with server's internet access too) i can successfully connect to the server with both client configs but i cannot access lan devices nor internet on my server's connection. I have already read all topics on this topic searching in google but with no luck on any attempts =(

here are the information:

router ip: 192.168.1.1
rPi ip: 192.168.1.100
OpenVPN Version: 2.3.4-5+deb8u1


server.conf

Code: Select all

port 1194
proto udp
dev tun
ca *
cert *
key *
dh *
tls-server
tls-auth /etc/openvpn/easy-rsa/keys/ta.key 0
tls-cipher TLS-DHE-RSA-WITH-AES-256-CBC-SHA
server 10.8.0.0 255.255.255.0
push "route 192.168.1.0 255.255.255.0"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
push "redirect-gateway def1"
client-to-client
duplicate-cn
keepalive 10 120
cipher AES-256-CBC
auth SHA512
key-direction 0
comp-lzo yes
max-clients 5
user nobody
group nogroup
persist-key
persist-tun
status /var/log/openvpn-status.log 300
log /var/log/openvpn.log
verb 1
mute 20
clients conf (full)

Code: Select all

client
dev tun
proto udp
resolv-retry infinite
key-direction 1
nobind
persist-key
persist-tun
remote ***MYSERVERADDRESS***
cipher AES-256-CBC
auth SHA512
tls-client
tls-cipher DHE-RSA-AES256-SHA
comp-lzo yes
mute-replay-warnings
verb 3
mute 20
clients conf (split)

Code: Select all

client
dev tun
proto udp
resolv-retry infinite
key-direction 1
nobind
persist-key
persist-tun
remote ***MYSERVERADDRESS***
route-nopull
route 0.0.0.0 192.0.0.0 net_gateway
route 64.0.0.0 192.0.0.0 net_gateway
route 128.0.0.0 192.0.0.0 net_gateway
route 192.0.0.0 192.0.0.0 net_gateway
route 192.168.1.0 255.255.255.0
cipher AES-256-CBC
auth SHA512
tls-client
tls-cipher DHE-RSA-AES256-SHA
comp-lzo
mute-replay-warnings
verb 3
mute 20

Wublide
OpenVpn Newbie
Posts: 3
Joined: Mon Nov 21, 2016 12:05 am

Re: Client cannot connect to server connection or other network devices

Post by Wublide » Mon Nov 21, 2016 1:35 am

problem solved! or at least i nailed it: it's the firewall rules that won't load on startup, i tried it manually and everything is perfect! but how can i solve this? i gave it chown root and chmod 700 and this is the etc\network\interfaces:

Code: Select all

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual
    pre-up /etc/firewall-openvpn-rules.sh

allow-hotplug wlan0
iface wlan0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

allow-hotplug wlan1
iface wlan1 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

Wublide
OpenVpn Newbie
Posts: 3
Joined: Mon Nov 21, 2016 12:05 am

Re: Client cannot connect to server connection or other network devices

Post by Wublide » Mon Nov 21, 2016 2:04 am

solved even that!
i added the line "auto eth0" in the interfaces file like this

Code: Select all

auto eth0
iface eth0 inet manual
    pre-up /etc/firewall-openvpn-rules.sh
and rules are applied after boot!
i know i've talked to myself afterall but i hope this can help someone in the future!

Post Reply