[ovs-discuss] libvirt and openvswitch

Yaron Illouz yaroni at radcom.com
Thu Jan 22 10:41:58 UTC 2015


Hi

 

I am trying to create an openvswitch using libvirt and to use a virtual
network - I mean not the physical one my computer is connected to.

I want the vm to receive  an ip in the range .168.100.2,192.168.100.220

Is it possible to do that?

 

I think it doesn't work because of the dhcp not working

 

I defined a network 

 

    <network>

      <name>private</name>

      <bridge name='virbr0'/>

              <forward mode='bridge'/>

      <virtualport type='openvswitch'/>

    </network>

 

I defined an ip address to virbr0 

ip addr add 192.168.100.2 dev virbr0

ip link set virbr0 up

 

I tried to launch a process to enable a dhcp

/usr/sbin/dnsmasq --strict-order --bind-interfaces --interface=eth2
--listen-address 192.168.100.1 --dhcp-range
192.168.100.2,192.168.100.220 --dhcp-lease-max=101 --dhcp-no-override

But it didn't help

 

But get no ip for the ovs port when I launch the instance. 

 

    ci-info: +++++++++++++++++++++++++Net device
info++++++++++++++++++++++++++

    ci-info:
+--------+------+--------------+-------------+-------------------+

    ci-info: | Device |  Up  |   Address    |     Mask    |
Hw-Address    |

    ci-info:
+--------+------+--------------+-------------+-------------------+

    ci-info: |   lo   | True |  127.0.0.1   |  255.0.0.0  |         .
|

    ci-info: |  eth1  | True |      .       |      .      |
52:54:00:24:16:29 |

    ci-info: |  eth0  | True | 172.16.5.136 | 255.255.0.0 |
52:54:00:44:01:28 |

 

 

In the bridge port vnet1 get assigned to virbr0

 

    Bridge "virbr0"

        Port "virbr0"

            Interface "virbr0"

                type: internal

        Port "vnet1"

            Interface "vnet1"

 

I also tried to add-port a real interface to virbr0, but it made no
change. No cable is connected to this  interface.

 

And i launch the instance the following way

 

     virt-install --name probe9 --ram 4096 --vcpus=4 --check-cpu
--os-type=linux --import --disk
/data/KVM/Probe2-cloud3.qcow2,format=qcow2 --network network=ext
--network network=private --graphics vnc,listen=0.0.0.0 --noautoconsole
--disk vol=default/configuration2.iso,bus=virtio


 

 

I did a tcpdump of vnet1 and it look like

 

05:14:27.843753 IP (tos 0x10, ttl 128, id 0, offset 0, flags [none],
proto UDP (17), length 332)

    0.0.0.0.bootpc > 255.255.255.255.bootps: [udp sum ok] BOOTP/DHCP,
Request from 52:54:00:3f:08:13 (oui Unknown), length 304, xid
0x4726ff0c, secs 7, Flags [none] (0x0000)

          Client-Ethernet-Address 52:54:00:3f:08:13 (oui Unknown)

          Vendor-rfc1048 Extensions

            Magic Cookie 0x63825363

            DHCP-Message Option 53, length 1: Discover

            Parameter-Request Option 55, length 13:

              Subnet-Mask, BR, Time-Zone, Classless-Static-Route

              Domain-Name, Domain-Name-Server, Hostname, YD

              YS, NTP, MTU, Option 119

              Default-Gateway

            Vendor-Class Option 60, length 43: "anaconda-Linux
2.6.32-431.el6.x86_64 x86_64"

05:14:27.931015 IP6 (hlim 1, next-header Options (0) payload length: 36)
fe80::5054:ff:fe3f:813 > ff02::16: HBH (rtalert: 0x0000) (padn)[icmp6
sum ok] ICMP6, multicast listener report v2, length 28, 1 group
record(s) [gaddr ff02::1:ff3f:813 to_ex { }]

05:14:30.963975 IP6 (hlim 255, next-header ICMPv6 (58) payload length:
16) fe80::5054:ff:fe3f:813 > ff02::2: [icmp6 sum ok] ICMP6, router
solicitation, length 16

          source link-address option (1), length 8 (1):
52:54:00:3f:08:13

            0x0000:  5254 003f 0813

05:14:40.850652 IP (tos 0x10, ttl 128, id 0, offset 0, flags [none],
proto UDP (17), length 332)

    0.0.0.0.bootpc > 255.255.255.255.bootps: [udp sum ok] BOOTP/DHCP,
Request from 52:54:00:3f:08:13 (oui Unknown), length 304, xid
0x4726ff0c, secs 20, Flags [none] (0x0000)

          Client-Ethernet-Address 52:54:00:3f:08:13 (oui Unknown)

          Vendor-rfc1048 Extensions

            Magic Cookie 0x63825363

            DHCP-Message Option 53, length 1: Discover

            Parameter-Request Option 55, length 13:

              Subnet-Mask, BR, Time-Zone, Classless-Static-Route

              Domain-Name, Domain-Name-Server, Hostname, YD

              YS, NTP, MTU, Option 119

              Default-Gateway

            Vendor-Class Option 60, length 43: "anaconda-Linux
2.6.32-431.el6.x86_64 x86_64"

05:14:54.851632 IP (tos 0x10, ttl 128, id 0, offset 0, flags [none],
proto UDP (17), length 332)

    0.0.0.0.bootpc > 255.255.255.255.bootps: [udp sum ok] BOOTP/DHCP,
Request from 52:54:00:3f:08:13 (oui Unknown), length 304, xid
0x4726ff0c, secs 34, Flags [none] (0x0000)

          Client-Ethernet-Address 52:54:00:3f:08:13 (oui Unknown)

          Vendor-rfc1048 Extensions

            Magic Cookie 0x63825363

            DHCP-Message Option 53, length 1: Discover

            Parameter-Request Option 55, length 13:

              Subnet-Mask, BR, Time-Zone, Classless-Static-Route

              Domain-Name, Domain-Name-Server, Hostname, YD

              YS, NTP, MTU, Option 119

              Default-Gateway

            Vendor-Class Option 60

 

 

 

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openvswitch.org/pipermail/ovs-discuss/attachments/20150122/0b93893a/attachment-0002.html>


More information about the discuss mailing list