0

I'm trying to create an access point with my raspberry pi 3B that route all my traffic to an OpenVPN service. I have created a br0 interface, that is a bridge of eth0 + wlan0. The wlan0 interface is the one I use to connect my devices to the access point, while eth0 is the one connected to my modem/router. The raspberry is well connected to the OpenVPN server, and all of my traffic from the raspberry is routed to it. The only problem is when I connect a device to the access point. I tryed to redirect my traffic with some iptables rules I found on Internet, the most quoted was this:

sudo iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE

Or following some other question like that:question But it doesn't work. The br0 interface use the subnet 192.168.1.0/24, while the tun0 interface use 10.8.0.0/16 as the subnet The operative system I'm running is Raspbian GNU/Linux 11 (bullseye).

I do apologise if my English doesn't sound so good but I'm not a native speaker and I'm still learning. Furthermore, I'm sorry if I haven't provided all the necessary information to solve this issue. Otherwise, please write me what you need to know and I will reply with all the material you asked. Thank you!

2
  • do the openvpn server knows about the 192.168.1.0/24 lan ? if it doesn't knows it may explain why this doesn't works.
    – dominix
    Jan 6, 2022 at 7:19
  • you seems to mix different concept. Bridging or nating has nothing to do with routing. A route is a route, most of the time it is not necessary to NAT (or MASQUERADE), when everything works you may not need to use IPTABLES. If you understand that you will find the solution.
    – dominix
    Jan 6, 2022 at 7:24

0

You must log in to answer this question.