pipework
Last updated
Last updated
git clone https://github.com/jpetazzo/pipework.git sudo cp -rp pipework/pipework /usr/local/bin/ sudo apt-get install arping bridge-utils -y
sudo docker run --name hello --net=none -itd busybox
exit
sudo docker start hello
sudo pipework br0 -i eth0 hello ip/netmask(192.168.43.11/24)@gateway(192.168.43.1)
從HOST機做 ping 測試
sudo pipework br0 hello 192.168.43.11/24@192.168.43.1(這樣container會多出eth1的介面)
sudo pipework br0 -i eth0 hello 192.168.43.11/24@192.168.43.1(指定使用container的eth0)
ping 192.168.43.11
進入容器,檢查網路狀態
如此,便可讓容器取得與HOST機同網段的ip,讓外網存取