-   Linux - Virtualization and Cloud (
-   -   Bridging works now attempting to set a static IP (

matthekc83 06-01-2013 07:25 PM

Bridging works now attempting to set a static IP
I am using KVM to set up some test boxes. The host is Debian 7 and the client is Centos 6.4 and I have some questions about the best way to setup the virtual network. If it's easier I have no objection to making my host Centos...

I have bridging working and now would like to have a small simulated network. The end goal is to have some Virtual servers with static IP addresses to play with and set up a test/learning environment.
Right now when I set the client to static it can no longer communicate past the gateway, I can ping everything inside but nothing outside...
I have seen some guides and read some various suggestions but I am a little confused. Can I do this with Bridging alone? Should I set up a simulated router? Do I need to setup Virtio?
Which setup is closest what would be used on a production KVM box? Since the end goal is to learn, I don't need the whole answer just a nudge in the right direction. Although if I get stuck a guide might be nice :)


Habitual 06-04-2013 08:30 AM


Originally Posted by matthekc83 (Post 4963746)
Since the end goal is to learn, I don't need the whole answer just a nudge in the right direction.

This is the most refreshing attitude I have seen around here in awhile.

This may help guide you on your quest:
How to set a static IP in Ubuntu VMs from the shell

subscribed with interest...

dyasny 06-04-2013 10:48 PM

Since you don't bring any of what you have actually done so far to the table, just some vague descriptions, I think it would be best to start with some basics.

First of all, how typical, bridged KVM VM networking works:
your VM is on all accounts a computer in it's own rights, no magic there, just emulation of every device you would have in a normal PC, including a network card.
This virtual network card is visible as a network card to the VM, and as a tap device (basically just a basic means of pushing data to other devices) on the host. So whenever the VM tries to use it's network card, the data is in fact in the tap device on the host.

On the host, this tap is plugged into a bridge, which in turn is plugged into a physical device, so here, the bridge acts as a virtual switch, into which real and virtual network cards get connected. Communication from the physical host to the network goes through a physical NIC, which is plugged into a real switch and onwards.

virtual NIC -> [tap] -> [bridge (virtual switch)] <- [host ethX] -> [rest of the network]

Once you understand how this works, and read up on bridges in general, you'll see that it's all very simple.

To get such a setup to work, all you need is an IP on the bridge (not the physical NIC it is plugged into, but the bridge itself) - which will be the IP the host uses, and an IP in the same network in the VM, with the same subnet and gateways and routes.

smallpond 06-05-2013 11:50 AM

CentOS by default uses NetworkManager to set up ports. If you have a GUI that's the easiest way. If you want to edit the ifcfg-ethX scripts yourself, be sure to include NM_CONTROLLED="no" to prevent NM from having its way with them.

dyasny 06-05-2013 11:54 PM

NM doesn't do bridges

matthekc83 06-11-2013 07:50 PM

I want to try this out when I have some time, but I have been busy with work and other stuff. I am curious if anyone uses this in their production environment?

matthekc83 06-11-2013 08:00 PM

The purpose, usage, and setup on VDE seems to be sparsely documented vs the bridge setup.

All times are GMT -5. The time now is 06:14 AM.