首页 > 解决方案 > 删除路由 OpenWRT

问题描述

我需要在 /etc/config/network 中找到如何删除 OpenWRT 上的静态路由

添加路线:

uci add network route
uci set network.@route[-1].interface=wan
uci set network.@route[-1].target=xxx.xxx.xxx.xxx
uci set network.@route[-1].netmask=aaa.aaa.aaa.aaa
uci set network.@route[-1].gateway=bbb.bbb.bbb.bbb
uci commit network

从 /etc/config/network 执行此操作,我得到:

config route
option interface 'wan'
option target 'xxx.xxx.xxx.xxx'
option netmask 'aaa.aaa.aaa.aaa'
option gateway 'bbb.bbb.bbb.bbb'

好的,这有效,但如何删除?如果我这样做:

uci delete network route
uci delete network.@route[-1].interface=wan
uci delete network.@route[-1].target=xxx.xxx.xxx.xxx
uci delete network.@route[-1].netmask=aaa.aaa.aaa.aaa
uci delete network.@route[-1].gateway=bbb.bbb.bbb.bbb
uci commit network

这是我从 /etc/config/network 得到的

config route
option interface 'wan'

ip、sub 和 gateway 被删除,但没有“config route”和“option interface 'wan'”

我究竟做错了什么?

谢谢

标签: openwrtluci

解决方案


推荐阅读