Filters:

  • Technologies

  • Instructors

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

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


    Transcription:

    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

    001-route-print-change-routing-Tables-with-a-command-prompt-comptia-net

    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.

    002-route-print-ipv4-change-routing-Tables-with-a-command-prompt-comptia-net

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

    003-quad-zero-route-change-routing-Tables-with-a-command-prompt-comptia-net

    This route points to the default gateway 10.1.0.1

    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 0.0.0.0

    You may also like:  How to Connect GNS3 to a Valid External Host in Windows 8

    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.

    004-ns-lookup-change-routing-tables-with-a-command-prompt-comptia-net

    We’ll look for InterfaceTT.com

    005-ns-lookup-change-routing-tables-with-a-command-prompt-comptia-net

    It returns and address of 166.62.36.100

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

    006-mark-change-routing-tables-with-a-command-prompt-comptia-net

    007-mark-change-routing-tables-with-a-command-prompt-comptia-net

    008-mark-change-routing-tables-with-a-command-prompt-comptia-net

    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

    009-mark-change-routing-tables-with-a-command-prompt-comptia-net

    We’ll type 166.0.0.0 and add a mask of 255.0.0.0

    010-change-routing-tables-with-a-command-prompt-comptia-net

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

    011-change-routing-tables-with-a-command-prompt-comptia-net

    Next we’ll hit enter.

    We’ll once again type “route print – 4

    012-change-routing-tables-with-a-command-prompt-comptia-net

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

    013-change-routing-tables-with-a-command-prompt-comptia-net

    You’ll noticed that a rout has been added to 166.0.0.0 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.

    You may also like:  This is NOT a Joke! Beware of IT Helpdesk Phone Scams

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

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

    014-change-routing-tables-with-a-command-prompt-comptia-net

    Next we’ll type “route print -4

    015-change-routing-tables-with-a-command-prompt-comptia-net

    And hit enter.

    016-change-routing-tables-with-a-command-prompt-comptia-net

    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

    Share your thoughts...

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