[ovs-discuss] Still some question for a beginner on working VBox with Open vSwitch

Hugo hugolin615 at gmail.com
Fri Apr 1 20:01:19 UTC 2011


Hi, Everyone,

As suggested, I repeated the experiment with some modification. FYI, I
describe it here.
I install a VM in a VirtualBox. I use the command “VBoxTunctl” from
VirtualBox to set up a tap device. (So by typing ifconfig -a, you will see a
device named "tap0".) Instead of NAT, I choose the Network adapter setting
as "bridged", and in this way, the Guest VM will connect through a interface
named "tap0". I still start up "ovsdb-server" and "ovs-vswitchd" by
executing the default commands from INSTALL.Linux. I have installed the br0
and assign a ip address to it. And I attach the eth0 to br0 and assign no IP
to eth0. The host machine could access the internet now. And then
% ifconfig tap0 0.0.0.0 up
 % ovs-vsctl add-br br0
 % ovs-vsctl add-port br0 tap0

And I start up the VM in VitualBox. But the result is that VM could not
access the internet. There is no ip address assigned to eth0 within the VM
either. So I am still confused about how to connect the VM to the internet
in this way. Is there any setup needs to be done within the VM or on the
Host machine?

Best,

Hugo

On Thu, Mar 17, 2011 at 3:45 PM, Hugo <hugolin615 at gmail.com> wrote:

> Hi, I make my experiment 1 works, however in a different way.
>
> I set up the eth0 into NULL directly. But it is still not working.
> I find that it is due to my network or system configuration. If I manually
> ifconfig eth0 down and then ifconfig eth0 up, I can not access the internet.
> So I change the network here to make the machine dhcp to get ip address.
> Then after I set eth0 to NULL, I dhclient br0 and then I can access the
> internet now.
>
> I will continue to my second experiment.
>
> Thanks
>
>
> On Thu, Mar 17, 2011 at 9:29 AM, Ben Pfaff <blp at nicira.com> wrote:
>
>> You have to remove the IP address from eth0, e.g. "ifconfig eth0 0.0.0.0".
>>
>> On Thu, Mar 17, 2011 at 12:23:25AM -0500, Hugo wrote:
>> > Hi,
>> >
>> > I redo the experiment 1 based on your suggestion. My eth0 has an IP
>> address
>> > assigned to it. After I attach eth0 to the bridge, i.e br0, the MAC of
>> br0
>> > and eth0 become the same. And I try to assign the same IP address or
>> > different IP address to br0, in both situation,  eth0 still has its IP
>> > address and in the "up" status. Even I try to use ifconfig to shutdown
>> eth0
>> > and reboot eth0, it still has its own IP address. Of course, I could not
>> > access the network in this situation. Is there anything wrong on this
>> > setup?
>> >
>> > Best,
>> > Hugo
>> >
>> > On Wed, Mar 16, 2011 at 6:37 PM, Ben Pfaff <blp at nicira.com> wrote:
>> >
>> > > 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.
>> > >
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openvswitch.org/pipermail/ovs-discuss/attachments/20110401/f113615c/attachment.html>


More information about the discuss mailing list