devplayer0 / docker-net-dhcp

Docker network driver for networking on a host bridge with DHCP-allocated IP addresses
GNU General Public License v3.0
193 stars 55 forks source link

The network connection is lost after running ip link command. #19

Closed siaimes closed 3 years ago

siaimes commented 3 years ago

After running command

sudo ip link set eth0 master my-bridge

my server`s ssh connect is lost and can not ssh again.

I use the ipmi tool to log in to the server and run this command

sudo iptables -A FORWARD -i my-bridge -j ACCEPT

but this did not fix my problem.

My server does not have the dhcpcd command, because the server has been disconnected from the network and this command cannot be installed. I used the dhclient command to re-obtain the IP address. Now ssh can work, but there is still no network connection, so the dhchcd command cannot be installed.

siaimes commented 3 years ago

I use the ifconfig command to see that my-bridge and eth0 use the same MAC address but get different IPs. Is there a problem?

devplayer0 commented 3 years ago

This is just the way bridges work. I'm not sure how the MAC address of the bridge of your eth0 is the same as the bridge - it shouldn't be. You should be removing all IP configuration from eth0 and using your distro's standard network config on the bridge instead of eth0.

siaimes commented 3 years ago

This is just the way bridges work. I'm not sure how the MAC address of the bridge of your eth0 is the same as the bridge - it shouldn't be. You should be removing all IP configuration from eth0 and using your distro's standard network config on the bridge instead of eth0.

I test this plugin in virtual box, I do replace eth0 with enp0s3.