Hi, I run openvpn on linux box 192.168.0.16 (- server.conf) uses gateway 192.168.0.1 and I have opened UDP port 1194 for 192.168.0.16
I have client linux box at a remote location on 192.168.1.8 with a router gateway at 192.168.1.1
(I know about the advice against using the 192.168.x.x but these are static machines)
The problem I have is that the client sends all internet traffic down the vpn i think... I would like to be able to browse the internet from the client without relying on the vpn working. the only solution I have found is to use the command:
sudo route del -net 0.0.0.0 gw 10.8.0.1 netmask 128.0.0.0 dev tun0
from the client and i can the browse the internet as normal BUT my vpn no longer works properly
After I use the above command and run /sbin/route -n on the client i get:
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 enp2s0
10.8.0.0 0.0.0.0 255.255.255.0 U 0 0 0 tun0
82.1.252.6 192.168.1.1 255.255.255.255 UGH 0 0 0 enp2s0
128.0.0.0 10.8.0.1 128.0.0.0 UG 0 0 0 tun0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 enp2s0
172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0
192.168.0.0 10.8.0.1 255.255.255.0 UG 0 0 0 tun0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 enp2s0
If I run /sbin/route -n on the server machine i get:
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 100 0 0 enp2s0
10.8.0.0 0.0.0.0 255.255.255.0 U 0 0 0 tun0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 enp2s0
192.168.0.0 0.0.0.0 255.255.255.0 U 100 0 0 enp2s0
192.168.1.0 10.8.0.2 255.255.255.0 UG 0 0 0 tun0
I am a newbie to this but I understand the server.conf pushes some routes to use to the client:
server 10.8.0.0 255.255.255.0
push "route 192.168.0.0 255.255.255.0"
client-config-dir ccd
route 192.168.1.0 255.255.255.0
client-to-client
push "route 192.168.1.0 255.255.255.0"
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
Can anyone shine some light on how route 0.0.0.0 gw 10.8.0.1 netmask 128.0.0.0 dev tun0 gets added to the client routing table? Any why do I need it? All i want to do is use the vpn to access some homeautomation web pages on the client 192.168.1.8:XXXX
And is is normal to have two entries for destination 0.0.0.0 on the client?
thanks...stuart