In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to configure the dual network card routing table in Linux. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
If the eth0 is 192.168.10.123 eth0 255.255.255.0, the command format is as follows:
# route add-net 192.168.10.0 netmask 255.255.255.0 dev eth0
# route add-net 192.168.20.0 netmask 255.255.255.0 dev eth2
The above command sends the IP packet sent to the 192.168.10.0 network segment to eth0 for forwarding, and the 192.168.20.0 network segment IP packet to eth2 for forwarding. If it is possible to have packets sent to other destinations IP, then you would like to set up a "default gateway":
# route add default gw 192.168.10.1
The above command forwards all packets sent to other destinations IP to 192.168.10.1, and the rule on how to forward to the address 192.168.10.1 is defined in the first command just now (forwarding from eth0). In general, the default gateway has been set automatically, so there is no need to repeat the setting. You can use the route command with the-n argument to check.
If you want to delete an item, the command format is:
# route del-net 192.168.10.0 netmask 255.255.255.0
One idea of configuration is to route the 192.168.10.0 segment to the eth0192.168.20.0 segment to eth2, and then set the default route. Another idea is to specify only one of them, and then route the default 0.0.0.0 to the other. In fact, the effect is the same, there are two styles.
On how to configure the dual network card routing table in Linux to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
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.