i giveup the vlan , change to openflow , i changed the vif script in
/usr/lib/xcp/script/ add a function like that:

handle_openflow_script() {

    local action=$1
    local domid=$2
    local devid=$3

    local MACID=$(ovs-vsctl get interface vif${domid}.${devid}
external_ids:attached-mac)
    local OFPORT=$(ovs-vsctl get interface vif${domid}.${devid} ofport)
    MACID="${MACID%\"}"
    MACID="${MACID#\"}"
    echo "$action domid $domid devid $devid macid $MACID ofport $OFPORT" >>
/root/odp-base.txt

    case "$action" in
    online|move)

        #icmp
        ret=$(ovs-ofctl add-flow xenbr1
in_port=${OFPORT},dl_type=0x0800,nw_proto=1,dl_src=${MACID},priority=2,idle_timeout=0,action=normal)
        #tcp
        ret=$(ovs-ofctl add-flow xenbr1
in_port=${OFPORT},dl_type=0x0800,nw_proto=6,dl_src=${MACID},priority=2,idle_timeout=0,action=normal)
        #udp
        ret=$(ovs-ofctl add-flow xenbr1
in_port=${OFPORT},dl_type=0x0800,nw_proto=17,dl_src=${MACID},priority=2,idle_timeout=0,action=normal)
        #arp
        ret=$(ovs-ofctl add-flow xenbr1
in_port=${OFPORT},dl_type=0x0806,dl_src=${MACID},priority=2,idle_timeout=0,action=normal)

        #other output from this port drop
        ret=$(ovs-ofctl add-flow xenbr1
in_port=${OFPORT},priority=1,idle_timeout=0,action=drop)

        #icmp
        ret=$(ovs-ofctl add-flow xenbr1
in_port=1,dl_type=0x0800,nw_proto=1,dl_dst=${MACID},priority=4,idle_timeout=0,action=normal)
        #tcp
        ret=$(ovs-ofctl add-flow xenbr1
in_port=1,dl_type=0x0800,nw_proto=6,dl_dst=${MACID},priority=4,idle_timeout=0,action=normal)
        #udp
        ret=$(ovs-ofctl add-flow xenbr1
in_port=1,dl_type=0x0800,nw_proto=17,dl_dst=${MACID},priority=4,idle_timeout=0,action=normal)
        #arp
        ret=$(ovs-ofctl add-flow xenbr1
in_port=1,dl_type=0x0806,dl_dst=${MACID},priority=4,idle_timeout=0,action=normal)

        #other input from this port drop
        ret=$(ovs-ofctl add-flow xenbr1
in_port=1,priority=3,idle_timeout=0,action=drop)

        ;;

    remove|offline)

        ret=$(ovs-ofctl del-flows xenbr1 in_port=${OFPORT})

        ret=$(ovs-ofctl del-flows xenbr1 in_port=1,dl_dst=${MACID})

        ;;

    esac
}


and anytime when vm start or reboot or shutdown, it will be called.



On Tue, Jun 19, 2012 at 5:16 PM, pf shineyear <[email protected]> wrote:

> still have this problem, alway recive this:
>
> in_port(3),eth(src=96:c6:d0:5a:28:30,dst=33:33:00:00:00:02),eth_type(0x86dd),ipv6(src=fe80::94c6:d0ff:fe5a:2830,dst=ff02::2,label=0,proto=58,tclass=0,hlimit=255,frag=no),icmpv6(type=133,code=0),
> packets:2, bytes:140, used:2.880s,
> actions:push_vlan(vid=3003,pcp=0),0,pop_vlan,2,push_vlan(vid=3003,pcp=0),1
>
>
>
>
>
> On Tue, Jun 12, 2012 at 1:42 PM, pf shineyear <[email protected]> wrote:
>
>> i think it could be the intel 82576 drive problem,
>> https://forums.citrix.com/thread.jspa?threadID=280048&start=0&tstart=135
>>
>> i can not follow the post thread because it's use xenserver and all
>> upgrade package is for xenserver,
>>
>> i use ubuntu 12.04 with xcp , not fit for, so,
>>
>> i try to upgrade igb to newest version , 3.4.7 but still not work with
>> vlan tag.
>>
>>
>> On Mon, Jun 11, 2012 at 1:11 PM, pf shineyear <[email protected]> wrote:
>>
>>> i just want to diff vm use diff vlan, why it's so difficult~~
>>>
>>>
>>> On Mon, Jun 11, 2012 at 1:09 PM, pf shineyear <[email protected]> wrote:
>>>
>>>> i think maybe im wrong?
>>>>
>>>> the xe network-create and xe vlan-create is only for xcp bridge mode??
>>>>
>>>> if i use openvswitch i should only use ovs tool to add vlan config??
>>>>
>>>> what should i do ?
>>>>
>>>>
>>>> On Mon, Jun 11, 2012 at 12:48 PM, pf shineyear <[email protected]>wrote:
>>>>
>>>>> hi all ,
>>>>>
>>>>> i use ubuntu 12.04 with xcp , all config run very well except vlan
>>>>>
>>>>> i use xe network-create and xe vlan-create to build vlan 3000
>>>>>
>>>>> then startup a vm in this network, xapi0 fakebridge and vif1.0 all
>>>>> looks well,
>>>>>
>>>>> use ovs-vsctl list port i can see xapi0 and vif1.0 have beed taged
>>>>> with 3000
>>>>>
>>>>> but i can not access the internent~~~
>>>>>
>>>>> somebody can help me with this?
>>>>>
>>>>> thanks.
>>>>>
>>>>
>>>>
>>>
>>
>
_______________________________________________
Xen-api mailing list
[email protected]
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api

Reply via email to