I have been successful in setting up two OpenVPN servers as follows:
- Ubuntu1 (LAN IP: 172.23.6.148 WAN IP: 60.242.175.132)
- Ubuntu2 (LAN IP: 172.23.6.149 WAN IP: 60.242.175.133)
Clients connecting to both servers can access my two LAN subnets (172.23.6.0/24 and 172.23.7.0/24). However, those connecting to Ubuntu2 cannot access the internet. Below are the routing tables from both servers:
KERNEL ROUTING TABLE FROM UBUNTU1 (172.23.6.148)
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 172.23.6.120 0.0.0.0 UG 0 0 0 br0
10.8.0.0 10.8.0.2 255.255.255.0 UG 0 0 0 tun0
10.8.0.2 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
10.9.0.0 0.0.0.0 255.255.255.0 U 0 0 0 tinc0
172.23.6.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
172.23.7.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
207.187.53.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
KERNEL ROUTING TABLE FROM UBUNTU2 (172.23.6.149)
root@ubuntu2:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 50.242.184.134 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.2 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
10.9.0.0 0.0.0.0 255.255.255.0 U 0 0 0 tinc0
50.242.184.128 0.0.0.0 255.255.255.248 U 0 0 0 eth0
172.23.6.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
172.23.7.0 172.23.6.1 255.255.255.0 UG 0 0 0 br0
207.187.53.0 172.23.6.1 255.255.255.0 UG 0 0 0 br0
Please note that I have full control of the gateway for Ubuntu2 but not for Ubuntu1 (3rd party managed). What do I need to do to get internet traffic for clients connecting to Ubuntu2? I'm ready and willing to provide any additional information as requested, thanks.
EDIT #1:
Below is what I've added to my firewall rules (in /etc/ufw/before.rules just before the *filter line):
# START OPENVPN RULES
# NAT table rules
*nat
:POSTROUTING ACCEPT [0:0]
# Allow traffic from OpenVPN client to br0
-A POSTROUTING -s 10.8.0.0/24 -o br0 -j MASQUERADE
COMMIT
# END OPENVPN RULES