sanghoshin | a0934b7 | 2015-02-26 11:25:07 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | |
| 4 | #all the address in this for loop should work |
| 5 | |
| 6 | # ping test between as2 and as3 |
| 7 | for ((i=0;i<10;i++)); do |
| 8 | |
| 9 | #echo '------from 3.0.0.x to 4.0.1.'$j'------' |
| 10 | |
| 11 | for ((j=0; j<10; ++j )) ; do |
| 12 | echo '3.0.'$i'.1 -> 4.0.'$j'.1' |
| 13 | ping -c 1 -w 1 -I 3.0.$i.1 4.0.$j.1 | grep 'from 4.0.'$j'.1' |
| 14 | |
| 15 | done |
| 16 | |
| 17 | done |
| 18 | for ((i=0;i<10;i++)); do |
| 19 | |
| 20 | #echo '------from 3.0.0.x to 5.0.1.'$j'------' |
| 21 | |
| 22 | for ((j=0; j<10; ++j )) ; do |
| 23 | echo '3.0.'$i'.1 -> 5.0.'$j'.1' |
| 24 | ping -c 1 -w 1 -I 3.0.$i.1 5.0.$j.1 | grep 'from 5.0.'$j'.1' |
| 25 | |
| 26 | done |
| 27 | |
| 28 | done |
| 29 | |
| 30 | # ping test between as2 and as4 |
| 31 | for ((i=1;i<2;i++)); do |
| 32 | for ((prefix=101; prefix<=200; ++prefix)) ; do |
| 33 | for ((j=0; j<10; ++j )) ; do |
| 34 | echo '3.0.0.'$i' - > '$prefix'.0.'$j'.1' |
| 35 | ping -c 1 -w 1 -I 3.0.0.$i $prefix.0.$j.1 | grep 'from '$prefix'.0.'$j'.1' |
| 36 | |
| 37 | done |
| 38 | done |
| 39 | |
| 40 | done |
| 41 | |