Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
Google Cloud Platform icon
Labs

Adding an IP Address and a Static Route

Managing network settings is a crucial ability for a System Administrator to have. In today's environment, adding and deleting IP addresses and static routes is an expected capability. In this activity, we will be creating one script to add an IP address and a static route, then another script to remove an IP address and a static route.

Google Cloud Platform icon
Lab platform
Lab Info
Level
Intermediate
Last updated
Sep 25, 2025
Duration
30m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Use the sudo Command to Start a Root Account Shell

    Using sudo -i, start an interactive root shell:

    sudo -i
    
  2. Challenge

    Add and Delete the IP Address 10.0.5.20/24 from the eth0 Interface, and Create net-up.sh and net-down.sh Scripts

    Using the ip a command, add and delete the address 10.0.5.20/24 from the ens5 interface. Use these commands to create the net-up.sh and net-down.sh scripts:

    ip a
    ip a add 10.0.5.20/24 dev ens5
    ip a
    echo ip a add 10.0.5.20/24 dev ens5 > net-up.sh
    chmod +x net-up.sh
    ip a del 10.0.5.20/24 dev ens5
    ip a
    echo ip a del 10.0.5.20/24 dev ens5 > net-down.sh
    chmod +x net-down.sh
    ./net-up.sh
    ip a 
    ./net-down.sh
    ip a
    
  3. Challenge

    Update net-up.sh and net-down.sh Scripts to Add and Delete Route Using 10.0.5.5 as a Router to Provide Access to the 10.0.6.0/24 Network

    Using the ip r command add a route to the 10.0.6.0 subnet using 10.0.5.5 as a router with the ens5 device. Add this command to the net-up.sh script file. Delete the new route using the ip r command, and add it to the net-down.sh script.

    ip r
    ip r add 10.0.6.0/24 via 10.0.5.5 dev ens5
    ip r
    echo ip r add 10.0.6.0/24 via 10.0.5.5 dev ens5 >> net-up.sh
    ip r del 10.0.6.0/24 via 10.0.5.5 dev ens5
    echo ip r del 10.0.6.0/24 via 10.0.5.5 dev ens5 >> net-down.sh
    ip r
    
  4. Challenge

    Verify the net-up.sh Script Adds the Correct Address and Route, and net-down.sh Script Deletes the Address and Route

    Execute the net-down.sh script. Check the current IP address information and it should not contain 10.0.5.20. If it does, try fixing net-down.sh until it does not:

    ./net-down.sh
    ip a | grep 10.0.5.20
    

    Check the routing table and it should not have the router 10.0.5.5. If it does, try fixing the net-down.sh until it does not:

    ip r | grep 10.0.5.5
    

    Execute the net-up.sh script:

    ./net-up.sh
    

    Check the current IP address information, and it and should contain 10.0.5.20. If it does not, try fixing net-up.sh until it does:

    ip a | grep 10.0.5.20
    

    Check the routing table and it should have the router 10.0.5.5. If it does not, try fixing the net-up.sh until it does:

    ip r | grep 10.0.5.5
    

    Double-check our work by repeating the previous steps in this task.

About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight