You can find instructions on how to change Ubuntu's default gateway in a tutorial published by Linux Hint.
How to Set the Default Gateway on Ubuntu
Practical tutorial on adding a new gateway using the IP command and how to save the changes permanently to the configuration file along with practical examples.