37
Backing up Network Devices Julien Goodwin @laptop006 [email protected] Tuesday, 25 January 2011

Backing up Network Devices - Miniconf

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Backing up Network Devices - Miniconf

Backing upNetwork Devices

Julien Goodwin@laptop006

[email protected]

Tuesday, 25 January 2011

Page 2: Backing up Network Devices - Miniconf

Tuesday, 25 January 2011

Page 3: Backing up Network Devices - Miniconf

How many of you have?

• Switches / Routers / Firewalls / etc.

• A backup copy of the OS image?

• A copy of the config when deployed?

• A copy of the current config?

• A copy of the actual current config?

• Notifications whenever config changes?

• Automated documentation & verification of config & deployment?

Tuesday, 25 January 2011

Page 4: Backing up Network Devices - Miniconf

Step 1: The OS

• Create a file repository, archive all current versions of relevant OS’

• As preparation for an upgrade ensure both new and current version are in archive

• If a failure might cut you off from archive copy to a USB drive or similar

Tuesday, 25 January 2011

Page 5: Backing up Network Devices - Miniconf

Step 2: The Config

Tuesday, 25 January 2011

Page 6: Backing up Network Devices - Miniconf

Manual – Random

• “Every now and again” copy config to files / wiki

• Means you will miss changes

Tuesday, 25 January 2011

Page 7: Backing up Network Devices - Miniconf

Manual – Change

• Store archive of config on every change

• What happens when someone does an un-managed change?

Tuesday, 25 January 2011

Page 8: Backing up Network Devices - Miniconf

Automatic – Push

• On config change send config to repo

• Silent failures

• If offline

• If admin turns off

• Limited Support

• Juniper JunOS

• Cisco IOS 12.4+

• Often no / limited version controlTuesday, 25 January 2011

Page 9: Backing up Network Devices - Miniconf

Automatic – Pull

• Central service pulls config on schedule

• Can notify on failures

• Including cases of admin manipulation

Tuesday, 25 January 2011

Page 10: Backing up Network Devices - Miniconf

RancidReally Awesome New Cisco confIg Differ

Tuesday, 25 January 2011

Page 11: Backing up Network Devices - Miniconf

What?

“RANCID monitors a device's configuration, including software and hardware (cards, serial numbers, etc) and uses CVS or Subversion to maintain history of changes.”

http://www.shrubbery.net/rancid/

Tuesday, 25 January 2011

Page 12: Backing up Network Devices - Miniconf

What Devices?

• Cisco IOS / IOS-XR / IOS-XE

• Juniper JunOS

• Juniper ScreenOS

• Foundry IronWare & derivatives

• Extreme ExtremeWare (not XOS)

• Quagga

• and more...Tuesday, 25 January 2011

Page 13: Backing up Network Devices - Miniconf

How?

• Launched via cron job

• Uses telnet / SSH to connect to devices

• Runs set commands, stores output in files

• Commits to a VCS (CVS / SVN)

• E-mails diffs to a set alias

Tuesday, 25 January 2011

Page 14: Backing up Network Devices - Miniconf

Logins

• Password only

• For Cisco IOS handles enable password

• Use login classes to prevent any abuse

Tuesday, 25 January 2011

Page 15: Backing up Network Devices - Miniconf

Benefits

Tuesday, 25 January 2011

Page 16: Backing up Network Devices - Miniconf

The basics

• Configuration history

• Hardware inventories

• Filesystem details

Tuesday, 25 January 2011

Page 17: Backing up Network Devices - Miniconf

Version Inventory Make OS Model Version

=======-===========-================-============

Juniper JunOS J6350 10.0R2.10 border1.richmond.vic.au.editure.net

Juniper JunOS J4350 10.0R2.10 border2.nm.vic.au.editure.net

Cisco IOS AIR-AP1231G-A 12.3(8)JEC2 ap1.internal.schools.net.au

Cisco IOS AIR-AP1232AG-N 12.3(8)JEC2 ap2.internal.schools.net.au

Juniper JunOS SRX650 10.2R3.10 nm-fw-01.nm.vic.au.editure.net

Cisco IOS WS-C2950G-48 12.1(22)EA13 nm-sw-01.internal.schools.net.au

Cisco IOS WS-C2950G-48 12.1(22)EA13 nm-sw-02.internal.schools.net.au

Extreme ExtremeWare Summit48si 7.6.4.4 nm-sw-03.internal.schools.net.au

Extreme ExtremeWare Summit48si 7.6.4.4 nm-sw-04.internal.schools.net.au

Juniper JunOS EX4200-48T 9.5R3.7 nm-sw-stack-01.nm.vic.au.editure.net

Cisco IOS WS-C2960G-48TC-L 12.2(50)SE switch.s9.myschools.net

Foundry IronWare ServerIronGT 10.2.00dTD2 lb1.vicdir.schools.net.au

