- Hold
SHIFT
at boot to enter recovery mode - Select Ubuntu -> Recovery Mode
- Root
mount -o rw,remount /
- Now edit
etc/network/interfaces
with correct gateway
(Note also, consider adding DHCP to /etc/network/interfaces) to test and then reset /etc/network/interfaces
iface ens160 inet dhcp
Be sure that if the gateway changes, that the static IP follows the same format (a la 192.168 as gateway means static IP needs to start with 192.168)