Sniffing VLANs from the SEA adapter

General Discussions.

Sniffing VLANs from the SEA adapter

Postby Steve » Fri Aug 05, 2011 3:52 pm

Have you ever tried to diagnose a VLAN related issue on a VIO server and tried to find out if a particulare VLAN tag is being seen by the VIO servers SEA adapter?

This little piece of code will be most helpful to you!!


Bring the SEA adapter up so you can see the packets it is bridging:
ifconfig en4 up

Using tcpdump and this magic piece of perl:
tcpdump -nX -i en4 vlan and ether dst 01:00:0c:cc:cc:cd | perl -ne '$t=time();$st||=$t;if (/0x0000:?\s+.(...)/) { $h=hex($1);if (!$d{$h}) {$d{$h}=1;printf STDERR "%5d VLANs: %s\n",($t-$st),join(",",sort {$a<=>$b} keys %d);}}'

You will get some output like this, which are all the VLANs you SEA adapter is bridging:
1 VLANs: 140,142,210,224,227,315,318,319,321,324

When finished, bring the SEA adapter to a detached state.
ifconfig en4 detach
Steve
 
Posts: 25
Joined: Fri Mar 25, 2011 1:00 pm

Return to General Discussions

Who is online

Users browsing this forum: No registered users and 1 guest

cron