给虚拟机共享网络上网
在linux 中安装了虚拟机之后,发现虚拟机无法上网,为了解决这个问题,我们可以在真机中添加防火墙策略,将去虚拟机中的网络转到真机的wifi ip
步骤:
(1) 开启防火墙 firewall
命令:
systemctl start firewalld
(2)添加防火墙celue
命令:
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.43.24/24" masquerade"
(3) 重启firewalld
systemctl restart firewalld