In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
What if the linux configuration gateway prompts me that the network is unreachable? I believe that many inexperienced people are at a loss about this, so this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
Linux configuration gateway prompts the network to be unreachable
Route: SIOCADDRT: Network is unreachable
Reason: it is possible that the subnet mask was not added when configuring the ip address
Solution: reconfigure ip, add subnet mask, and add gateway
The specific operation process is as follows:
1. Add a network card and configure ip
[root@vm50 ~] # nmcli connection show / / View the network card
Name UUID type device
Eth0 4f5f8b5d-4b51-4e1c-98c7-40f0eb90f241 802-3-ethernet eth0virbr0 566dccb2-cbb0-4bbe-a714-06f3d313d9cd bridge virbr0 [root@vm50 ~] # nmcli connection add con-name eth2 type ethernet ifname eth2 / / add network card connection "eth2" (4cb9f43e-77d6-455f-990c-620e4a12d52b) has been added successfully. [root@vm50 ~] # nmcli connection modify eth2 ipv4.method manual ipv4.addresses 192.168.2.50 con.autoconnect yes 24 con.autoconnect yes / / configure ip address, here 192.168.2.50 Universe 24 (24 not added) Then the network is unreachable) [root@vm50 ~] # nmcli connection up eth2 / active Nic connection activated successfully (D-Bus activity path: / org/freedesktop/NetworkManager/ActiveConnection/8) [root@vm50 ~] # nmcli connection show name UUID type device eht1 4cb9f43e-77d6-455f-990c-620e4a12d52b 802-3-ethernet eth2 / / already Added network card eth0 4f5f8b5d-4b51-4e1c-98c7-40f0eb90f241 802-3-ethernet eth0 virbr0 566dccb2-cbb0-4bbe-a714-06f3d313d9cd bridge virbr0
2. Configure the gateway
[root@mysql51 ~] # systemctl stop NetworkManager / / configure the gateway You need to stop network management [root@mysql51] # route-n / / View the gateway Gateway Kernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Iface192.168.4.0 0.0.0.0 255.255.255.0 U 10000 eth0192.168.122.0 0.0.0.0 255.255 .000 U 000 virbr0 [root@mysql51 ~] # route add default gw 192.168.4.50 route: SIOCADDRT: Network is unreachable / / configure the gateway The network is unreachable Reconfigure ip [root@mysql51 ~] # route add default gw 192.168.4.50 [root@mysql51 ~] # route-nKernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Iface0.0.0.0 192.168.4.50 0.0.0.0 UG 000 eth0 192.168.4.0 0.0.0.0 255.255 . 255.0 U 1000 eth0192.168.122.0 0.0.0.0 255.255.255.0 U 00 virbr0 Have you mastered the solution of linux configuration gateway prompting network unreachability? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
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.