In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article "Linux system how to view the network routing table" is not quite understood by most people except programmers. Today, in order to make you better understand "how the Linux system views the network routing table", Xiaobian summed up the following content, which has a certain reference value, the detailed steps are clear, and the details are handled properly. I hope you can get something through this article. Let's take a look at the specific content.
Method 1: through the netstat command
The netstat command has always been a widely used method of printing routing table information in Linux. However, it was officially replaced by the ip route command. In any case, we need it because it is still a way to retrieve the information we need.
Here is how to use this command:
$netstat-rn
-r this flag is used to display the kernel routing table
-n this flag is used to display numeric addresses
This is the result of the output:
Destination this column indicates the destination network. Gateway this column indicates the defined gateway of the network. If you see * in this column, the specified network does not require a forwarding gateway. Genmask this column indicates the network mask of the network. Flags the U output in this column indicates that the route has been started. The G output indicates that the specified gateway should be used for this route. D stands for dynamic installation, M for modification, and R for recovery. MSS this column indicates the default maximum segment size (MSS) for TCP connections for this route. Window this column indicates the default window size for TCP connections on this route. Irtt this column indicates the initial round trip time for this route. The IfaceIface column shows the network interface. If you have multiple interfaces, you will see lo (for loopback), eth0 (the first Ethernet device) and eth2 (for the second Ethernet device), and so on the number of interfaces you have installed. Method 2: through the route command
The route command is also a widely used but now obsolete command to view the routing table. The man page of this command also mentions that the command has now been replaced by the ip route command.
With this command, you can view exactly the same information through the netstat command. Here's how to use it:
$route-n
Kernel IP routing table destination gateway subnet mask flag hop reference using interface 0.0.0.0 192.168.182.2 0.0.0.0 UG 20100 00 ens33169.254.0.0 0.0.0.0 255.255.0.0 U 1000 00 ens33172.17.0.0 0.0.0.0 255.255.0.0 U 000 docker0192.168.182.0 0.0.0.0 255.255.255.0 U 1000 0 ens33
-n this flag is only used to display numeric addresses
Method 3: through the ip route command
Last but not least, this is the best way to print routing table information in Linux. Here is how to use this command:
$ip route
Although this information is not as reader-friendly as the previously mentioned commands, it is still sufficient for you to configure the router.
These are several commands to view routing table information in Ubuntu. Although the ip route command is not very neat in appearance, it is still the recommended way to find relevant routing table information. Although other commands are considered obsolete, they do sometimes help to export what needs to be extracted.
What is Linux system Linux is a free-to-use and free-spread UNIX-like operating system, is a POSIX-based multi-user, multi-task, multi-threaded and multi-CPU operating system, using Linux can run major Unix tools, applications and network protocols.
Thank you for your reading. I hope you have a certain understanding of the key issue of "how to view the network routing table in the Linux system". The specific usage still needs to be understood through hands-on experiments. Try it quickly. If you want to read more articles about relevant knowledge points, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.