Тут показані розбіжності між вибраною ревізією та поточною версією сторінки.
Порівняння попередніх версій Попередня ревізія | |||
uaixshape [2023/06/15 21:01] nightfly знищено |
— (поточний) | ||
---|---|---|---|
Рядок 1: | Рядок 1: | ||
- | ====== Отдельная скорость на UA-IX ====== | ||
- | Среди некоторых провайдеров до сих пор является популярной выдача большей скорости "на Украину" | ||
- | <file php update_uaix.php> | ||
- | <?php | ||
- | /////////////////////// | ||
- | |||
- | //URL to get UA-IX prefixes | ||
- | $prefixes_url=' | ||
- | // ipfw command path | ||
- | $ipfw='/ | ||
- | |||
- | //ukrainian prefixes table | ||
- | $uaix_table=6; | ||
- | |||
- | //pipe to shape ukrainian prefixes, upload pipe will be +1 | ||
- | $uaix_pipe=6; | ||
- | |||
- | //UA-IX speed - download and upload | ||
- | $uaix_speed=' | ||
- | $uaix_upload=' | ||
- | |||
- | //shape interface | ||
- | $shape_interface=' | ||
- | |||
- | /////////////////////////////////////////////////////// | ||
- | set_time_limit (0); | ||
- | |||
- | $allprefixes_raw=file_get_contents($prefixes_url); | ||
- | |||
- | if (!empty($allprefixes_raw)) { | ||
- | |||
- | $allprefixes=explode(" | ||
- | |||
- | //flushing old prefixes | ||
- | $table_flush_cmd=$ipfw.' | ||
- | shell_exec($table_flush_cmd); | ||
- | |||
- | // | ||
- | $pipe_refresh_cmd=$ipfw.' | ||
- | shell_exec($pipe_refresh_cmd); | ||
- | |||
- | $pipe_refresh_cmd=$ipfw.' | ||
- | shell_exec($pipe_refresh_cmd); | ||
- | |||
- | // | ||
- | foreach ($allprefixes as $each) { | ||
- | $each=trim($each); | ||
- | if (!empty($each)) { | ||
- | $table_add_cmd=$ipfw.' | ||
- | shell_exec($table_add_cmd); | ||
- | } | ||
- | } | ||
- | |||
- | //adding shaper rules for active ubilling users | ||
- | $unshape_cmd=$ipfw.' | ||
- | shell_exec($unshape_cmd); | ||
- | $shape_cmd=$ipfw.' | ||
- | shell_exec($shape_cmd); | ||
- | $shape_cmd=$ipfw.' | ||
- | shell_exec($shape_cmd); | ||
- | |||
- | //all done | ||
- | print(sizeof($allprefixes).' | ||
- | |||
- | } else { | ||
- | print(" | ||
- | } | ||
- | |||
- | ?> | ||
- | </ | ||
- | Как минимум изменения под вашу персональную реальность, | ||
- | Вызывать мы можем его при помощи команды | ||
- | php -q / | ||
- | |||
- | когда и как нам угодно: | ||
- | |||
- | После отработки скрипта, | ||
- | < | ||
- | 11000 pipe 7 ip from table(3) to table(6) via em2 in | ||
- | 11001 pipe 6 ip from table(6) to table(4) via em2 out | ||
- | </ | ||
- | |||
- | Собственно в табличке 6 у нас будут все UA-IX префиксы, |