Network automation lab 3 of 27
Git for network configurations: branch, merge, squash, cherry-pick and revert
Run a real team workflow on a repository of router configurations: clone, branch and commit a change, merge with a conflict, squash a branch, cherry-pick one fix, revert a bad commit, survive a rejected push, tag a baseline and deploy it to two routers.
Run this lab
It needs Lite: its 3 nodes are set to 3 vCPU and 2,048 MB in total. That fits the free demo too.
In your workspace: Shared, then Network Automation - CCNA and CCNP Automation guided labs, then 03 - Git for network configurations - branch merge squash cherry-pick and revert
- Level
- Beginner
- Time
- About 75 minutes
- Nodes need
- 3 vCPU, 2,048 MB
- Smallest plan
- Lite
The scenario
Kestrel Freight keeps the intended configuration of each branch router in a Git repository, netconfigs: one file per router in configs/. Nobody edits a router by hand any more: changes go on a branch, get reviewed and merged to main, and only main is deployed. Today four things land at once: your NTP change, legal's new banner wording, a squashed syslog change, and one fix from a hotfix branch that also contains work in progress. A colleague also committed an SNMP community that must not reach production. Your job is to end the day with a clean main, tagged v1.0, pushed and deployed to r1 and r2.
| Item | Value |
|---|---|
| Team remote repository | /srv/git/netconfigs.git (a bare repository on the workstation, standing in for GitLab or GitHub) |
| Branches on the remote | main, feature/banner (Tom), feature/syslog (Priya), hotfix/acl (Sam) |
| Routers | r1 10.10.20.11, r2 10.10.20.12 (IOS 15.9), login netops / NetOps-Lab1 |
| Deploy tool | ~/lab/tools/deploy.py r1 r2 (run from your clone) |
| Colleague simulator | ~/lab/tools/colleague-push.sh |
What you’ll practise
- Clone a repository and read its history, branches and remote
- Add, remove and commit changes, and read a unified diff
- Merge branches, resolve a merge conflict and squash a branch into one commit
- Use cherry-pick, revert, reset and checkout, and know which are safe on shared history
- Push and pull with a remote, recover from a rejected push, tag a release and deploy it
The tasks
- Set up Git and clone the repository
- Make a change on a branch: add, remove, diff, commit
- Merge your branch, then merge a branch that conflicts
- Squash a branch into one commit
- Cherry-pick one commit, revert another
- Reset and checkout: rewriting your own unshared work
- Push, get rejected, pull, push again; tag the baseline
- Deploy main to the routers
The Lab Tasks pane has the scenario, these tasks, the checks to run, hints and the full solution.
Topology and devices
The network as it opens in EVE-NG, drawn from the lab’s own canvas, and the image each node runs.
Every link, as text
- devbox
eth0to Mgmt (network) - r1
Gi0/0to Mgmt (network) - r2
Gi0/0to Mgmt (network)
| Node | Device | Image in Add Node | Set to |
|---|---|---|---|
| devbox | EVE-NG GUI server (Docker) | eve-gui-server:latest | 1 vCPU, 1,024 MB |
| r1 | Cisco IOSv | vios-adventerprisek9-m.spa.159-3.m9 | 1 vCPU, 512 MB |
| r2 | Cisco IOSv | vios-adventerprisek9-m.spa.159-3.m9 | 1 vCPU, 512 MB |
How to open this lab
Sign in to your workspace at
lab.cloudlabbox.com.In File Manager, open Shared, then the folder
Network Automation - CCNA and CCNP Automation guided labs.Open
03 - Git for network configurations - branch merge squash cherry-pick and revertand start its nodes, then open Lab Tasks for the scenario and the steps.
The lab is read-only. You can start the nodes and configure the devices, but changes to the topology can’t be saved. To change it, rebuild it in your own folder.
More Network automation labs
CloudLabBox is independent of Cisco. The lab follows exam topics and isn’t vendor training material; vendor names identify the exams and the images in the workspace.