linux如何删除veth网卡,linux – 如何识别孤立的veth接口以及如何删除它们?

当我通过docker run启动任何容器时,我们得到一个新的veth interface.删除容器后,应删除与容器链接的veth接口.但是,有时它会失败(然后容器启动出错):

root@hostname /home # ifconfig | grep veth | wc -l

53

root@hostname /home # docker run -d -P axibase/atsd -name axibase-atsd-

28381035d1ae2800dea51474c4dee9525f56c2347b1583f56131d8a23451a84e

Error response from daemon: Cannot start container 28381035d1ae2800dea51474c4dee9525f56c2347b1583f56131d8a23451a84e: iptables Failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 33359 -j DNAT --to-destination 172.17.2.136:8883 ! -i docker0: iptables: No chain/target/match by that name.

(exit status 1)

root@hostname /home # ifconfig | grep veth | wc -l

55

root@hostname /home # docker rm -f 2838

2838

root@hostname /home # ifconfig | grep veth | wc -l

55

我如何识别哪些接口与现有容器链接,以及如何删除与已删除的对手链接的额外接口?

这种方式不起作用(通过root):

ifconfig veth55d245e down

brctl delbr veth55d245e

can't delete bridge veth55d245e: Operation not permitted

现在由传输流量定义的额外接口(如果没有活动,则是额外接口).

UPDATE

root@hostname ~ # uname -a

Linux hostname 3.13.0-53-generic #89-Ubuntu SMP Wed May 20 10:34:39 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

root@hostname ~ # docker info

Containers: 10

Images: 273

Storage Driver: aufs

Root Dir: /var/lib/docker/aufs

Backing Filesystem: extfs

Dirs: 502

Dirperm1 Supported: false

Execution Driver: native-0.2

Logging Driver: json-file

Kernel Version: 3.13.0-53-generic

Operating System: Ubuntu 14.04.2 LTS

cpus: 8

Total Memory: 47.16 GiB

Name: hostname

ID: 3SQM:44OG:77HJ:GBAU:2OWZ:C5CN:UWDV:JHRZ:LM7L:FJUN:AGUQ:HFAL

WARNING: No swap limit support

root@hostname ~ # docker version

Client version: 1.7.1

Client API version: 1.19

Go version (client): go1.4.2

Git commit (client): 786b29d

OS/Arch (client): linux/amd64

Server version: 1.7.1

Server API version: 1.19

Go version (server): go1.4.2

Git commit (server): 786b29d

OS/Arch (server): linux/amd64

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值