Files
router-backup/README.md
Pim van Pelt 96c7c3aeaa Update README
2025-07-06 18:23:45 +02:00

108 lines
2.7 KiB
Markdown

# IPng Networks Router Backup
SSH-based network device configuration backup tool with support for multiple device types and flexible authentication methods.
## Features
- **Multi-device backup**: Configure multiple devices across multiple YAML files with automatic merging
- **Device type templates**: Reusable command sets per device type, overridable per individual device
- **Flexible authentication**: SSH agent, key files, or password with SSH config support
- **SSH config integration**: Automatically uses `~/.ssh/config` settings for legacy device compatibility
- **Modular configuration**: Load and merge multiple YAML files for organized configuration management
## Quick Start
### Installation
```bash
# Install Debian package
sudo dpkg -i ipng-router-backup_X.Y.Z_amd64.deb
# Or build from source
make build
```
### Basic Usage
1. **Create configuration files**:
**Device types** (`00-device-types.yaml`):
```yaml
types:
srlinux:
commands:
- show version
- show platform linecard
- info flat from running
centec:
commands:
- show version
- show transciever
- show running-config
```
**Device config** (`config.yaml`):
```yaml
devices:
asw100:
user: netops
type: srlinux
switch01:
user: admin
type: centec
```
2. **Run backup**:
```bash
# Backup all devices (multiple YAML files are automatically merged)
ipng-router-backup --yaml 00-device-types.yaml --yaml config.yaml --output-dir /backup
# Backup specific devices
ipng-router-backup --yaml 00-device-types.yaml --yaml config.yaml --output-dir /backup \
--host asw100
```
3. **Check output**:
```bash
ls /backup/
# asw100 asw120
cat /backup/asw100
# ## COMMAND: show version
# Hostname : asw100
# Software Version : v25.3.2
# ...
```
## Authentication
The tool automatically tries authentication methods in this order:
1. **SSH Agent** (if `SSH_AUTH_SOCK` is set)
2. **SSH Key File** (`--key-file` or from `~/.ssh/config`)
3. **Password** (`--password` flag)
## SSH Configuration
The tool integrates with `~/.ssh/config` for seamless connection to legacy devices:
```bash
# ~/.ssh/config
Host old-router*
User admin
Port 2222
KexAlgorithms +diffie-hellman-group1-sha1
Ciphers aes128-cbc,aes192-cbc,aes256-cbc
HostKeyAlgorithms +ssh-rsa
```
This allows connecting to older routers that require legacy SSH algorithms while maintaining security for modern devices.
## Documentation
- **[Detailed Documentation](docs/DETAILS.md)** - Complete feature guide, configuration reference, and examples
- **[Manual Page](docs/router_backup.1)** - Unix manual page
- **[Changelog](debian/changelog)** - Version history and changes