1
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Dockerが生成したBridgeインターフェースbr-xxxを削除

Last updated at Posted at 2019-09-22

TL;DR

LinuxでDockerを使っているとbr-xxxのインターフェースが大量に生まれる。

これらが邪魔なので削除する。

ブリッジ一覧の取得

$ brctl show | grep br-

br-0e4b4d2adaa0		8000.024252c5aa0b	no		
br-101051c36d70		8000.0242172f7838	no		
br-473a9f7308cd		8000.02428b7b217c	no		
br-5bab46a8c16a		8000.0242cc13e4a4	no		
br-6018e1f7448f		8000.02423aa497f4	no		
br-b01cd99cb441		8000.0242800a155f	no		
br-b7aa45dc4cdb		8000.02428405b708	no		
br-be3258c63aee		8000.02429a8048ce	no		
br-c404e8f8714d		8000.0242c94f6033	no		
br-c51318800cc0		8000.02423ab8d0cf	no		
br-e76bba7d2af3		8000.02425f60e107	no		
br-ee033a5f8b20		8000.024212da4389	no		
br-fe46dd570f1b		8000.02428ba86c49	no		

ブリッジを個別に削除

sudo ip link set dev br-0e4b4d2adaa0 down
sudo brctl delbr br-0e4b4d2adaa0

ブリッジを全て削除

for b in `brctl show | grep br- | awk '{print $1}'`  
do
  sudo ip link set dev $b down
  sleep 1
  sudo brctl delbr $b
  echo "+++ Deleted $b +++"
done

実行結果:

+++ Deleted br-101051c36d70 +++
+++ Deleted br-473a9f7308cd +++
+++ Deleted br-5bab46a8c16a +++
+++ Deleted br-6018e1f7448f +++
+++ Deleted br-b01cd99cb441 +++
+++ Deleted br-b7aa45dc4cdb +++
+++ Deleted br-be3258c63aee +++
+++ Deleted br-c404e8f8714d +++
+++ Deleted br-c51318800cc0 +++
+++ Deleted br-e76bba7d2af3 +++
+++ Deleted br-ee033a5f8b20 +++
+++ Deleted br-fe46dd570f1b +++

毎回やるのが面倒なら .zshrc や .bashrc に書いておくのが良さそう。

1
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?