In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article is to share with you about how linux increases routing. The editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article. Let's take a look at it.
In linux, you can add routes using the route command, which is used to manipulate the kernel-based ip routing table and can create or delete specified routes with the syntax of "route add-net gw" or "route add-host dev".
The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
How does linux increase routing
The route command of the Linux system is used to display and manipulate the IP routing table (show / manipulate the IP routing table). To achieve communication between two different subnets, you need a router connecting two networks, or a gateway located in both networks.
In Linux systems, routing is usually set up to solve the following problems: the Linux system has a gateway in a local area network, which allows the machine to access the Internet, so it is necessary to set the IP address of this machine to the default route of the Linux machine. It is important to note that the route will not be saved permanently by executing the route command directly under the command line, and the route will become invalid when the network card is restarted or the machine is rebooted; you can add the route command in / etc/rc.local to ensure that the route setting is permanent.
1. Command format:
Route [- f] [- p] [Command [Destination] [mask Netmask] [Gateway] [metric Metric]] [if Interface]]
2. Command function:
The Route command is used to manipulate the kernel-based ip routing table, and its main purpose is to create a static route to specify a host or network through a network interface, such as eth0. When the "add" or "del" parameters are used, the routing table is modified, and if there are no parameters, the current contents of the routing table are displayed.
3. Command parameters:
-c display more information
-n does not resolve the name
-v displays detailed processing information
-F display sending message
-C displays the route cache
-f clears the routing table for all gateway entrances.
-p makes the route permanent when used with the add command.
Add: add a new route.
Del: delete a route.
-net: destination address is a network.
-host: the destination address is a host.
Netmask: when adding a network route, a network mask is required.
Gw: routes packets through the gateway. Note that the gateway you specify must be reachable.
Metric: sets the number of routing hops.
Command specifies the command you want to run (Add/Change/Delete/Print).
Destination specifies the network destination for the route.
Mask Netmask specifies the network mask (also known as the subnet mask) associated with the network destination.
Gateway specifies the forward or next-hop IP address that can be reached by the set of addresses defined by the network destination and the subnet mask.
Metric Metric specifies an integer cost value for the route (from 1 to 9999), which can be used when selecting multiple routes in the routing table that best match the destination address of the forwarded packet.
If Interface specifies the interface index for the interface that can access the target. To get a list of interfaces and their corresponding interface index, use the display function of the route print command. You can use decimal or hexadecimal values for interface indexing.
This is how linux increases routing. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please 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.