linux删除路由表条目_Linux路由表条目存储在磁盘上的什么位置?

linux删除路由表条目

I know the routing tables on Linux is in memory after being set. However, where are the routing table entries stored on disk? I mean where are the routing table is persistently stored so that the routing table can be reloaded like the iptables (under /etc/sysconfig/iptables on Fedora/RHEL/CentOS Linuxes).

我知道设置后Linux上的路由表已在内存中。 但是,路由表条目存储在磁盘上的什么位置? 我的意思是将路由表永久存储在哪里,以便可以像iptables(在Fedora / RHEL / CentOS Linuxes上的/etc/sysconfig/iptables下)一样重新加载路由表。

If the system uses the /etc/rc.d/init.d/network script to manage the network, the static routing rules are stored in /etc/sysconfig/static-routes. This is the related script about applying the rules from static-routes in the network script file:

如果系统使用/etc/rc.d/init.d/ network脚本来管理网络,则静态路由规则存储在/etc/sysconfig/static-routes 。 这是有关在network脚本文件中应用来自static-routes的规则的相关脚本:

# Add non interface-specific static-routes.
    if [ -f /etc/sysconfig/static-routes ]; then
       grep "^any" /etc/sysconfig/static-routes | while read ignore args ; do
          /sbin/route add -$args
       done
    fi    

The network script reads from /etc/sysconfig/static-routes the lines starting with “any” and passes the following arguments to the /sbin/route command.

network脚本从/etc/sysconfig/static-routes读取以“ any”开头的行,并将以下参数传递给/sbin/route命令。

For example: A line like this in static-routes:

例如:在静态路由中这样的一行:

any host 10.1.1.8 gw 8.9.10.11

runs command:

运行命令:

route add -host 10.1.1.8 gw 8.9.10.11

If the system uses NetworkManager to manage the network, the NetworkManager GUI tools provides a dialog to set the routing rules. In the “Editing config_name” dialog’s “IPv4 Settings” tab (for IPv4), there is a button “Routes” which will opens the form that you can configure the routing rules.

如果系统使用NetworkManager来管理网络,则NetworkManager GUI工具将提供一个对话框来设置路由规则。 在“编辑config_name”对话框的“ IPv4设置”选项卡(对于IPv4)中,有一个“路由”按钮,它将打开您可以配置路由规则的表单。

Answered by Peter M..
彼得·M。的回答

翻译自: https://www.systutorials.com/where-are-the-linux-routing-table-entries-stored-on-disk/

linux删除路由表条目

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值