Basic network configuration recovery tool

The goal is to make Server Manager reachable again without knowing the right commands. A possible solution:

  • Say in /etc/motd that network-recovery is the command for you if you’re in trouble with the network connection
  • Implement the network-recovery command that asks for a temporary IP, netmask, gateway, dns
    • It clears up firewall and IP configuration on all ethernet cards
    • It creates a bridge brdef with all ethernet cards
    • It applies the temporary IP configuration.
    • By default it runs signal-event interface-update && signal-event firewall-adjust on exit. We could allow to quit the tool by keeping the temporary configuration

What do you think?

6 Likes

:slight_smile: Something like that would have saved me a lot of time today. Could be very useful indeed.

1 Like

I admit I’d love it today when I installed NS7.7 ARM on Raspberry pi3

I could really use a tool like this. great idea

What kind of trouble we could run into if implemented? What scenario’s can we think of to abuse this feature?

It can be abused by applying the temporary configuration even if not needed: a working network configuration could be wiped out.

We could ensure the tool is executed from a physical console (not SSH) to avoid lockouts.


Another problem could be if the “temporary config” is never fixed. At next reboot the issue is there again: server is unreachable.

What do you think to always run signal-event interface-update when the tool quits? This ensures the running configuration is consistent with Server Manager.

Another solution can be: the tool cannot quit until Server Manager applies a working configuration.

Added issue here

The network-recovery command was released last friday and is available as a normal update of nethserver-cockpit and nethserver-firewall-base.

If you want to wipe out your running IP configuration and assign a temporary IP address on every network card, run

  # network-recovery

:dizzy: If you log in on a tty* console, you have an hint to type the magic command.

Then follow the procedure (a netmask can be set in CIDR notation, e.g. 192.168.122.7/24)

If there’s a typo:

After quitting, command logs are echoed and stored under /var/log/network-recovery.log until the next run.

Once you get the IP connection back, fix the issue with the Network page:

The temporary IP configuration is wiped out at the first interface-update event, when Network settings are saved for the first time.

…Repeat the procedure as needed.

:warning: the procedure does not set DNS and IP routing. It is designed for direct-link access only.

6 Likes

yes NFR now

  • I want to ping inside the console
  • I want to reconfigure the server (the hidden action)
  • I want to list all custom-templates
  • I want to be able to download the db database, eventually a tar of all /var/lib/nethserver

I need a drink and I come with more ideas

They all seem out of scope here :innocent:

1 Like