I just worked on a local Linux server in my office, connecting to it via SSH. I changed some network settings. Specifically, I added a simple network bridge that replaced the previous ethernet connection (eth0). In both cases, the network address is a static IPv4 address.
After I did those changes and restarted the network daemon using
systemctl restart systemd-networkd, I was locked out and could not ssh back into the machine.
Luckily, I had access to the physical console. While restarting the network did give me the new bridge with the correct address, it did not remove the address from eth0 - even though all configuration settings are correct. So, I had to manually
ip a flush eth0, and I was back up and running.
I guess if that would have been a root server in a remote location instead of a local machine, I would look very old now.
What should I have done differently, what is the right approach here?
Update: From the two provided answers so far I see that I should have been clearer. I am fully aware of all the hardware options how to retain access to my station. Because I have and use them, I feel comfortable to invoke certain changes at the risk of something bad happening. It's a bit of a hassle but I can just login through the serial console and all's well again. But I was wondering, what if I didn't have them, how would the rest of you go about changing network settings that can theoretically disconnect you?
And frankly, I also just wonder in a very concrete way why my eth0 interface kept the old IP address even though I restarted the network service with new settings? That just doesn't look like desired behaviour to me.