3 of 5 loose is not lose

Change private IP address without losing internet access

I start with the following:

ens33     Link encap:Ethernet  HWaddr 00:0c:29:03:a8:56  
          inet addr:192.168.0.161  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::dfa6:820:b035:a36a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:43 errors:0 dropped:0 overruns:0 frame:0
          TX packets:78 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:4957 (4.9 KB)  TX bytes:8702 (8.7 KB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:204 errors:0 dropped:0 overruns:0 frame:0
          TX packets:204 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:15089 (15.0 KB)  TX bytes:15089 (15.0 KB)

And I want to set my address to a specific value, so that I can identify it easily from other systems when SSHing. I run:

ifconfig ens33 192.168.10.2 netmask 255.255.255.0
route add default gw 192.168.10.1

And the result is:

ens33     Link encap:Ethernet  HWaddr 00:0c:29:03:a8:56  
          inet addr:192.168.10.2  Bcast:192.168.10.255  Mask:255.255.255.0
          inet6 addr: fe80::dfa6:820:b035:a36a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:147 errors:0 dropped:0 overruns:0 frame:0
          TX packets:146 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:20559 (20.5 KB)  TX bytes:14302 (14.3 KB)

As a result, I'm losing internet connection, and the machine is also not discoverable within the network.

What am I doing wrong?