Try   HackMD

Viewing and Changing Your Computer's Routing Table

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
Purpose

This tutorial is for understanding the basics of routing table and ping for testing. Here, we will try to disconnect our computer to the internet and reconnect it.

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
Step

  1. Open a command prompt window by typing cmd in the run box as shown in previous weeks and ensure you run as administrator by right clicking on "cmd" when it appears as a search result as shown in following image

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

  1. To view your routing table, type route print | more and press Enter. The | more after the route print command causes output to be displayed one screen at a time You should see the following results for your route print | more command.

    Image Not Showing Possible Reasons
    • The image was uploaded to a note which you don't have access to
    • The note which the image was originally uploaded to has been deleted
    Learn More →

    • Network Destination — The network destination your computer compares with the destination IP address of outgoing packets to determine where to send them.
    • Netmask — The subnet mask of the network destination. A value of 255.255.255.255 indicates that the address in the Network Destination column is a specific IP address rather than a network address; it's referred to as a "host route." A value of 0.0.0.0 is used when the network destination is 0.0.0.0, indicating the default route or gateway.
    • Gateway — The next hop address or the on-link, which means the network is connected directly to an interface. Make a note of the value in this the 0.0.0.0 network destination, as you need it later.
    • Interface — The address of the interface Windows uses to send the packet to the network destination.
    • Metric - The metric assigned to the route. If there are two entries for the network destination, the lower metric is the route chosen.
  2. To verify that you can communicate with the Internet, type ping 8.8.8.8 press Enter. If the ping is successful, your default network is working correctly. You should see the following results for your ping command

    Image Not Showing Possible Reasons
    • The image was uploaded to a note which you don't have access to
    • The note which the image was originally uploaded to has been deleted
    Learn More →

    In case you are wondering about the ip address 8.8.8.8. Google Public DNS

  3. Type route delete 0.0.0.0 and press Enter to delete your default route. Try to ping 8.8.8.8 again. The ping will fail. You have 'broken' your Internet Connection. Next, return to the Command Prompt and Type route print | more and press Enter. You will see that the 0.0.0.0 network destination is no longer in the table. Press the spacebar more times to display the rest of the output.

  4. To create the default route entry and restore your routing table, type route add -p 0.0.0.0 mask 0.0.0.0 default gateway and press Enter (replacing default-gateway with the address you noted in Step 3). e.g. route add -p 0.0.0.0 mask 0.0.0.0 193.61.191.201 (as shown next). Note your default-gateway IP may differ - see step 3 above where you record it from the route print table command.

    Image Not Showing Possible Reasons
    • The image was uploaded to a note which you don't have access to
    • The note which the image was originally uploaded to has been deleted
    Learn More →

  5. Display the routing table again to verify that your default route is ok

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
BONUS (Installing telnet)

The reason that we want to install telnet rather than ordinary ping command is that we can also check the port if it is working or not

  1. Enable the Telnet Client in Windows In Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista, turn on the Telnet Client in Windows Features in Control Panel before any relevant commands can be executed. Open Control Panel by searching for control panel in the Start menu. Or, open the Run dialog box via WIN+R and then enter control.

  2. Select Programs. If you don't see that because you're viewing the Control Panel applet icons, choose Programs and Features instead, and then skip to Step 4.

    Image Not Showing Possible Reasons
    • The image was uploaded to a note which you don't have access to
    • The note which the image was originally uploaded to has been deleted
    Learn More →

  3. Select Programs and Features.

    Image Not Showing Possible Reasons
    • The image was uploaded to a note which you don't have access to
    • The note which the image was originally uploaded to has been deleted
    Learn More →

  4. Select Turn Windows features on or off from the left pane.

    Image Not Showing Possible Reasons
    • The image was uploaded to a note which you don't have access to
    • The note which the image was originally uploaded to has been deleted
    Learn More →

  5. Select the check box next to Telnet Client.

    Image Not Showing Possible Reasons
    • The image was uploaded to a note which you don't have access to
    • The note which the image was originally uploaded to has been deleted
    Learn More →

  6. Select OK to enable Telnet.

  7. Execute Telnet Commands in Windows Telnet commands are easy to execute. After opening Command Prompt, enter the word telnet. The result is a line that says Microsoft Telnet>, which is where commands are entered.

    Image Not Showing Possible Reasons
    • The image was uploaded to a note which you don't have access to
    • The note which the image was originally uploaded to has been deleted
    Learn More →

    To connect to a Telnet server, enter a command that follows this syntax: telnet hostname port

  8. Examples:

    • telnet localhost 3000 -> connect to your port 3000 in localhost
    • telnet towel.blinkenlights.nl -> watch starwars in ASCII version XD