I am routing virtual machine's IP through the host (I have my reasons).
ip a a 172.16.0.50/32 dev ens3 (VM's main IP)
I add routes for routing packets to the host's main IP (which acts as a router):
ip route add 192.168.50.10/32 dev ens3 (Specifying that host IP is reachable from interface) ip route add default via 192.168.50.10 dev ens3 (Specifying that host IP is the gateway)
Now everything works correctly like this, however, after reboot I have to add these routes to "rc.local" for them to be run. Is it possible to set up routes on netplan without specifying the gateway address on "via" option since I use the interface as a gateway? If I restart the network service I have to re-run "rc.local".
I am talking about this command, in particular, being in netplan:
ip route add 192.168.50.10/32 dev ens3