![将 Ubuntu 从 14.04 升级到 16.04 后,使用 TC(CLASSFUL QDISCS,如 prio、HTB、CBQ)进行流量整形不起作用](https://linux22.com/image/1524407/%E5%B0%86%20Ubuntu%20%E4%BB%8E%2014.04%20%E5%8D%87%E7%BA%A7%E5%88%B0%2016.04%20%E5%90%8E%EF%BC%8C%E4%BD%BF%E7%94%A8%20TC%EF%BC%88CLASSFUL%20QDISCS%EF%BC%8C%E5%A6%82%20prio%E3%80%81HTB%E3%80%81CBQ%EF%BC%89%E8%BF%9B%E8%A1%8C%E6%B5%81%E9%87%8F%E6%95%B4%E5%BD%A2%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8.png)
全部。我有一个问题。我在 14.04 上使用 tc 和 HTB 进行流量整形。
tc qdisc add dev docker0 root handle 1: htb default 1024
这在装有 docker 1.11 的 ubuntu 14.04 上运行良好。但在我将 ubuntu 从 14.04 升级到 16.04(而不是升级 docker)后。当我执行相同的命令时:
tc qdisc add dev docker0 root handle 1: htb default 1024
所有正在运行的容器都无法访问网络,甚至是默认网关。
/ # ip r l
default via 172.20.0.1 dev eth0
172.20.0.0/16 dev eth0 src 172.20.0.2
/ # ping 172.20.0.1
PING 172.20.0.1 (172.20.0.1): 56 data bytes
^C
--- 172.20.0.1 ping statistics ---
2 packets transmitted, 0 packets received, 100% packet loss
我在主机上捕获数据包,例如
tcpdump -vvv -nn -i docker0
tcpdump: listening on docker0, link-type EN10MB (Ethernet), capture size 262144 bytes
15:44:59.611212 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 172.20.0.1 tell 172.20.0.2, length 28
15:45:00.629100 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 172.20.0.1 tell 172.20.0.2, length 28
15:45:01.653096 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 172.20.0.1 tell 172.20.0.2, length 28
并检查docker0的tc状态:
tc -s -d qdisc show dev docker0
qdisc htb 1: root refcnt 2 r2q 10 default 1024 direct_packets_stat 0 ver 3.17 direct_qlen 0
Sent 0 bytes 0 pkt (dropped 48, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
有类似的事情,所有包裹都丢失了。有人能给我一些建议吗?谢谢