ng_patch and 802.11Q

Bear jilingshu at gmail.com
Mon Nov 11 06:57:57 UTC 2013


Hi Rozhuk,
 > Try:
 > ifconfig re0 -vlanhwtag -vlanhwcsum down up
 > ngctl msg re0: setpromisc 1
I tried that but interestingly, there is still no data captured. Also, I 
still able to send and receive packets from that interface -- I didn't 
lost Internet connectivity.

On 2013/11/11 03:24 AM, rozhuk.im at gmail.com wrote:
>>   > You MAST forward packets lower<->upper by some netgraph nodes.
>>   > If not - OS became unavailable trough this adapter.
>>   > See ng_vlan examples.
>> I just want to see what the packet looks like by that way, no matter if
>> the packet is dropped or not. But I can't see anything by that way :-(
> Try:
> ifconfig re0 -vlanhwtag -vlanhwcsum down up
> ngctl msg re0: setpromisc 1
>
>
>
>>   > It requires to update manual pages, but my English... %) Did you
>> mean the code has already been merged into kernel? I'm running FreeBSD
>> 9.2-RELEASE and it seems  > ngctl name em0:lower:vlan34 ngeth0 and  >
>> ngctl msg em0:lower addfilter '{ vid=34 pcp=4 cfi=1 hook="vlan34" }'
>> return Invalid Argument error... :-(
>>
>> Thanks in advanced :-)
>>
>> On 2013/11/11 03:11 AM, rozhuk.im at gmail.com wrote:
>>>>    > .lower - packets from/to network adapter  > .upper - packets
>>>> from/to OS Yes. But if I try to capture on upper:
>>>>    > nghook -a em0:upper
>>>> I just got nothing...
>>> You MAST forward packets lower<->upper by some netgraph nodes.
>>> If not - OS became unavailable trough this adapter.
>>> See ng_vlan examples.
>>>
>>>>    > http://www.freebsd.org/cgi/query-pr.cgi?pr=161908
>>>> This link is excellent! Seems it has not been merged to kernel yet?
>>> It requires to update manual pages, but my English... %)
>>>
>>>
>>>> On 11/10/2013 7:17 AM, rozhuk.im at gmail.com wrote:
>>>>> http://www.freebsd.org/cgi/query-pr.cgi?pr=161908
>>>>>
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Bear [mailto:jilingshu at gmail.com]
>>>>>> Sent: Saturday, November 09, 2013 11:30 PM
>>>>>> To: Rozhuk.IM at gmail.com; 'Gleb Smirnoff'
>>>>>> Cc: freebsd-net at freebsd.org
>>>>>> Subject: Re: ng_patch and 802.11Q
>>>>>>
>>>>>> Hi Gleb,
>>>>>> I read the script you given but still no clue :-(
>>>>>>
>>>>>> On 2013/11/9 11:09 AM, rozhuk.im at gmail.com wrote:
>>>>>>>
>>>>>>
>>>>
>> http://www.netlab.linkpc.net/download/software/FreeBSD/mcastbridge/mc
>>>>>> as
>>>>>> tbr2.
>>>>>>> sh
>>>>>>> http://www.netlab.linkpc.net/forum/index.php?topic=796.0
>>>>>>>
>>>>>>>
>>>>>>>> It seems a good idea... Do you have some example working on
>>>>>> ng_ether?
>>>>>>>> The manpage of ng_ether seems no example...
>>>>>>>>
>>>>>>>> On 11/8/2013 6:22 PM, Gleb Smirnoff wrote:
>>>>>>>>> On Fri, Nov 08, 2013 at 02:11:49AM -0330, Bear wrote:
>>>>>>>>> B> Hi all,
>>>>>>>>> B> I want to modify VLAN priority by ng_patch. After reading
>> the
>>>>>>>>> B> manpage of
>>>>>>>>> B> ng_patch(http://www.freebsd.org/cgi/man.cgi?query=ng_patch)
>>>> and
>>>>>>>> the
>>>>>>>>> B> example it given:
>>>>>>>>> B>
>>>>>>>>> B>  >  /usr/sbin/ngctl -f- <<-SEQ
>>>>>>>>> B>  > 	 mkpeer ipfw: patch 200 in
>>>>>>>>> B>  > 	 name ipfw:200 ttl_add
>>>>>>>>> B>  > 	 msg ttl_add: setconfig { count=1 csum_flags=1 ops=[
>>>> \
>>>>>>>>> B>  > 		 { mode=2 value=3 length=1 offset=8 } ] }
>>>>>>>>> B>  >  SEQ
>>>>>>>>> B>  >  /sbin/ipfw add 150 netgraph 200 ip from any to
>>>>>>>>> B> simplex.remote.net
>>>>>>>>> B>
>>>>>>>>> B> It seems ng_patch can only modify IP header. However, the
>>>>>>>>> B> position of VLAN header is before IP header and after
>>>>>>>>> B> Ethernet header. How can I modify it?
>>>>>>>>>
>>>>>>>>> ipfw allows you to intercept packets at IP layer. Tp modify
>> VLAN
>>>>>>>>> header, you need to capture them earlier. May be ng_ether(4)
>>>>>>>>> will
>>>>>>>> help you.
>>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>


More information about the freebsd-net mailing list