0

I have been trying to setup OpenVPN and have run into a bit of a hiccup, i have can't seem to route all my traffic through the server. I can connect to the server just fine but i can't seem to ping the server once connected or have any traffic from the client pushed via the server.

server.conf

local 94.23.xxx.xxx
port 1194
proto udp
dev tun
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 10.8.0.0 255.255.255.0"
;push "redirect-gateway def1 bypass-dhcp" 
;push "redirect-gateway def1"
push "dhcp-option DNS 208.67.220.222"
push "dhcp-option DNS 208.67.220.220"

when i uncomment ;push "redirect-gateway def1 bypass-dhcp" or ;push "redirect-gateway def1" i lose connection to my server and have to comment them out.

I think there might be something wrong with the way i configured iptables

iptables -L -v -n --line-numbers
Chain INPUT (policy ACCEPT 147K packets, 12M bytes)
num   pkts bytes target     prot opt in     out     source               destination
1        0     0 ACCEPT     all  --  tun0   *       0.0.0.0/0            0.0.0.0/0

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
1        0     0 ACCEPT     all  --  tun0   *       0.0.0.0/0            0.0.0.0/0
2        0     0 ACCEPT     all  --  tun0   eth0    0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED
3        0     0 ACCEPT     all  --  eth0   tun0    0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED
4        0     0 ACCEPT     all  --  *      eth0    10.8.0.0/24          0.0.0.0/0

Chain OUTPUT (policy ACCEPT 260K packets, 606M bytes)
num   pkts bytes target     prot opt in     out     source               destination

netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         94.23.xxx.xxx    0.0.0.0         UG        0 0          0 eth0
10.8.0.0        10.8.0.2        255.255.255.0   UG        0 0          0 tun0
10.8.0.1        10.8.0.5        255.255.255.255 UGH       0 0          0 tun1
10.8.0.2        0.0.0.0         255.255.255.255 UH        0 0          0 tun0
10.8.0.5        0.0.0.0         255.255.255.255 UH        0 0          0 tun1
94.23.xxx.xxx      0.0.0.0         255.255.255.0   U         0 0          0 eth0

i will be happy to provide more details if needed Cheers!

0

Looks like I forgot to move the client.conf from the /etc/openvpn/ directory so when I uncommented those lines it just looped all the traffic of the server within the server! Doh!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.