1. install required software
Sudo apt-get install uml-utilities bridge-utils
2. Add your account to the software group
Sudo gpasswd-a bruce uml-net
3. Modify the interface file as follows:
Sudo vi/etc/network/interfaces
Auto lo
Iface lo inet loopback
Auto tap0
Iface tap0 inet manual
Up ifconfig $ IFACE 0.0.0.0 up
Down ifconfig $ IFACE down
Tunctl_user bruce
Auto tap1
Iface tap1 inet manual
Up ifconfig $ IFACE 0.0.0.0 up
Down ifconfig $ IFACE down
Tunctl_user bruce
Auto tap2
Iface tap2 inet manual
Up ifconfig $ IFACE 0.0.0.0 up
Down ifconfig $ IFACE down
Tunctl_user bruce
Auto br0
Iface br0 inet static
Address 192.168.1.188
Netmask 255.255.255.0
Broadcast 192.168.1.255
Gateway 192.168.1.1
Bridge_maxwait 0
Bridge_ports all tap0 tap1 tap2
Auto eth0
Allow-hotplug eth0
Iface eth0 inet manual
Up ifconfig eth0 0.0.0.0 promisc up
4. Restart the machine configuration to take effect!
The above configuration is because my network environment is a static IP environment, so the IP addresses of virtual machines are all static IP addresses. If there is a DHCP server in the network environment, you can simplify the configuration, but I used virtual machines for experiments, the preferred IP address is fixed, so the configuration is as above.