在br-int桥上添加一个internal口
ovs-vsctl add-port br-int test – set Interface test type=internal
添加流表将vm口上的流量倒入到该test口
这里的vhuxxxx为你想要访问虚机的端口
ovs-ofctl add-flow br-int in_port=“test”,actions=output:“vhuxxxxx”
ovs-ofctl add-flow br-int in_port=“vhuxxxxx”,actions=output:“test”
配置test口和VM内的网卡为同一网段
ifconfig test 100.100.100.100/24 up
virsh console xx —> 登录到vm里面
ifconfig eth0 100.100.100.200/24 up
测试连通性
ping 100.100.100.100 —> 正常这一步是可以通的
从宿主机上copy文件到虚机内
scp root@100.100.100.100:/root/xxxxx ./