[ovs-discuss] General Question from Open vSwitch Beginner

Ben Pfaff blp at nicira.com
Wed Mar 16 16:37:44 PDT 2011


On Wed, Mar 16, 2011 at 06:33:42PM -0500, Hugo wrote:
> Experiment 1.
> There is no VM in this experiment. I just install OVS in a debian host
> machine. I follow the instruction in INSTALL.Linux. And I start up
> "ovsdb-server" and "ovs-vswitchd" by executing the commands from
> INSTALL.Linux too. There is no problem at this point. Then I run
> 
> % ovs-vsctl add-br br0
> % ovs-vsctl add-port br0 eth0
> 
> eth0 is the only physical NIC in my host machine, it has the IP address
> assigned, I can access the network from this NIC before. After doing this,
> my host machine will not be able to access the network. My understanding is
> that this actually emulating the real situation that connecting port from a
> physical switch to a physical NIC by a ethernet cable. Then of course, the
> machine could not access the internet.
> However, in the real situation, usually a port from a physical switch can be
> connected to the network through a ethernet cable. And we can go into the
> switch's console to configure the physical switch (such as setup DNS) to
> make it access to the network. I just wondering how can I configure the Open
> vSwitch in any similar way to let it be able to access network?

You can put your IP address on the br0 interface, e.g.:
	ifconfig br0 192.168.0.123
This is the same as what you would have to do with the Linux bridge.

> Experiment 2
> I install a VM in a VirtualBox. Instead of NAT, I choose the Network adapter
> as "Host-Only", and in this way, the Guest VM will connect through a
> interface named "vboxnet0". This "vboxnet0" is network interface from
> VirtualBox. It is visible from ifconfig in my HOST debian machine. I still
> start up "ovsdb-server" and "ovs-vswitchd" by executing the commands from
> INSTALL.Linux. I run (of course, I delete eth0 from br0)
> 
> % ovs-vsctl add-br br0
> % ovs-vsctl add-port br0 vboxnet0
> 
> After doing this, the Virtual VM is not able to access the network. I am
> just wondering what should I do in order to make the VM to be able to access
> the network. Do I have to do some configuration in Guest VM as well as Open
> vSwitch? I think these two experiments are simple, I hope from your answer,
> I can better understand how Open vSwitch works and then I can try scenarioes
> in cookbook.

An Ethernet switch with only one port is not very useful.  If you add
a physical port to the switch, with "ovs-vsctl add-port br0 eth0",
then the VM will be able to access the network through that physical
port.


More information about the discuss mailing list