0

long-time lurker, first time poster. I have read almost every post regarding open-vpn on this site, but I cannot get this issue fixed.

I can connect without issue to openvpn server and can ping internal addresses and 8.8.8.8, but I cannot reach the internet. I have modified the config files for both server and client, iptables, and ensured that my network is configured properly. Server was setup with the road warrior installation. Does anyone who why this will not work? I appreciate the help in advance.

Server.conf

port 51820
proto udp
dev tun
sndbuf 0
rcvbuf 0
ca ca.crt
cert server.crt
key server.key
dh dh.pem
tls-auth ta.key 0
topology subnet
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 192.168.1.1"
push "dhcp-option DNS 8.8.8.8"
keepalive 10 120
cipher AES-128-CBC
comp-lzo

client.ovpn

client
dev tun
proto udp
sndbuf 0
rcvbuf 0
remote [my_public_ip] 51820
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
cipher AES-128-CBC
comp-lzo
setenv opt block-outside-dns
key-direction 1
verb 3
<ca>
-----BEGIN CERTIFICATE-----

IP Tables

sudo iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-A INPUT -i eno1 -p udp -m state --state NEW -m udp --dport 51820 -j ACCEPT
-A INPUT -i tun+ -j ACCEPT
-A FORWARD -i tun+ -j ACCEPT
-A FORWARD -i tun+ -o eno1 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i eno1 -o tun+ -m state --state RELATED,ESTABLISHED -j ACCEPT
-A OUTPUT -o tun+ -j ACCEPT

Interfaces:

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eno1
iface eno1 inet static
address 192.168.1.213
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 192.168.1.1 8.8.8.8

sysctl.conf

net.ipv4.ip_forward=1
striker008
  • 11
  • 1
  • 2

1 Answers1

0

Looks like your configuration is okay for TCP connections, but not for UDP and, suddenly, DNS use UDP. This answer could clarify your problem.

Usually I use nat table for NAT organization, instead of using FORWARD in input table. May be you should try to configure your iptables according instruction like this.

Alexander Tolkachev
  • 4,608
  • 3
  • 14
  • 23