luscis / openlan

Cloudify VPN written in Golang, and simple deployment via Kubernetes
http://vpn.luscis.cn
GNU General Public License v3.0
55 stars 24 forks source link

目前链路不可限速,是否可以限速链路? #71

Closed fanzhengweiwudi closed 3 weeks ago

danieldin95 commented 3 weeks ago

Linux对网卡使用TBF队列限速:

tc qdisc add dev vxlan11252 root tbf rate 100mbit burst 64kbit latency 400ms
tc qdisc show dev vxlan11252

删除限速:

# tc qdisc del dev vxlan11252 root
danieldin95 commented 3 weeks ago
root@hk-cloud:~#
root@hk-cloud:~# openlan -v rate add --device vxlan12 --speed 5
2024/09/06 14:52:46 DEBUG|cli|Client.JSON -> POST https://localhost:10000/api/interface/vxlan12/rate
2024/09/06 14:52:46 DEBUG|cli|Client.JSON -> {"device":"vxlan12","speed":5}
2024/09/06 14:52:46 DEBUG|cli|client.JSON <-
root@hk-cloud:~# openlan -v rate rm --device vxlan12
2024/09/06 14:52:50 DEBUG|cli|Client.JSON -> DELETE https://localhost:10000/api/interface/vxlan12/rate
2024/09/06 14:52:50 DEBUG|cli|Client.JSON -> null
2024/09/06 14:52:50 DEBUG|cli|client.JSON <-
root@hk-cloud:~#