How to Change Routing Tables with a Windows Command Prompt – From the CompTIA Network + Course

Home > Blogs > CompTIA > How to Change Routing Tables with a Windows Command Prompt – From the CompTIA Network + Course

How to Change Routing Tables with a Windows Command Prompt – From the CompTIA Network + Course

2 0 Mark Jacob
Added by August 26, 2016

In this CompTIA Network + training video, instructor Mark Jacob demonstrates how to use a standard Windows Command Prompt to manipulate routing tables.


I want to show you something from what you will learn in the labs of this course such as manipulating routing tables. If you’re new to the environment you may be unaware that this can be done inside a Windows Command Prompt.

This is not directly taken from the CompTIA Network + class labs it’s a similar concept of what you will learn in the class.

Let’s get started:

To look at the routing table on a typical windows machine we’ll use “route-print


If you were to hit enter now while running either IPv4 or IPv6, it would generate a bunch of stuff and you would need to scroll back up to see what you wanted to look at.

Since we’re focusing on IPv4, I’ll add “ -4 “  to the command to limit it to show only IPv4 information.


You’ll notice here that I have a “quad zero” Route


This route points to the default gateway

If I had this box configured a s a DHCP Client and it received an IP Address from the DHCP Server, it will learn what it’s default gateway is and it’s going to configure this “quad-zero” route

What we want to do now is manipulate it. We’ll first find a target.

We’ll perform an ns lookup in order to do a name search.


We’ll look for


It returns and address of

We’ll use the mark feature to copy the address to Notepad so that we have it saved for future use.




Now what we’ll try create a rout in the routing table by using “route add” You’ll notice that the address starts with a 166


We’ll type and add a mask of


The next field is a default gateway and you’ll notice that from above, the default gateway is


Next we’ll hit enter.

We’ll once again type “route print – 4


And take a look at the results of what’s been added.


You’ll noticed that a rout has been added to at it’s in the table. In fact, Windows looks at its routing table from the bottom to the top. Therefore, it placed it in this position which is not very specific since it only matches to the first 8 bits.

Now we will modify it again by using “route add” and the first two octets and then add a mask of and we’ll continue to send it to the default gateway of

Now we’ll hit enter and we receive an “OK!” notification.


Next we’ll type “route print -4


And hit enter.


Notice that it now placed it lower on the list? This is because Windows examines the routing tables form toe bottom up while looking for a specific match.  Now the route we just create matches more specific to 16 bits instead of 8 therefore it’s now lower on the table.

This is an example of what you will learn in the CompTIA Network + Certification class at Interface Technical Training.

For instructor-led CompTIA Certification classes, see our course schedule.

Until next time.

Mark Jacob
Cisco and CompTIA Network + Instructor – Interface Technical Training
Phoenix, AZ

Videos You May Like

A Simple Introduction to Cisco CML2

0 3850 0

Mark Jacob, Cisco Instructor, presents an introduction to Cisco Modeling Labs 2.0 or CML2.0, an upgrade to Cisco’s VIRL Personal Edition. Mark demonstrates Terminal Emulator access to console, as well as console access from within the CML2.0 product. Hello, I’m Mark Jacob, a Cisco Instructor and Network Instructor at Interface Technical Training. I’ve been using … Continue reading A Simple Introduction to Cisco CML2

Cable Testers and How to Use them in Network Environments

0 713 1

This content is from our CompTIA Network + Video Certification Training Course. Start training today! In this video, CompTIA Network + instructor Rick Trader demonstrates how to use cable testers in network environments. Let’s look at some tools that we can use to test our different cables in our environment. Cable Testers Properly Wired Connectivity … Continue reading Cable Testers and How to Use them in Network Environments

Government Edition – Encrypting a USB Flash Drive in Windows 10

0 271 2

In this video, Security Instructor Mike Danseglio demonstrates how to use BitLocker in Window 10 to secure files on a USB Flash drive that adhere to stricter data protection requirements as found inside Government entities. BitLocker 2-day instructor-led training is now available at Interface: BITLOCK: Planning and Deploying BitLocker Drive Encryption Training Video Transcription: Hi. … Continue reading Government Edition – Encrypting a USB Flash Drive in Windows 10

Write a Comment

Share your thoughts...

Please fill out the comment form below to post a reply.