Resetting and recording experiments
On this page
You changed three things, something broke, and you cannot remember the first two. A working network alone will not explain what happened. Make one change and write down what happened. Put the lab back in the same starting state before trying another idea.
By the end, you can reset the lab without reinstalling Ubuntu. Your notes will tell another learner how to repeat your steps.
Remove one setting on purpose
Section titled “Remove one setting on purpose”Start with the lab up and all machines marked same by netlab status. Use the VM terminal, as in Reading a machine’s network settings.
The replay enters phone and removes its IPv4 address. It then returns to the VM to check and reset the lab. Follow the prompt at each step. After entering, check that it names phone before running sudo. The recording asks for your password again inside the machine.
The del command removes the specified address from eth0. It finishes without a success message in the recorded run. exit returns to the VM.
Predict: will status show only the address missing, or could another setting disappear with it?
learner@rootvolt:~$ netlab shell phone[sudo] password for learner: learner@phone:~$ sudo ip address del 10.77.10.11/24 dev eth0[sudo] password for learner: learner@phone:~$ exitlogoutlearner@rootvolt:~$ netlab statusLab is up. Modes on: none. Fault: none.
MACHINE NETWORK ADDRESS DEFAULT ROUTE COMPARED WITH THE START
laptop home 10.77.10.10/24 10.77.10.1 same
phone home none - changed
router home, site 10.77.10.1/24 10.77.20.1/24 - same
web site 10.77.20.80/24 10.77.20.1 same
Changed since the start:
phone: eth0 address none (start: 10.77.10.11/24)
phone: default route none (start: 10.77.10.1)
Switch sw-home (home): laptop, phone, router
Switch sw-site (site): router, web
Services: web http 80, web https 443, web http 8080, web ssh 22learner@rootvolt:~$ netlab resetLab is back in its starting state.learner@rootvolt:~$ netlab statusLab is up. Modes on: none. Fault: none.
MACHINE NETWORK ADDRESS DEFAULT ROUTE COMPARED WITH THE START
laptop home 10.77.10.10/24 10.77.10.1 same
phone home 10.77.10.11/24 10.77.10.1 same
router home, site 10.77.10.1/24 10.77.20.1/24 - same
web site 10.77.20.80/24 10.77.20.1 same
Switch sw-home (home): laptop, phone, router
Switch sw-site (site): router, web
Services: web http 80, web https 443, web http 8080, web ssh 22learner@rootvolt:~$ Steps (22)
- Type
netlab shell phone - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Type
sudo ip address del 10.77.10.11/24 dev eth0 - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Type
exit - Press Enter
- Output:
logout - Type
netlab status - Press Enter
- Output:
Lab is up. Modes on: none. Fault: none. MACHINE NETWORK ADDRESS DEFAULT ROUTE COMPARED WITH THE START laptop home 10.77.10.10/24 10.77.10.1 same phone home none - changed router home, site 10.77.10.1/24 10.77.20.1/24 - same web site 10.77.20.80/24 10.77.20.1 same Changed since the start: phone: eth0 address none (start: 10.77.10.11/24) phone: default route none (start: 10.77.10.1) Switch sw-home (home): laptop, phone, router Switch sw-site (site): router, web Services: web http 80, web https 443, web http 8080, web ssh 22 - Type
netlab reset - Press Enter
- Output:
Lab is back in its starting state. - Type
netlab status - Press Enter
- Output:
Lab is up. Modes on: none. Fault: none. MACHINE NETWORK ADDRESS DEFAULT ROUTE COMPARED WITH THE START laptop home 10.77.10.10/24 10.77.10.1 same phone home 10.77.10.11/24 10.77.10.1 same router home, site 10.77.10.1/24 10.77.20.1/24 - same web site 10.77.20.80/24 10.77.20.1 same Switch sw-home (home): laptop, phone, router Switch sw-site (site): router, web Services: web http 80, web https 443, web http 8080, web ssh 22
Check your answer
Both the address and default route are missing. One command can change more than one setting. Write down what changed, even if the command’s name led you to expect something else.
Status still says Fault: none in this run. That field names faults applied by the tool. It can say none even when you changed a setting by hand. Read the comparison and the list of changes too.
Restore and check
Section titled “Restore and check”Compare the replay’s final netlab status with the changed one. phone has its address and default route back, and every machine reads same. Read that final status to check the result. Do not stop at the reset’s success message.
Reset rebuilds the lab with the modes that are turned on. It removes settings you changed by hand and faults applied by the tool. It also stops programs still running inside the lab machines. Leave those shells before resetting so you are working from the VM.
Choose a lab reset or a VM snapshot
Section titled “Choose a lab reset or a VM snapshot”A lab reset and a VM snapshot undo different changes. netlab reset puts the lab network back in its starting state. It does not undo edits to your notes or remove packages you installed in Ubuntu.
A VirtualBox snapshot takes the VM back to how it was when you saved it, including its files. Use it to undo a change to Ubuntu itself. You can lose work saved after that snapshot. Copy anything you need to keep outside the VM first.
For the removed address, use a lab reset. You do not need to take the whole VM back to a snapshot. Start each experiment with the same lab settings. Then you can compare the changes without wondering what was left from the last experiment.
Keep an experiment file
Section titled “Keep an experiment file”Open Ubuntu’s text editor and save a notes file for this experiment in your home folder. You do not need a terminal command to write the file. Keep the following fields together:
| Field | What to record |
|---|---|
| Date and starting state | Your actual date, modes, and status before changing anything |
| Machine | The name shown in the prompt where each command runs |
| Prediction | What you think will happen before making the change |
| Command | The exact command, including spaces and options |
| Output | The actual answer, or that the command printed nothing |
| Changes and reset | What changed, the reset command, and status afterward |
Write your prediction before running the command. Then save the output, even if it differs from your guess. That difference helps explain what happened. Do not save your password. Write that the command asked for it instead.
Mistakes to recognize
Section titled “Mistakes to recognize”“Resetting is cheating.” Resetting gives you the same starting state again. Your notes show what changed, even after the reset removes those changes.
“I will remember what I changed.” You may forget the exact command or its answer. Save both, along with the machine’s name, so you can repeat the change.
Try it yourself
Section titled “Try it yourself”Predict what status will report if you change laptop’s default route but leave its address alone. Record that expectation first.
Enter laptop with netlab shell laptop. Change its next machine with sudo ip route replace default via 10.77.10.254, then exit and read netlab status from the VM.
replace default via sets the default route’s next machine to the supplied address. You are changing this setting on purpose inside the lab. The reset will undo it. Save the command and output in your notes. Reset from the VM and compare status again.
Solution
learner@rootvolt:~$ netlab shell laptop[sudo] password for learner: learner@laptop:~$ sudo ip route replace default via 10.77.10.254[sudo] password for learner: learner@laptop:~$ exitlogoutlearner@rootvolt:~$ netlab statusLab is up. Modes on: none. Fault: none.
MACHINE NETWORK ADDRESS DEFAULT ROUTE COMPARED WITH THE START
laptop home 10.77.10.10/24 10.77.10.254 changed
phone home 10.77.10.11/24 10.77.10.1 same
router home, site 10.77.10.1/24 10.77.20.1/24 - same
web site 10.77.20.80/24 10.77.20.1 same
Changed since the start:
laptop: default route 10.77.10.254 (start: 10.77.10.1)
Switch sw-home (home): laptop, phone, router
Switch sw-site (site): router, web
Services: web http 80, web https 443, web http 8080, web ssh 22learner@rootvolt:~$ netlab resetLab is back in its starting state.learner@rootvolt:~$ netlab statusLab is up. Modes on: none. Fault: none.
MACHINE NETWORK ADDRESS DEFAULT ROUTE COMPARED WITH THE START
laptop home 10.77.10.10/24 10.77.10.1 same
phone home 10.77.10.11/24 10.77.10.1 same
router home, site 10.77.10.1/24 10.77.20.1/24 - same
web site 10.77.20.80/24 10.77.20.1 same
Switch sw-home (home): laptop, phone, router
Switch sw-site (site): router, web
Services: web http 80, web https 443, web http 8080, web ssh 22learner@rootvolt:~$ Steps (22)
- Type
netlab shell laptop - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Type
sudo ip route replace default via 10.77.10.254 - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Type
exit - Press Enter
- Output:
logout - Type
netlab status - Press Enter
- Output:
Lab is up. Modes on: none. Fault: none. MACHINE NETWORK ADDRESS DEFAULT ROUTE COMPARED WITH THE START laptop home 10.77.10.10/24 10.77.10.254 changed phone home 10.77.10.11/24 10.77.10.1 same router home, site 10.77.10.1/24 10.77.20.1/24 - same web site 10.77.20.80/24 10.77.20.1 same Changed since the start: laptop: default route 10.77.10.254 (start: 10.77.10.1) Switch sw-home (home): laptop, phone, router Switch sw-site (site): router, web Services: web http 80, web https 443, web http 8080, web ssh 22 - Type
netlab reset - Press Enter
- Output:
Lab is back in its starting state. - Type
netlab status - Press Enter
- Output:
Lab is up. Modes on: none. Fault: none. MACHINE NETWORK ADDRESS DEFAULT ROUTE COMPARED WITH THE START laptop home 10.77.10.10/24 10.77.10.1 same phone home 10.77.10.11/24 10.77.10.1 same router home, site 10.77.10.1/24 10.77.20.1/24 - same web site 10.77.20.80/24 10.77.20.1 same Switch sw-home (home): laptop, phone, router Switch sw-site (site): router, web Services: web http 80, web https 443, web http 8080, web ssh 22
The first status shows the changed default route. The final status shows the starting route again.
The address stays 10.77.10.10/24. After netlab reset and another netlab status, the default route is 10.77.10.1 again and the machine reads same. This command changes the route but keeps the address. Removing the address had also removed the route. Explain that difference in your notes.
- Change one setting on purpose, then read what changed.
- Reset the lab network from the VM, then check status.
- Use a snapshot to undo changes to Ubuntu itself.
- Save expectations, commands, output, and recovery together.
Next, Practice: Building Your Networking Lab combines setup, readings, and recovery.
Further reading
Section titled “Further reading”- Ubuntu: ip-address manual, for deleting an address.
- Ubuntu: ip-route manual, for replacing a route.
- Oracle VirtualBox User Guide, for snapshots and restoring saved VM state.