# 在 Host 中,创建 macvlan 网卡# ipv4.method auto:为了说明问题,我们没有使用冗长的网络配置# ipv4.route-metric 0:为了使该 macvlan 网卡成为优先级最高的路由(这样我们就不用停止原先的网络配置)nmcli connection add \ connection.type "macvlan" macvlan.mode "bridge" macvlan.parent "enp2s0f0" \ connection.interface-name "kvm-guest2host" \ connection.id "kvm-guest2host" \ ipv4.method auto \ ipv4.route-metric 0nmcli connection up "kvm-guest2host"# 在 Guest 中,要保证 Guest 也是使用 enp2s0f0 网卡派生的 macvtap 设备,并使用 bridge 模式# 通常情况,不用修改,因为我们一般都使用这种模式。-----------------------------------
参考文献
https://blog.51cto.com/u_11101184/3137103