Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the specific solution for Linux to delete a route?

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly analyzes the relevant knowledge of what is the specific solution of Linux delete routing, the content is detailed and easy to understand, the operation details are reasonable, and has a certain reference value. If you are interested, you might as well follow the editor to have a look, and follow the editor to learn more about "what is the specific solution for Linux delete routing".

Linux system removes routes

First, add routing 1. Add a static route to a host:

Route add-host [destination host IP address] gw [egress gateway]

Example: I want to add a static route to 192.168.3.100. My local IP address is 192.168.2.100 and the default gateway is 192.168.2.1, so I can do this:

Route add-host 192.168.3.100 gw 192.168.2.1

two。 Add a static route to a network:

Route add-net [destination network / subnet mask bits] gw [egress gateway]

Example: I want to add a static route to 192.168.3.0. My local IP address is 192.168.2.100, the subnet mask is 255.255.255.0, and the default gateway is 192.168.2.1, so I can do this:

Route add-net 192.168.3.0 take 24 gw 192.168.2.1

3. Add a default gateway:

Route add default gw [default gateway IP address]

Example: I want to add the default gateway 192.168.2.1, so I can do this:

Route add default gw 192.168.2.1

2. Delete a route to delete a route, just replace the add in the above command with del.

For example, if I want to delete the static routes added above to access hosts, networks, and default gateways, I can do this:

Route del-host 192.168.3.100 gw 192.168.2.1

Route del-net 192.168.3.0 take 24 gw 192.168.2.1

Route del default gw 192.168.2.1

About "Linux delete route specific solution is what is" introduced here, more relevant content can search the previous article, hope to help you answer questions, please support the website!

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report