On my OpenWRT router I do use passwall and a couple of internet censorship circumventing proxies.
In order to maximise the security of my home internet I am using a *reputable commercial *
VPN product.
That said since the government censorship is very sophisticated it can block plain OpenVPN traffic using DPI methods.
Therefore, I have no choice than using http-proxy with my OpenVPN client in order to Obfuscate the OpenVPN client tcp traffic.
In addition I need to redirect the free/uncensored internet from the OpenVPN commercial provider to my connected home devices.
That said I am unable to achieve my goal because of once the OpenVPN client connects to the server the server side pushes the routes and gateway configuration back to the router and since both of the ProxyServer process and the OpenVPN client process are running on a same OpenWRT device the new pushed routes mess up with the ProxyServer process and as a result later it will mess up with the OpenVPN client as well.
So the OpenVPN client gets disconnected and tries to reconnect again and it fails since the pushed routes destroy the proxy server running on the router.
For more information very similar to my situation you could consult following link,
[https://forum.archive.openwrt.org/viewtopic.php?id=50875](link to an almost similar issue)
That said I would like to modify the pushed routes to not to destroy the proxy server,
please note that on the OpenVPN server side I do not have any control, since it is provided by a commercial company.
In fact would like to acheive following,
The proxy server running on my openWRT router should not get disturbed by route changes forcibly applied and pushed once the OpenVPN client gets connected!
Therefore I am wondering if I can ISOLATE the CPU/OS environment/or 127.0.0.1 on the OpenWRT in order to not get affected by the redirected OpenVPN internet!?
In addition I have tried route-nopull command in the client_config.ovpn file, in fact it did not disturbed the OpenWRT core default internet source, but I do not have any clue on how to manually add routes and redirect the created tun0 OpenVPN client traffic to only my home devices connected to the br-lan without messing with other processes running on the OpenWRT.
What would be the route commands/ip tables command required to get executed after tun0 interface is up?
The netstat of the router before connecting to the OpenVPN device is as follows,
#netstat -rn
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.8.1 0.0.0.0 UG 0 0 0 phy1-sta0
192.168.8.0 0.0.0.0 255.255.255.0 U 0 0 0 phy1-sta0
192.168.55.0 0.0.0.0 255.255.255.0 U 0 0 0 br-lan
Note: The router wan interface is phy1-sta0 with GW 192.168.8.1
and the connected devices are behind NAT on br-lan while they are using their ip addressed from the dhcp pool in range 192.168.55.64/26 except the router which has ip address 192.168.55.1
#ip route show
default via 192.168.8.1 dev phy1-sta0 proto static src 192.168.8.118
192.168.8.0/24 dev phy1-sta0 proto kernel scope link src 192.168.8.118
192.168.55.0/24 dev br-lan proto kernel scope link src 192.168.55.1
and after connecting the OpenVPN client by using route-nopull command in the config tun0 is added as follows,
#netstat -rn
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.8.1 0.0.0.0 UG 0 0 0 phy1-sta0
10.124.148.0 0.0.0.0 255.255.254.0 U 0 0 0 tun0
192.168.8.0 0.0.0.0 255.255.255.0 U 0 0 0 phy1-sta0
192.168.55.0 0.0.0.0 255.255.255.0 U 0 0 0 br-lan
#ip route show
default via 192.168.8.1 dev phy1-sta0 proto static src 192.168.8.118
10.124.148.0/23 dev tun0 proto kernel scope link src 10.124.148.118
192.168.8.0/24 dev phy1-sta0 proto kernel scope link src 192.168.8.118
192.168.55.0/24 dev br-lan proto kernel scope link src 192.168.55.1
I am wondering how should a correct route table look like?
What modification/configurations I shoudl apply and run after tun0 is up?
And as a side question the processes running on the OpenWRT what would be the default interface that they use to connect to the internet? is it eth0, lan0, ....!?
For example the command traceroute ran on the OpenWRT cli utilises which device or interface by default!?
This issue has made me really frustrated , I need a clean and unrestricted internet urgently for my connected devices.
Any advice or solution is really appreciated.