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

How does linux delete a route

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "how to delete routes in linux". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to delete routes by linux".

In linux, you can use the route command to delete routes, which are used to manipulate kernel-based ip routing tables, create or delete specified routes, and delete specified routes when the parameter is set to "del". The syntax is "route del-net gw" or "route del-host dev".

The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

How does linux delete a route

Routes can be deleted using the route command in linux.

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.

Examples are as follows:

Delete route route del-net 192.168.0.0According to 24 gw 192.168.0.1

Add add route del delete route-net set route to a network segment-host set route to a host gw egress gateway IP address dev egress gateway physical device name

Delete route ip route del 192.168.0.0Uniple 24 via 192.168.0.1

Add add route del delete route via gateway egress IP address dev gateway egress physical device name

Add default route ip route add default via 192.168.0.1 dev eth0 via 192.168.0.1 is my default router

At this point, I believe you have a deeper understanding of "how to delete routes in linux". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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

Servers

Wechat

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

12
Report