0

I have installed openvswitch on my PC with runs Ubuntu 12.04.I also have virtual box running on my PC with 3 virtual machines (Ubuntu 12.04) running on them. are named

vm-1
vm-2
vm-3

I have configured the openvswitch on the Host as follows.

sudo ovs-vsctl show

#Create the virtual switch on the host machine
sudo ovs-vsctl add-br lan0

#Next we create tap devices on the host machine so we can bind them to the guests VM's later.
for tap in `seq 1 5`; do
       sudo ip tuntap add mode tap lan0-p$tap
done;

#check if the interfaces are there
ip tuntap list

#Bring up the tap interfaces.
for tap in `seq 1 5`; do
        sudo ip link set lan0-p$tap up
done;

# check if the interface are up
ip link


#Now we use ovs-vsctl to "bind" the tap devices to "lan0" switch
for tap in `seq 1 5`; do
        sudo ovs-vsctl add-port lan0 lan0-p$tap
done;

#see that the tap devices are mapped to ports in lan0
sudo ovs-vsctl list-ports lan0

The output of ifconfig after this operation on the host is as follows.

eth0      Link encap:Ethernet  HWaddr 1c:6f:65:37:60:b5  
          inet addr:192.168.129.56  Bcast:192.168.129.255  Mask:255.255.254.0
          inet6 addr: fe80::1e6f:65ff:fe37:60b5/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:44955 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10042 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:13293545 (13.2 MB)  TX bytes:1978326 (1.9 MB)
          Interrupt:54 Base address:0x8000 

lan0-p1   Link encap:Ethernet  HWaddr 56:66:06:2d:da:ee  
          inet6 addr: fe80::5466:6ff:fe2d:daee/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:676 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lan0-p2   Link encap:Ethernet  HWaddr 06:25:a2:ad:85:58  
          inet6 addr: fe80::425:a2ff:fead:8558/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:676 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lan0-p3   Link encap:Ethernet  HWaddr 52:8e:34:67:a0:40  
          inet6 addr: fe80::508e:34ff:fe67:a040/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:676 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lan0-p4   Link encap:Ethernet  HWaddr 22:6e:e8:62:c5:e8  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lan0-p5   Link encap:Ethernet  HWaddr de:6f:9d:f9:c9:45  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:64 errors:0 dropped:0 overruns:0 frame:0
          TX packets:64 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:4984 (4.9 KB)  TX bytes:4984 (4.9 KB)

Now using Network Settings on each virtual machines in Configured in 'Bridged Adapter' where

vm-1 is attached to lan0-p1
vm-2 is attached to lan0-p2 
vm-3 is attached to lan0-p3

I have installed pox controller running on my HOST pc. I run pox controller to connect to my host PC as follows.

./pox.py log.level --DEBUG forwarding.l2_learning

The output that I get is as follows

POX 0.1.0 (betta) / Copyright 2011-2013 James McCauley, et al.
DEBUG:core:POX 0.1.0 (betta) going up...
DEBUG:core:Running on CPython (2.7.3/Aug 1 2012 05:14:39)
DEBUG:core:Platform is Linux-3.2.0-38-generic-x86_64-with-Ubuntu-12.04-precise
INFO:core:POX 0.1.0 (betta) is up.
DEBUG:openflow.of_01:Listening on 0.0.0.0:6633

It shows listening on 0.0.0.0:6633 ? What is 0.0.0.0 ? 

I would expect output as follows

INFO:openflow.of_01:[Con 1/1] Connected to 00-00-00-00-00-01
DEBUG:forwarding.l2_learning:Connection [Con 1/1]
DEBUG:forwarding.l2_learning:installing flow for 00:00:00:00:00:03.2 ->
00:00:00:00:00:02.1
DEBUG:forwarding.l2_learning:installing flow for 00:00:00:00:00:02.1 ->
00:00:00:00:00:03.2
DEBUG:forwarding.l2_learning:installing flow for 00:00:00:00:00:03.2 ->
00:00:00:00:00:02.1
DEBUG:forwarding.l2_learning:installing flow for 00:00:00:00:00:04.3 ->
00:00:00:00:00:02.1
DEBUG:forwarding.l2_learning:installing flow for 00:00:00:00:00:02.1 ->
00:00:00:00:00:04.3

or something similar where it shows that it is learning the different MAC addresses. I don't seem to be getting that. Am I doing something wrong?

Jeff Ferland
  • 20,239
  • 2
  • 61
  • 85
liv2hak
  • 303
  • 4
  • 13
  • 25

1 Answers1

1

I think you lost the binding address and port for POX. You can try to use the following command:

./pox.py log.level --DEBUG forwarding.l2_learning --address=**your_address** --port=6633
slm
  • 7,355
  • 16
  • 54
  • 72
waynner
  • 26
  • 1