The command netstat -r is used to display the routing table of your system. Here's a brief explanation:
netstat: This command provides various network-related information.-r: This option specifically shows the routing table, which contains information about how packets are routed through the network.
Example Output
When you run netstat -r, you might see output like this:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
Key Columns
- Destination: The destination network or host.
- Gateway: The gateway through which the destination can be reached.
- Genmask: The subnet mask for the destination.
- Flags: Indicates the route's status (U = up, G = gateway).
- Metric: The cost of using this route.
- Iface: The network interface used for the route.
This command is useful for troubleshooting network routing issues and understanding how your system communicates with other networks. If you're interested in learning more about networking, consider checking out relevant resources or labs!