Foundry IronWare ServerIronGT 10.2.01cTD2 lb2.vicdir.schools.net.au

Juniper JunOS SRX240H 10.2R3.10 pm-fw-01.pm.vic.au.editure.net

Extreme XOS X450a-48t 12.0.1.11 sw-ext1.vicdir.schools.net.au

Extreme XOS X450a-48t 12.0.1.11 sw-int1.vicdir.schools.net.au

Tuesday, 25 January 2011

Page 18: Backing up Network Devices - Miniconf

Basic ConfigurationHostname DNS NTP SNMP

========------------------------------===----===----====

border2.nm.vic.au.editure.net yes yes yes

border1.richmond.vic.au.editure.net yes yes yes

switch.s9.myschools.net yes yes yes

nm-sw-03.internal.schools.net.au yes yes yes

nm-sw-01.internal.schools.net.au yes yes yes

nm-sw-stack-01.nm.vic.au.editure.net yes yes yes

ap1.internal.schools.net.au yes yes yes

nm-fw-01.nm.vic.au.editure.net yes yes yes

ap2.internal.schools.net.au yes yes yes

nm-sw-04.internal.schools.net.au yes yes yes

nm-sw-02.internal.schools.net.au yes yes yes

lb1.vicdir.schools.net.au yes yes yes

lb2.vicdir.schools.net.au yes yes yes

Tuesday, 25 January 2011

Page 19: Backing up Network Devices - Miniconf

Verify Reverse DNS

• Extract all interface addresses

• Look them up

• Display them

Tuesday, 25 January 2011

Page 20: Backing up Network Devices - Miniconf

Verify HA Configurations

• Compare two devices config

• (Ab)use SED/AWK/Perl to remove expected differences

• Diff the result

Tuesday, 25 January 2011

Page 21: Backing up Network Devices - Miniconf

AutomatedNetwork Diagram

• Iterate through configs, extract addresses:

• Interface

• Loopback

• Virtual

• NAT pools

• Map with graphviz or similar

Tuesday, 25 January 2011

Page 22: Backing up Network Devices - Miniconf

Tuesday, 25 January 2011

Page 23: Backing up Network Devices - Miniconf

Linking other tools

• Add to Nagios for health monitoring

• Add to MRTG/Cacti/Munin/etc. for interface & environmental monitoring

• Auto-generate DNS zones

Tuesday, 25 January 2011

Page 24: Backing up Network Devices - Miniconf

Pushing

• Rancid can also be used as a basis for pushing configs

• Makes reverting easier

• Or pushing new configs from a template system

Tuesday, 25 January 2011

Page 25: Backing up Network Devices - Miniconf

Auto-DiscoveryAn Aside...

Tuesday, 25 January 2011

Page 26: Backing up Network Devices - Miniconf

Auto Discovery

• Automatic finding of new devices

• Add them to existing management tools

• But should you?

Tuesday, 25 January 2011

Page 27: Backing up Network Devices - Miniconf

Next StepsConfig Generation

Tuesday, 25 January 2011

Page 28: Backing up Network Devices - Miniconf

Templates

• Common standard bits of config

• For Example:

• Login config

• Routing protocols

• SNMP

Tuesday, 25 January 2011

Page 29: Backing up Network Devices - Miniconf

Netomata ConfigGenerator

Tuesday, 25 January 2011

Page 30: Backing up Network Devices - Miniconf

What?

• Template based config generator

• Similar to many HTML template languages

• Uses ERB

• Great for puppet users

Tuesday, 25 January 2011

Page 31: Backing up Network Devices - Miniconf

Inputs

• Templates

• Device Information Database

Tuesday, 25 January 2011

Page 32: Backing up Network Devices - Miniconf

What can you manage?

• Hosts

• /etc/network/interfaces (etc.)

• Devices

• Cisco config, policies, VLAN databases

• DNS Zones

Tuesday, 25 January 2011

Page 33: Backing up Network Devices - Miniconf

Developing Templates1. Choose a token device

2. Create a template to match config

• For IOS type remember “no XXX” commands

3. Choose a similar devices

4. Manipulate template until all devices work

5. Move to a new type of device

6. Goto 1

Tuesday, 25 January 2011

Page 34: Backing up Network Devices - Miniconf

Notch

Tuesday, 25 January 2011

Page 35: Backing up Network Devices - Miniconf

What?

• CLI Abstraction Layer

• Written in Python

• Primarily out of Google Sydney

Tuesday, 25 January 2011

Page 36: Backing up Network Devices - Miniconf

Tools

• PUNC - Rancid replacement

• Mr. CLI - clusterssh for routers

Tuesday, 25 January 2011

Page 37: Backing up Network Devices - Miniconf

References

• Nanog talks

• Rancid – NANOG26 http://bit.ly/hDSEaL

• Netomata – NANOG49 http://bit.ly/f3Vpwe

• Notch – http://code.google.com/p/punc/

Tuesday, 25 January 2011