-->
当前位置:首页 > DayDayUp > 正文内容

busybox添加路由

Luz2年前 (2021-12-27)DayDayUp4942

busybox添加路由的语法和一般linux和windows不一样,给我整蒙了,记录一下


1,添加

route add -net 221.130.33.60 netmask 255.255.255.255 gw 10.65.208.10    //流量转发到网关、指定ip

route add -net 221.130.33.60 netmask 255.255.255.255 dev rmnet0    //流量转发到指定接口、网卡


2,删除

route del -net 221.130.33.60 netmask 255.255.255.255


linux语法添加报错

root@Storage:~# route add 33.0.0.0 MASK 255.0.0.0 33.157.30.33   
BusyBox v1.18.4 (2015-03-11 10:33:31 CST) multi-call binary.

Usage: route [{add|del|delete}]

Edit kernel routing tables

Options:
        -n      Don't resolve names
        -e      Display other/more information
        -A inet{6}      Select address family


busybox语法

root@Storage:~# route add -net  10.0.0.0 netmask 255.0.0.0 33.157.30.33   
root@Storage:~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.10.15.254    0.0.0.0         UG    0      0        0 eth0
10.0.0.0        33.157.30.33    255.0.0.0       UG    0      0        0 eth1
10.10.15.0      0.0.0.0         255.255.255.0   U     0      0        0 eth0
33.0.0.0        33.157.30.33    255.0.0.0       UG    0      0        0 eth1
33.157.30.32    0.0.0.0         255.255.255.240 U     0      0        0 eth1
192.168.3.0     0.0.0.0         255.255.255.0   U     102    0        0 eth2
192.168.4.0     0.0.0.0         255.255.255.0   U     103    0        0 eth3


发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。