kvm wireless network card setting bridge network

Record kvm using wireless network card bridging:
When kvm is installed and a new virtual machine is created, the virtual machine at this time is a nat network. On this basis, it is transformed into a bridged network, so that the virtual machine and the host are in the same network segment
1, Set the wireless network card to ap mode, otherwise the wireless network card cannot be added to the network bridge (it is said that some network cards can be added directly?)
Execute on the host machine:
iw dev wlp3s0 set 4addr on
where wlp3s0 is the name of the wireless network card
2, and virtualize it on the host machine Network card virbr0 (generated by default by kvm)
can use nmtui to set ip, gateway, dns, etc. , or other methods
3. Add wireless network card to virbr0
brctl addif virbr0 wlp3s0
If there is no such command, manually install the bridge-utils package and
run brctl show
kvm wireless network card setting bridge network
, The virbr0 bridge contains the above three network cards, which has one more wireless network card than the nat mode.
4. Remove the host-related firewall rules.
Remove the udp port 53 and ip masquerading rules made in nat mode.
5. Modify the virtual machine network card and
modify the ip to The host's unified network segment does not use the ip
gateway, which is the host's gateway. The two are consistent and the
dns is consistent with the host.
At this time, the host and the virtual machine are in the unified LAN and can access the external network at the same time.

Guess you like

Origin blog.51cto.com/3823536/2547591