After installing docker, causing problems Qemu-4.1 bridge network bridge the network is set qemu

   According to Qemu-4.1 bridge network settings after establishing the network bridging method described can be implemented virtual machine and host ping each other, but other ping ip address in the same segment Shique failed with host virtual machines to go, after ifconfig then found a bridge docker0 called, which is created automatically when you install docker-ce will delete docker0 still can not ping, simply uninstall the docker-ce, and then restart the computer so the virtual machine can ping other ip address, the DNS configuration and Gateway, can ping www.baidu.com.

  google for a long time, found docker during installation will modify iptables, the solution is as follows:

iptables -I FORWARD -i br0 -o br0 -j ACCEPT

Here is the web address:

      https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=865975

 

  The above changes take effect only temporarily, also need to re-execute the next reboot, for once and for all, you need to save the rules down here, refer to the following links:

        Ubuntu method automatically take effect after the restart to save and iptables

  I'm using sudo APT-GET install iptables-persistent this approach

 

iptables command:

View the current rules: sudo iptables --list-rules 

 

 

 

Finish.

Guess you like

Origin www.cnblogs.com/pengdonglin137/p/11519034.html