Hi, please find the following usage of route command:
Usage: route [-ne] [-A inet[6]] [{add|del} [-net|-host] TARGET [netmask MASK][gw GATEWAY] [metric N] [mss BYTES] [window BYTES] [reject] [IFACE]]
Show or edit kernel routing tables
-n Don't resolve names
-e Display other/more information
-A inet[6] Select address family
You can use "route -n" to print out the route table and capture the route thought Zerotier interface which you want to modify:
[email protected]:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 6 0 0 wlan0
10.147.17.0 0.0.0.0 255.255.255.0 U 0 0 0 zt3jnwum2t
192.168.0.0 0.0.0.0 255.255.255.0 U 6 0 0 wlan0
192.168.2.0 0.0.0.0 255.255.255.0 U 3 0 0 br-lan
Use "del" argument to delete the current route:
[email protected]:~# route del -net 10.147.17.0 gw 0.0.0.0 netmask 255.255.255.0 dev zt3jnwum2t
[email protected]:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 6 0 0 wlan0
192.168.0.0 0.0.0.0 255.255.255.0 U 6 0 0 wlan0
192.168.2.0 0.0.0.0 255.255.255.0 U 3 0 0 br-lan
Use "add" argument to add the route back with desired metric value:
[email protected]:~# route add -net 10.147.17.0 netmask 255.255.255.0 metric 100 zt3jnwum2t
[email protected]:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 6 0 0 wlan0
10.147.17.0 0.0.0.0 255.255.255.0 U 100 0 0 zt3jnwum2t
192.168.0.0 0.0.0.0 255.255.255.0 U 6 0 0 wlan0
192.168.2.0 0.0.0.0 255.255.255.0 U 3 0 0 br-lan
Regards,
Ledong