需求:建立一个虚拟机,使网络和内网一样,当一台普通接入内网的服务器用,
qemu使vm网络和本机网络打通,
原理:主机网络改成桥接,建虚拟机时候的tap1设备帮到这个桥上即可
假设本机ip 192.168.139.85
参考上篇[url]http://haoningabc.iteye.com/blog/2224128[/url]
[b]一.主机上关闭NetworkManager[/b]
systemctl stop NetworkManager
sysetmctl disable NetworkManager
[b]二.让主机变桥接网络:[/b]
[code="java"]
# cat /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
TYPE=Bridge
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
IPADDR=192.168.139.85
NETMASK=255.255.240.0
GATEWAY=192.168.128.1
DNS1=114.114.114.114
[/code]
[code="java"]
# cat /etc/sysconfig/network-scripts/ifcfg-eth0
NAME="eth0"
DEVICE="eth0"
ONBOOT="yes"
NM_CONTROLLED=yes
qemu使vm网络和本机网络打通,
原理:主机网络改成桥接,建虚拟机时候的tap1设备帮到这个桥上即可
假设本机ip 192.168.139.85
参考上篇[url]http://haoningabc.iteye.com/blog/2224128[/url]
[b]一.主机上关闭NetworkManager[/b]
systemctl stop NetworkManager
sysetmctl disable NetworkManager
[b]二.让主机变桥接网络:[/b]
[code="java"]
# cat /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
TYPE=Bridge
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
IPADDR=192.168.139.85
NETMASK=255.255.240.0
GATEWAY=192.168.128.1
DNS1=114.114.114.114
[/code]
[code="java"]
# cat /etc/sysconfig/network-scripts/ifcfg-eth0
NAME="eth0"
DEVICE="eth0"
ONBOOT="yes"
NM_CONTROLLED=yes