Networking

📌What is a routing table?

A routing table is a set of rules, often viewed in a table format, that is used to determine where the data packets traveling over an Internet Protocol (IP) network will be directed. All IP-enabled devices, including routers and switches, use routing tables.

  1. Network ID: The network ID or destination corresponding to the route.
  2. Subnet Mask: The mask that is used to match a destination IP address to the network ID.
  3. Next Hop: The IP address to which the packet is forwarded
  4. Outgoing Interface: Outgoing interface the packet should go out to reach the destination network.
  5. Metric: A common use of the metric is to indicate the minimum number of hops (routers crossed) to the network ID.

📌What is Gateway?

A gateway is a hardware device that acts as a “gate” between two networks. It may be a router, firewall, server, or other devices that enable traffic to flow in and out of the network.

📌What is IP Address?

An IP address is a unique address that identifies a device on the internet or a local network. IP stands for “Internet Protocol,” which is the set of rules governing the format of data sent via the internet or local network.

How do IP addresses work:

If we want to understand why a particular device is not connecting in the way we would expect or we want to troubleshoot why our network may not be working, it helps understand how IP addresses work.

  1. Our device indirectly connects to the internet by connecting at first to a network connected to the internet, which then grants our device access to the internet.
  2. When we are at home, that network will probably be our Internet Service Provider (ISP). At work, it will be our company network.
  3. Our IP address is assigned to our device by our ISP.
  4. Our internet activity goes through the ISP, and they route it back to us, using our IP address. Since they are giving us access to the internet, it is their role to assign an IP address to our device.
  5. However, our IP address can change. For example, turning our modem or router on or off can change it. Or we can contact your ISP, and they can change it for us.
  6. When we are out and about — for example, traveling — and we take our device with us, our home IP address does not come with us. This is because we will be using another network (Wi-Fi at a hotel, airport, or coffee shop, etc.) to access the internet and will be using a different (and temporary) IP address, assigned to you by the ISP of the hotel, airport or coffee shop.

📌What is Netmask?

A Netmask is a 32-bit “mask” used to divide an IP address into subnets and specify the network’s available hosts.

How to read a netmask?

The left-hand side of a netmask (e.g. 192.168.0.1) specifies a host IP address. The right-hand side specifies (e.g. /32) how many digits of the host address are significant, when considered as a binary number. Non-significant bits in the binary form are treated as a wild-card.

🎯Create a Setup so that we can ping Google but not able to ping Facebook from the same system.

The Wrap-Up

I have successfully created a setup where we can ping to google but cat ping to Facebook at the same time from a system.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Abhayagarwal

Abhayagarwal

I am tech enthusiast fascinated towards technology and its various disciplines including Big Data, Hadoop, Web Development, Competative Programming,ML,etc.