0

So, my situation is as follows; Due to CoViD restrictions I can't physically access a remote (debian 11) production server, but I'm forced to add/activate two physical network ports (NICs) on that server and bridge them with the ones I'm using to connect with this server. The only way for me to access the server is through ssh (key only access), and all works fine with that. (It is a redundant connection though (two separate NICs), so that's good.)

Now I intend to try out changes in the /etc/network/interfaces file and do systemctl restart networking in order to activate the 2 extra NICs and have them bridged. My experience with this method, however, is that it may very well lock me out of that server and that it will have no network connectivity whatsoever after the change.

I assume people have done this trick before; Something polls/pings connectivity, and if it doesn't get a response (if ping fails), the currently functional /etc/network/interfaces file is restored and a reboot or network restart then brings the server back online.

I can create something off the cuff using cron too that doesn't even have to ping, but just restores the file no matter what, but I'm asking here to find the most fail-safe option to accomplish this that currently exists out there, one that I can install remotely without having to take anything down on that server for long periods of time, since I can't test it or do try-outs with it. (Normally beforehand I would, but I don't have a comparable machine with 4 NICs that I could test this with..) If I do mess this up and this server loses connectivity, an entire rack could suffer long downtimes, since nobody enters this server-room for weeks with the current issues regarding SARS-CoV2.

Thanks for any advice/ideas in advance!

Julius
  • 101
  • 4
  • Does the server not have any form of remote console access? – u1686_grawity Nov 25 '21 at 16:06
  • Just the ssh, and its firewalled quite heavily, since it's in a datacenter. CSF and fail2ban run on it too. It does DNS, among other crucial things. Anyway, I think I found something I can use; https://github.com/waltinator/net-o-matic but since debian has a tendency to change networking quite substantially, it's even risky to use such a script. I guess the crontab option is still the best option. Just something that force overwrites the file and reboots the server every 15 minutes or something. At least that way I can still get in reasonably fast, and file operations should be failsafe, no? – Julius Nov 25 '21 at 16:15
  • An idea. Schedule a reboot in few minutes and bind mount the new file over the old. If the new config doesn't work then the server will reboot with the old one, because the mount is not permanent. If the config works, unschedule, unmount, overwrite the old file. – Kamil Maciorowski Nov 25 '21 at 16:20
  • Ah yes, that's a good one too! Bind mounting I have some experience with. – Julius Nov 25 '21 at 16:24

0 Answers0