I managed to install a openvpn server in a raspberry pi 2.
Everything is OK, I can access Internet in Android and Ubuntu though the VPN but I cannot connect to my own websites which are in the same raspberry. If I connect those websites without the VPN they works but through the VPN it redirects me to my router configuration Web.
My server.conf is
Code: Select all
local 192.168.1.112
dev tun
proto udp
port 1194
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/server.crt
key /etc/openvpn/easy-rsa/keys/server.key
dh /etc/openvpn/easy-rsa/keys/dh1024.pem user nobody
group nogroup
server 10.8.0.0 255.255.255.0
# server and remote endpoints
ifconfig 10.8.0.1 10.8.0.2
push "route 10.8.0.1 255.255.255.255"
push "route 10.8.0.0 255.255.255.0"
# SWAP THE IP NUMBER WITH YOUR RASPBERRY PI IP ADDRESS,
# AND MAKE SURE THE SUBNET IS CORRECT
push "route 192.168.1.112 255.255.255.0"
# This should match your router address and not need to be changed.
# If your router does not do DNS, you can use Google DNS 8.8.8.8
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
#push "dhcp-option DNS 192.168.1.1"
# Override the Client default gateway by using 0.0.0.0/1 and
# 128.0.0.0/1 rather than 0.0.0.0/0. This has the benefit of
# overriding but not wiping out the original
push "redirect-gateway def1"
#ifconfig-pool-persist ipp.txt
client-to-client
duplicate-cn
keepalive 10 120
#tls-auth /etc/openvpn/easy-rsa/keys/ta.key 0
#cipher AES-128-CBC
comp-lzo
persist-key
persist-tun
status /var/log/openvpn-status.log 20
log /var/log/openvpn.log
verb 1
Code: Select all
dev tun
client
proto udp
remote mywebsite.com 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert client1.crt
key client1.key
comp-lzo
verb 3
Code: Select all
iptables -t nat -A INPUT -i eth0 -p udp -m udp --dport 1194 -j ACCEPT
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j SNAT --to-source 192.168.1.112
Does anyone know how the bypass or redirect websites to local IP or something similar to be able to access my websites?
Thanks in advance.