I want to route all traffic on my OpenWRT router via my Raspberry Pi that has a OpenVPN client connection.
I have a simple setup:
+-------------------+ +---------------+
| | Connected | |
| ISP MODEM +------------+OpenWRT Router |
| 192.168.1.1 | to lan port| 192.168.1.2 |
+-------------------+ +--+-----------++
| |
| |
| |
+------+-------+ | +-------------------+
| Raspberry Pi | | | All other devices |
| with OpenVPN | +--+ connected via WiFi|
| 192.168.1.3 | | 192.168.1.* |
+--------------+ +-------------------+
I literally followed this guide to setup a bridged AP on OpenWRT and this tutorial to setup OpenVPN on my Raspberry Pi. I believe that the settings on the Raspberry Pi are correct.
I tried to change the default gateway as following on my OpenWRT router:
root@OpenWrt:~# ip route del default
root@OpenWrt:~# ip route add default via 192.168.1.3
root@OpenWrt:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.1.3 0.0.0.0 UG 0 0 0 br-lan
192.168.1.0 * 255.255.255.0 U 0 0 0 br-lan
On my router I see that this worked because it now has an IP of the VPN provider
root@OpenWrt:~# wget -qO- http://canihazip.com/s
46.166.186.213
However on all my devices that are connected to the OpenWRT router's WiFi or cable, I still get my old ISP's IP.
I realize that there are many similar questions here, however non off the solutions worked for me. I know little about networks and start to think that what I want is not possible with a bridged AP.