OpenVPN and ufw : unable to forward all traffic.

This forum is for general conversation and user-user networking.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
Annd
OpenVpn Newbie
Posts: 13
Joined: Tue Feb 04, 2014 7:14 am

OpenVPN and ufw : unable to forward all traffic.

Post by Annd » Tue Jan 10, 2023 1:01 pm

My OpenVPN is configured and works "perfectly" in the sense that client can connect to the server, and for example SSH into it - or access internet from over the VPN.

That is .. until I enable ufw on the server - once I do that - the client can still connect to the server - and ssh the server, but is unable to access internet anymore.
stopping ufw fixes it instantly.

my ufw rules:

Code: Select all

To                         Action      From
--                         ------      ----
Apache                     ALLOW       Anywhere                  
53/tcp                     ALLOW       Anywhere                  
51820/udp                  ALLOW       Anywhere                  
OpenSSH                    ALLOW       Anywhere                  
3306/tcp                   ALLOW       Anywhere                  
10000                      ALLOW       Anywhere                  
Samba                      ALLOW       Anywhere                  
1194                       ALLOW       Anywhere                  
Apache (v6)                ALLOW       Anywhere (v6)             
53/tcp (v6)                ALLOW       Anywhere (v6)             
51820/udp (v6)             ALLOW       Anywhere (v6)             
OpenSSH (v6)               ALLOW       Anywhere (v6)             
3306/tcp (v6)              ALLOW       Anywhere (v6)             
10000 (v6)                 ALLOW       Anywhere (v6)             
Samba (v6)                 ALLOW       Anywhere (v6)             
1194 (v6)                  ALLOW       Anywhere (v6)             

Anywhere on eth0           ALLOW FWD   Anywhere on wg0           
Anywhere (v6) on eth0      ALLOW FWD   Anywhere (v6) on wg0  
please advice on correct ufw rule to allow the client to also access internet. the client can still ping 8.8.8.8 - but not resolve names.

Annd
OpenVpn Newbie
Posts: 13
Joined: Tue Feb 04, 2014 7:14 am

Re: OpenVPN and ufw : unable to forward all traffic.

Post by Annd » Wed Jan 11, 2023 7:51 am

solution was :
ufw route allow in on tun0 out on eth0

krave
OpenVpn Newbie
Posts: 4
Joined: Mon Oct 31, 2022 9:54 am

Re: OpenVPN and ufw : unable to forward all traffic.

Post by krave » Thu Feb 09, 2023 7:29 pm

Many thanks!

I ended up with

```
ufw route allow in on tun0 out on enp1s0
```

Post Reply