Steve's Power Systems BlogPower BlogContactLog inRegister
  • Power Blog
  • Contact

  • Register

IBM Power Systems Blog

Power Systems
  • Front Page
  • Categories
  • Archives
  • Latest comments
  • « Show the last cluster start, stop and fail-over date and time
  • AIX and VIO Server readvgda »

Reading VLANs from the SEA Adapter

Posted by steve on 05 Aug 2011 in VIO Server Tips

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.  I know this works with Cisco switches, please leave a comment if this works with other switches.  Thanks.

 

Set the SEA Variable

SEA=en4

 

Bring the SEA adapter up so you can see the packets on the SEA adapter.

ifconfig ${SEA} up

 

Using tcpdump and perl:

tcpdump -nX -i ${SEA} 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);}}'

 

These tcpdump and perl commands are better and more reliable.

tcpdump -i ${SEA} -xx ether multicast | perl -e '$st=time();while () { if (/^\s+0x[0-9a-f]+:\s+(.*)/) {$s.=$1;$s=~s/\s+//g; next; }($h,$s)=($s,"");if ($h =~ /.{24}(.{4})(....).{22}(....)/) { $n=1;$v=$3;if ($1 eq "8100") {$v=$2;$n=0;} $v=hex($v)&0xfff; $h{$v.($n?"(n)":"")}=$n; }$l=join(",",sort {$a<=>$b} keys %h);if ($ol ne $l) { $ol=$l;printf "%3d: Vlans: %s\n",time()-$st,$l; } }'

 

You will get some output like this, which are all the VLANs your SEA adapter sees from the switch ports:

1 VLANs: 140,142,210,224,227,315,318,319,321,324

 

When finished, bring the SEA adapter to a detached state.

ifconfig ${SEA} detach

 

Tags: SEASEA AdapterVIO ServerVIOSVLANtcpdump

4 comments

User ratings
5 star:
 
(1)
4 star:
 
(0)
3 star:
 
(0)
2 star:
 
(0)
1 star:
 
(0)
1 rating
Average user rating:
(5.0)

Comment from: steve Member


Fatal error: Uncaught Error: Call to undefined function finfo_open() in /home4/capacity/public_html/AIX_Blog/inc/files/model/_file.funcs.php:379 Stack trace: #0 /home4/capacity/public_html/AIX_Blog/inc/files/model/_file.funcs.php(405): is_image_file('/home4/capacity...') #1 /home4/capacity/public_html/AIX_Blog/inc/files/model/_file.class.php(1019): imgsize('/home4/capacity...', 'widthheight') #2 /home4/capacity/public_html/AIX_Blog/inc/files/model/_file.class.php(1037): File->load_lastmod_ts() #3 /home4/capacity/public_html/AIX_Blog/inc/files/model/_file.class.php(2499): File->get_lastmod_ts() #4 /home4/capacity/public_html/AIX_Blog/inc/files/model/_file.class.php(2715): File->get_thumb_url('crop-top-64x64', '&', 1) #5 /home4/capacity/public_html/AIX_Blog/inc/files/model/_file.class.php(2558): File->get_img_attribs('crop-top-64x64', '', NULL, 1, NULL) #6 /home4/capacity/public_html/AIX_Blog/inc/users/model/_user.class.php(5244): File->get_thumb_imgtag('crop-top-64x64', 'bCommentAvatar', '', '', NULL) #7 /home4/capacity/pu in /home4/capacity/public_html/AIX_Blog/inc/files/model/_file.funcs.php on line 379