san01a> rdfile /etc/rc #Auto-generated by setup Thu may 22 13:26:59 GMT 2014 hostname san01a ifgrp create lacp vif1 -b ip e0d e0b e0c e0a vlan create vif1 53 ifconfig e0a flowcontrol send up ifconfig e0b flowcontrol send up ifconfig e0c flowcontrol send up ifconfig e0d flowcontrol send up ifconfig e0M `hostname`-e0M netmask 255.255.255.0 broadcast 10.10.10.255 flowcontrol full partner 10.10.40.11 mtusize 1500 trusted wins up ifconfig e0P `hostname`-e0P netmask 255.255.252.0 broadcast 192.168.3.255 flowcontrol full up ifconfig vif1-53 `hostname`-vif1-53 netmask 255.255.255.0 partner vif1-53 mtusize 9000 trusted -wins up ifconfig vif1-53 alias 10.10.53.31 netmask 255.255.255.0 up ifconfig vif1-53 alias 10.10.53.32 netmask 255.255.255.0 up ifconfig vif1-53 alias 10.10.53.33 netmask 255.255.255.0 up route add net default 10.10.10.3 1 routed on options dns.domainname netapp.com options dns.enable on options nis.enable off savecore
san01a> rdfile /etc/hosts #Auto-generated by setup Thu may 22 13:26:59 GMT 2014 127.0.0.1 localhost localhost-stack 127.0.10.1 localhost-10 localhost-bsd 127.0.20.1 localhost-20 localhost-sk 10.10.40.10 san01a san01a-e0M 192.168.1.185 san01a san01a-e0P 10.10.53.30 san01a-vif1-53
san01a> exportfs /vol/vol_filerA_nfsA -sec=sys,rw,nosuid /vol/vol_filerA_nfsB -sec=sys,rw,nosuid /vol/vol_filerA_nfsC -sec=sys,rw,nosuid /vol/vol_filerA_nfsD -sec=sys,rw,nosuid
san01a> qtree status Volume Tree Style Oplocks Status -------- -------- ----- -------- --------- rootvol unix enabled normal vol_filerA_nfsA unix enabled normal vol_filerA_nfsA qtree_filerA_nfsA unix enabled normal vol_filerA_nfsB unix enabled normal vol_filerA_nfsB qtree_filerA_nfsB unix enabled normal vol_filerA_nfsC unix enabled normal vol_filerA_nfsC qtree_filerA_nfsC unix enabled normal vol_filerA_nfsD unix enabled normal vol_filerA_nfsD qtree_filerA_nfsD unix enabled normal
ds_filerA_nfsA 10.10.53.30:/vol/vol_filerA_nfsA/qtree_filerA_nfsA ds_filerA_nfsB 10.10.53.31:/vol/vol_filerA_nfsB/qtree_filerA_nfsB ds_filerA_nfsC 10.10.53.32:/vol/vol_filerA_nfsC/qtree_filerA_nfsC ds_filerA_nfsD 10.10.53.33:/vol/vol_filerA_nfsD/qtree_filerA_nfsD
san01a> ifgrp stat vif1 10 Interface group(trunk) vif1 e0b e0a e0c e0d Pkts In Pkts Out Pkts In Pkts Out Pkts In Pkts Out Pkts In Pkts Out 14225k 13673k 15542k 249k 13838k 11690k 15544k 7809k 46075 38052 90911 7 45882 37666 90812 37704 46953 37735 91581 4 46506 37613 91777 37625 46822 38016 91409 7 45498 37589 91670 37687 46906 38046 91514 6 45469 37591 91495 37588 46600 37737 91308 4 46554 37538 91514 37610 46792 37929 91371 7 45803 37532 91261 37508 46845 37831 91228 8 46307 37517 91450 37587
san01a> ifstat -a -- interface e0a (3 hours, 30 minutes, 53 seconds) -- RECEIVE Frames/second: 9147 | Bytes/second: 916k | Errors/minute: 0 Discards/minute: 0 | Total frames: 16347k | Total bytes: 73753m Total errors: 0 | Total discards: 0 | Multi/broadcast: 0 No buffers: 0 | Non-primary u/c: 0 | Tag drop: 0 Vlan tag drop: 0 | Vlan untag drop: 0 | Vlan forwards: 0 Vlan broadcasts: 0 | Vlan unicasts: 0 | CRC errors: 0 Runt frames: 0 | Fragment: 0 | Long frames: 0 Jabber: 0 | Alignment errors: 0 | Bus overruns: 0 Xon: 0 | Xoff: 0 | Jumbo: 8359k TRANSMIT Frames/second: 1 | Bytes/second: 87 | Errors/minute: 0 Discards/minute: 0 | Total frames: 249k | Total bytes: 7674m Total errors: 0 | Total discards: 0 | Multi/broadcast: 1006 Queue overflows: 0 | No buffers: 0 | Max collisions: 0 Single collision: 0 | Multi collisions: 0 | Late collisions: 0 Xon: 0 | Xoff: 0 | Jumbo: 239k LINK_INFO Current state: up | Up to downs: 2 | Speed: 1000m Duplex: full | Flowcontrol: none -- interface e0b (3 hours, 30 minutes, 53 seconds) -- RECEIVE Frames/second: 4678 | Bytes/second: 467k | Errors/minute: 0 Discards/minute: 0 | Total frames: 14637k | Total bytes: 73533m Total errors: 0 | Total discards: 0 | Multi/broadcast: 0 No buffers: 0 | Non-primary u/c: 0 | Tag drop: 0 Vlan tag drop: 0 | Vlan untag drop: 0 | Vlan forwards: 0 Vlan broadcasts: 0 | Vlan unicasts: 0 | CRC errors: 0 Runt frames: 0 | Fragment: 0 | Long frames: 0 Jabber: 0 | Alignment errors: 0 | Bus overruns: 0 Xon: 0 | Xoff: 0 | Jumbo: 8352k TRANSMIT Frames/second: 3773 | Bytes/second: 123m | Errors/minute: 0 Discards/minute: 0 | Total frames: 14007k | Total bytes: 57209m Total errors: 0 | Total discards: 1 | Multi/broadcast: 1531 Queue overflows: 1 | No buffers: 0 | Max collisions: 0 Single collision: 0 | Multi collisions: 0 | Late collisions: 0 Xon: 0 | Xoff: 0 | Jumbo: 2756k LINK_INFO Current state: up | Up to downs: 2 | Speed: 1000m Duplex: full | Flowcontrol: none -- interface e0c (3 hours, 30 minutes, 53 seconds) -- RECEIVE Frames/second: 4630 | Bytes/second: 461k | Errors/minute: 0 Discards/minute: 0 | Total frames: 14243k | Total bytes: 69574m Total errors: 0 | Total discards: 0 | Multi/broadcast: 0 No buffers: 0 | Non-primary u/c: 0 | Tag drop: 0 Vlan tag drop: 0 | Vlan untag drop: 0 | Vlan forwards: 0 Vlan broadcasts: 0 | Vlan unicasts: 0 | CRC errors: 0 Runt frames: 0 | Fragment: 0 | Long frames: 0 Jabber: 0 | Alignment errors: 0 | Bus overruns: 0 Xon: 0 | Xoff: 0 | Jumbo: 7800k TRANSMIT Frames/second: 3756 | Bytes/second: 123m | Errors/minute: 0 Discards/minute: 0 | Total frames: 12022k | Total bytes: 189g Total errors: 0 | Total discards: 0 | Multi/broadcast: 1003 Queue overflows: 0 | No buffers: 0 | Max collisions: 0 Single collision: 0 | Multi collisions: 0 | Late collisions: 0 Xon: 0 | Xoff: 0 | Jumbo: 6283k LINK_INFO Current state: up | Up to downs: 2 | Speed: 1000m Duplex: full | Flowcontrol: none -- interface e0d (3 hours, 30 minutes, 53 seconds) -- RECEIVE Frames/second: 9127 | Bytes/second: 915k | Errors/minute: 0 Discards/minute: 0 | Total frames: 16349k | Total bytes: 73554m Total errors: 0 | Total discards: 0 | Multi/broadcast: 0 No buffers: 0 | Non-primary u/c: 0 | Tag drop: 0 Vlan tag drop: 0 | Vlan untag drop: 0 | Vlan forwards: 0 Vlan broadcasts: 0 | Vlan unicasts: 0 | CRC errors: 0 Runt frames: 0 | Fragment: 0 | Long frames: 0 Jabber: 0 | Alignment errors: 0 | Bus overruns: 0 Xon: 0 | Xoff: 0 | Jumbo: 8339k TRANSMIT Frames/second: 3748 | Bytes/second: 123m | Errors/minute: 0 Discards/minute: 0 | Total frames: 8140k | Total bytes: 62385m Total errors: 0 | Total discards: 0 | Multi/broadcast: 1213 Queue overflows: 0 | No buffers: 0 | Max collisions: 0 Single collision: 0 | Multi collisions: 0 | Late collisions: 0 Xon: 0 | Xoff: 0 | Jumbo: 2413k LINK_INFO Current state: up | Up to downs: 2 | Speed: 1000m Duplex: full | Flowcontrol: none
system mtu 9198 ! spanning-tree mode rapid-pvst ! interface Port-channel1 description N1A-1G-e0a-e0b switchport trunk native vlan 1 switchport trunk allowed vlan 53 switchport mode trunk flowcontrol receive on spanning-tree guard loop ! interface Port-channel2 description N1B-1G-e0a-e0b switchport trunk native vlan 1 switchport trunk allowed vlan 53 switchport mode trunk flowcontrol receive on spanning-tree guard loop ! interface GigabitEthernet1/0/1 description NetApp-A-e0a switchport trunk native vlan 1 switchport trunk allowed vlan 53 switchport mode trunk flowcontrol receive on cdp enable channel-group 1 mode active spanning-tree guard loop spanning-tree portfast trunk feature ! interface GigabitEthernet2/0/1 description NetApp-A-e0b switchport trunk native vlan 1 switchport trunk allowed vlan 53 switchport mode trunk flowcontrol receive on cdp enable channel-group 1 mode active spanning-tree guard loop spanning-tree portfast trunk feature ! interface GigabitEthernet1/0/2 description NetApp-B-e0a switchport trunk native vlan 1 switchport trunk allowed vlan 53 switchport mode trunk flowcontrol receive on cdp enable channel-group 2 mode active spanning-tree guard loop spanning-tree portfast trunk feature ! interface GigabitEthernet2/0/2 description NetApp-B-e0b switchport trunk native vlan 1 switchport trunk allowed vlan 53 switchport mode trunk flowcontrol receive on cdp enable channel-group 2 mode active spanning-tree guard loop spanning-tree portfast trunk feature
! For Cisco IOS Release 12.2(33)SXI and later releases system mtu 9198 ! spanning-tree mode rapid-pvst ! interface Port-channel1 description N1A-1G-e0a-e0b switchport switchport trunk native vlan 1 switchport trunk allowed vlan 53 switchport mode trunk flowcontrol receive on spanning-tree guard loop end ! interface Port-channel2 description N1B-1G-e0a-e0b switchport switchport trunk native vlan 1 switchport trunk allowed vlan 53 switchport mode trunk flowcontrol receive on spanning-tree guard loop end ! interface GigabitEthernet1/0/1 description NetApp-A-e0a switchport switchport trunk native vlan 1 switchport trunk allowed vlan 53 switchport mode trunk flowcontrol receive on cdp enable channel-group 1 mode active spanning-tree guard loop spanning-tree portfast edge trunk end ! interface GigabitEthernet2/0/1 description NetApp-A-e0b switchport switchport trunk native vlan 1 switchport trunk allowed vlan 53 switchport mode trunk flowcontrol receive on cdp enable channel-group 1 mode active spanning-tree guard loop spanning-tree portfast edge trunk end ! interface GigabitEthernet1/0/2 description NetApp-B-e0a switchport switchport trunk native vlan 1 switchport trunk allowed vlan 53 switchport mode trunk flowcontrol receive on cdp enable channel-group 2 mode active spanning-tree guard loop spanning-tree portfast edge trunk end ! interface GigabitEthernet2/0/2 description NetApp-B-e0b switchport switchport trunk native vlan 1 switchport trunk allowed vlan 53 switchport mode trunk flowcontrol receive on cdp enable channel-group 2 mode active spanning-tree guard loop spanning-tree portfast edge trunk end
system mtu 9198 ! spanning-tree mode rapid-pvst ! interface Port-channel11 description NetApp-A-e0a-e0b switchport trunk native vlan 1 switchport trunk allowed vlan 53 switchport mode trunk flowcontrol receive on spanning-tree guard loop spanning-tree portfast trunk feature ! interface Port-channel12 description NetApp-B-e0a-e0b switchport trunk native vlan 1 switchport trunk allowed vlan 53 switchport mode trunk flowcontrol receive on spanning-tree guard loop spanning-tree portfast trunk feature ! interface GigabitEthernet1/0/1 description NetApp-A-e0a switchport trunk encapsulation dot1q switchport trunk native vlan 1 switchport trunk allowed vlan 53 switchport mode trunk flowcontrol receive on cdp enable channel-group 11 mode active spanning-tree guard loop spanning-tree portfast trunk feature ! interface GigabitEthernet2/0/1 description NetApp-A-e0b switchport trunk encapsulation dot1q switchport trunk native vlan 1 switchport trunk allowed vlan 53 switchport mode trunk flowcontrol receive on cdp enable channel-group 11 mode active spanning-tree guard loop spanning-tree portfast trunk feature ! interface GigabitEthernet1/0/2 description NetApp-B-e0a switchport trunk encapsulation dot1q switchport trunk native vlan 1 switchport trunk allowed vlan 53 switchport mode trunk flowcontrol receive on cdp enable channel-group 12 mode active spanning-tree guard loop spanning-tree portfast trunk feature ! interface GigabitEthernet2/0/2 description NetApp-B-e0b switchport trunk encapsulation dot1q switchport trunk native vlan 1 switchport trunk allowed vlan 53 switchport mode trunk flowcontrol receive on cdp enable channel-group 12 mode active spanning-tree guard loop spanning-tree portfast trunk feature
interface Port-channel1 description N1A-10G-e1a-e1b spanning-tree ddportfast switchport trunk allowed vlan add 53 macro description host !next command is internal. macro auto smartport dynamic_type host flowcontrol off ! interface Port-channel2 description N1B-10G-e1a-e1b spanning-tree ddportfast switchport trunk allowed vlan add 53 macro description host !next command is internal. macro auto smartport dynamic_type host flowcontrol off ! port jumbo-frame ! interface tengigabitethernet1/1/1 description NetApp-A-e1a channel-group 1 mode active flowcontrol off ! interface tengigabitethernet2/1/1 description NetApp-A-e1b channel-group 1 mode active flowcontrol off ! interface tengigabitethernet1/1/2 description NetApp-B-e1a channel-group 2 mode active flowcontrol off ! interface tengigabitethernet2/1/2 description NetApp-B-e1b channel-group 2 mode active flowcontrol off
# HP 6120XG from HP c7000 10Gb/s trunk 17-18 Trk1 LACP trunk 19-20 Trk2 LACP vlan 201 name "N1AB-10G-e1a-e1b-201" ip address 192.168.201.222 255.255.255.0 tagged Trk1-Trk2 jumbo exit vlan 202 name "N1AB-10G-e1a-e1b-202" tagged Trk1-Trk2 no ip address jumbo exit spanning-tree force-version rstp-operation
Rx Tx Port Mode | ------------------------- | ------------------------- | Kbits/sec Pkts/sec Util | Kbits/sec Pkts/sec Util ------- --------- + ---------- --------- ---- + ---------- ---------- --- 1/11-Trk10 1000FDx| 5000 0 00.50 | 23088 7591 02.30 1/12-Trk10 1000FDx| 814232 12453 81.42 | 19576 3979 01.95 2/11-Trk10 1000FDx| 810920 12276 81.09 | 20528 3938 02.05 2/12-Trk10 1000FDx| 811232 12280 81.12 | 23024 7596 02.30 1/17-Trk22 1000FDx| 23000 7594 02.30 | 810848 12275 81.08 1/18-Trk22 1000FDx| 23072 7592 02.30 | 410320 6242 41.03 2/17-Trk22 1000FDx| 19504 3982 01.95 | 408952 6235 40.89 2/18-Trk22 1000FDx| 20544 3940 02.05 | 811184 12281 81.11
#include <stdio.h> int debug = 0; void f_shiftL(int *r, int step, int i, int offset) { r[step] = r[i] << offset; if (debug > 0) { printf("\nStep %i Left Shift %i %i\n", step, i, offset); printf("\t%i << %i\n", r[i], offset); printf("\t%i\n", r[step]); } } void f_shiftR(int *r, int step, int i, int offset) { r[step] = r[i] >> offset; if (debug > 0) { printf("\nStep %i Right Shift %i %i\n", step, i, offset); printf("\t%i\n", r[i]); printf("\t%i\n", r[step]); } } void f_xor(int *r, int step, int i, int j) { r[step] = r[i] ^ r[j]; if (debug > 0) { printf("\nStep %i XOR %i %i\n", step, i, j); printf("\t%i\n", r[i]); printf("\t%i\n", r[j]); printf("\t%i\n", r[step]); } } void f_sum(int *r, int step, int i, int j) { r[step] = r[i] + r[j]; if (debug > 0) { printf("\nStep %i ADD %i %i\n", step, i, j); printf("\t%i\n", r[i]); printf("\t%i\n", r[j]); printf("\t%i\n", r[step]); } } int balance_ip_netapp (int net, int src, int dst, int link_cnt) { int res[30]; res[0] = net*256 + src; res[1] = net*256 + dst; //printf ("a = %i.%i (%i)\n", net, src, res[0]); //printf ("b = %i.%i (%i)\n", net, dst, res[1]); f_shiftL(res, 2, 1,11); f_xor (res, 3, 0, 2); f_shiftL(res, 4, 0,16); f_xor (res, 5, 3, 4); f_shiftR(res, 6, 5,11); f_sum (res, 7, 5, 6); f_shiftL(res,15, 7, 3); f_xor (res,16, 7,15); f_shiftR(res,17,16, 5); f_sum (res,18,16,17); f_shiftL(res,19,18, 4); f_xor (res,20,18,19); f_shiftR(res,21,20,17); f_sum (res,22,20,21); f_shiftL(res,23,22,25); f_xor (res,24,22,23); f_shiftR(res,25,24, 6); f_sum (res,26,24,25); res[27] = res[26] % link_cnt; if (res[27] < 0) { res[27] = res[27] + link_cnt; } printf ("%i.%i -> %i, %i\n", net, src, dst, res[27]); return 0; } int main() { int src, dst, interface; // interface = 4; printf ("IP Octet3.IP Octet4 Source -> IP Octet4 Destination, Interface\n"); // destination IP ( 21 23) for (src=21; src<=23; src++) { // source IP ( 30 250) for (dst=30; dst<=250; dst++) { // IP ( 52 53) balance_ip_netapp(52, dst, src, interface ); balance_ip_netapp(53, dst, src, interface ); } } }
Source: https://habr.com/ru/post/215351/
All Articles