Linux - Virtualization and CloudThis forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have installed KVM in Linux Deepin desktop 12.12. I created Cent OS VM and assigned static private IP to it. I can ping to internet and other local computer's IP address from the VM, but I can't ping my host (my PC where I installed KVM) IP. My host IP has separate static IP. Also I cannot ping to VM from the host.
I think this question was asked many times around here.
It will not work like this.
The (only?) way to have full network transparency with kvm is to use a pre defined bridge on the host - one working method ( i use it too) is to transfer the physical (say eth0) devices config to a bridge (br0) then use that bridge as a shared device in kvm/virt-manager.
For example i have:
Code:
$ brctl show
bridge name bridge id STP enabled interfaces
br0 8000.94de80008b0c no eth0
vnet0
vnet0 is a device created by kvm attached to my running vm. eth0 has no configuration - everything it had is transferred to br0. Every vm will have its own vnetX device when started - the IP address etc is controlled from within the vm.
I think this question was asked many times around here.
It will not work like this.
The (only?) way to have full network transparency with kvm is to use a pre defined bridge on the host - one working method ( i use it too) is to transfer the physical (say eth0) devices config to a bridge (br0) then use that bridge as a shared device in kvm/virt-manager.
It can work. When using macvtap for the VMs then use macvlan for the host. Then VM & host can "see" each other similar to the BR/TAP bridging method.
Code:
# as root - add macvlan to eth
ip addr flush eth0
ip link add link eth0 dev mvl0 type macvlan mode bridge
ip link set mvl0 addr 00:00:00:02:01:81 up
ip addr add 192.168.20.181 dev mvl0
ip route add default via 192.168.20.1 dev mvl0
# show the interfaces
ip addr
# show the routes
ip route
Does it have any tangible advantages over the standard bridging method?
The upsides are numerous. Using macvtap/macvlan simplifies networking by decoupling the tap and the bridge. You can start a macvtap and gain network access with the VM without starting the macvlan for the host. You only need the macvlan if you need the VM and the host to see each other. The cli is simplified using route2 commands as a single tool to manipulate the macvtap, macvlans and default route. You don't have to use separate cli tools like brctl for the bridge and tunctl for the tap and route for the default route. The modules for macvtap, macvlan & tun modules are automatically loaded as dependencies of the vhost_net module used for virtio networks.
A downside is that qemu doesn't directly support macvtap yet so you have to use file descriptors for network access. That's handled for you if you use libvirt and requires a bit more effort if you use the cli. There may be other downsides but they don't jump out at me at the moment.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.