Maybe this question has been answered somewhere before but I can’t seems to figure it out as yet. Lately I’m having some issues with my Ubuntu 20.04 server. I installed OpenVPN and I can successfully create a vpn tunnel with NordVPN. Problem is that when the tunnel is created the connection breaks down and I cannot ssh back into the server unless I add some ip routes. I found a solution for this: Assuming the server real ip is 185.230.125.107, I manually added the routes as follows:
sudo ip rule add from 185.230.125.107 table 128
sudo ip route add table 128 185.230.125.107/32 dev eno0
sudo ip route add table 128 default via 185.230.125.254
This works fine until reboot. After the machine restarts, I have to add those rules back in again. My question is this: How would I add these rules, making them persistent so at reboot they stay in place!? Where and how should I add them!? I read somewhere that I need to create some sort of a script in /etc/network/if-up.d but I have no idea how to make such a script. Please, is somebody willing to help!? I’d really appreciate that guys. Many thanks Nick