setch
I have a number of openvpn servers running on Ubuntu server LTS. Clients can connect, I can ssh to the server using the server local ip address, and get web interfaces up on other devices in the vpn network. Also internet access is fine.
I have just set up a new server with Ubuntu 22.04 server LTS, using the ubuntu-openvpn-install.sh. This has installed without error, and the openvpn process is running. A client .ovpn file was created, and installed onto a Linux Mint workstation in a remote location. Connection to the server is instantaneous. ip address 10.8.0.2 issued to workstation, but ping, ssh, www access produces no output at all.
I have checked the server.conf against those on my other remote servers, and I can see no differences.
I'm stumped as to where the issue lies.
I'd be grateful if anyone can suggest what might be the problem area.
Thanks
pkkrusty
Got it!
My trouble was in my iptables. Using a raspberry pi, but this might point you in the right direction. I had a working config, and a new 64-bit non-working config. I could connect to the OpenVPN server and access resources on the OpenVPN server itself, but not see the rest of the LAN that the server was on. So clearly a routing issue. In my iptables (/etc/iptables/rules.v4) I see the following key lines:
```
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -i eth0 -p tcp -m tcp --dport 1194 -m comment --comment openvpn-input-rule -j ACCEPT #note that my setup has to use TCP rather than the more common UDP
COMMIT
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A POSTROUTING -s 10.12.243.0/24 -o eth0 -m comment --comment openvpn-nat-rule -j MASQUERADE #your IP will vary from mine obviously.
COMMIT
```
My problem was that I initially set up OpenVPN while the machine was on wifi. Then put it in its final place with ethernet cable plugged in. So the VPN tried to bridge traffic through wlan0, and didn't get anywhere. I needed to change `wlan0` to `eth0` in the -A POSTROUTING line.
Not sure if the OpenVPN *filter INPUT ACCEPT policy is necessary, since I already have ACCEPT as default. But I changed `wlan0` to `eth0` there too just in case.