Spud
Regular Contributor
Thanks for the link. Now I see why I was confused. I didn't realize table 254 was the main table. Usually when referencing tables, at least those well-known, you use the name, if only for reasons of clarity.
Code:ip rule add fwmark 0x7000/0x7000 table main prio 9990
Anyway, I have a problem w/ something the author of that script has failed to make crystal clear, and it's subtle enough that many users could easily miss it.
Clearly that script is a user defined implementation of PBR (policy based routing). However, as constructed, it *assumes*, in fact *requires*, that Routing Policy be enabled in the OpenVPN client. And that's because when Routing Policy is NOT enabled, the main routing table has its default gateway changed to the VPN by the OpenVPN server (at least for commercial OpenVPN providers). And under such circumstances, pointing your own PBR script back to the main routing table is pointless. But once you enable Routing Policy in the OpenVPN client, that keeps the main routing table pointing to the WAN as its default gateway, and so the script should now work (it may have other issues, but at least as far as this particular issue is concerned).
It would be far better to create your own separate routing table (e.g., 200) and configure it w/ the WAN as its default gateway. That way you're not dependent on how Routing Policy is or isn't configured in the OpenVPN client.
Obviously I don't know if this particular issue accounts for your present problems, but as currently written, the script leaves something to be desired.
Unfortunately the script still won’t work, despite throwing no errors on launch. I’m at the very beginning of getting to know tables and scripts, so that sounds like a project.