20 вещей, которые я должен был знать в 20 лет

1. Мир пытается оставить тебя тупым. Начиная от банковских платежей и процентов и заканчивая чудо-диетами — из необразованных людей легче вытрясти деньги и ими проще управлять. Занимайтесь самообразованием столько, сколько можете — для того, чтобы быть богатым, независимым и счастливым.

2. Не верьте слепо в образовательные институты. Пока они готовят учебные планы, система устаревает, а иногда и успевает сломаться. Лучше учиться и зарабатывать уважение людей путём лидерства и делания, а не путём следования.

3. Читайте так много, как только можете. Освойте технику быстрого чтения с высоким уровнем запоминания. Emerson Spartz научил меня этому на слёте Summit Series. И если он читает 2-3 книги в неделю, вы вполне можете прочесть одну.

4. Старайтесь постоянно общаться со всеми. Станьте мастером общения. Учитесь находить в человеке то, что вам нравится в нём, а затем обращайтесь к этой его стороне.

5. Не теряйте времени на скромность. Скромность — это вера в то, что ваши эмоции могут стать судьями вашего процесса принятия решения, в то время как верно прямо противоположное.

6. Если вас что-то неприятно удивляет во время отношений с кем-то, скорее всего именно от этого вы освободитесь путём их разрыва.

7. Старайтесь максимально часто общаться с людьми, которые старше вас. Лично я встречаюсь с людьми на Podcamp‘ах. Мой друг Грег в возрасте 13 лет встретил своего первого работодателя на соседнем кресле в салоне самолёта. Ценность общения со старшими заключается в том, что система принятия решений ваших сверстников не сильно вам поможет. А старшие к тому же знают всё то, что вы узнаете позже — потому стоит спросить у них.

8. Ищите людей круче себя [в том, что вам интересно] и проводите время с ними. Это само по себе важно, но важно и следствие — не пытайтесь быть средненьким в вашей группе, пытайтесь стать лучшим (делайте интересные вещи, будьте честолюбивы, отзывчивы, восприимчивы и т.п.).

9. Со временем вы будете становиться всё более консервативными. Это просто факт. Те, кто окружает вас, создадут нечто вроде пузыря, который будет поддерживать «статус кво» (текущее положение дел). Именно поэтому самые сумасшедшие идеи нужно реализовать СЕЙЧАС. Потом вы станете слишком боязливы. Поверьте мне.

10. Максимально сократите расходы. Это позволит вам создать запас для осуществления той самой сумасшедшей идеи, о которой я говорил выше.

11. Вместо получения статуса с помощью объектов (что даёт только временное его повышение), повышайте его опытом. Другими словами, поездка в Париж — лучший выбор, нежели новый шкаф. Исследования показывают, что такой выбор повышает уровень удовлетворения, получаемого от жизни.

12. Если вы живёте в нужде, решите денежную проблему. Используйте интернет, поскольку он может помочь вам дёшево купить что-то на аукционах. Если сейчас вы живёте от зарплаты до зарплаты, расширьте это период на три недели вместо двух. Затем, когда дела пойдут лучше, можно планировать на месяц, потом на три, шесть и наконец на год вперёд. Цель — достичь момента, когда вы планируете на 5 лет вперёд.

13. Научитесь программировать.

14. Не набирайте лишний вес в молодости. Ваши гормоны помогут вам с этим поначалу, но не стоит терять эту возможность, поверьте мне.

15. Научитесь готовить. Это сильно упростит вашу жизнь, питание перестанет быть обыденным делом, превратится из дорогой необходимости в приятное занятие да и сэкономит ваши средства. Я большой фанат Jamie Oliver‘а, но если вам нравится кто-то другой — замечательно.

16. Хорошо высыпайтесь. Сон и самостоятельное приготовление пищи помогут вам не набрать лишний вес. Если вы думаете «я отосплюсь в могиле» или «я должен ещё много сделать, нет времени для сна», то я вам скажу так — «не выспавшийся вы НЕ ЭФФЕКТИВНЫ», сокращение времени сна вам не поможет.

17. Заведите себе приложение-записную книжку. Не доверяйте памяти, встроенной в ваш мозг. Не доводите ситуацию до делания того, что «вам кажется» нужно было бы сделать. Доверяйте только записям, я использую RE.minder и Action Method.

18. Поставьте себе большую цель и позвольте случаю помочь вам. Если же вы не обозначите её, то что-то, конечно, случится, однако если вы её поставите, то случится намного больше.

19. Станьте специалистом в чём-то одном. Потратьте 5 лет на дело, а не на шатание вокруг да около. Если вы захотите затем сменить профессию — вперёд. Как я сказал, выберите что-то.

20. Не пытайтесь исправить людей. Лучше найдите тех, кто ещё не испорчен.

Compiling Linux Kernel 3.4.5 Vanilla Final — Debian way

Here is my guide on Compiling 3.4.x Vanilla Final — Ubuntu/Debian using the debian way

This article is about compiling a kernel on Ubuntu systems. It describes how to build a custom kernel using the latest unmodified kernel sources from www.kernel.org (vanilla kernel) so that you are independent from the kernels supplied by your distribution.
Install the Required packages for building it

sudo apt-get install git-core kernel-package fakeroot build-essential ncurses-dev

Then download latest kernel version

cd /usr/src
sudo wget --continue http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.4.5.tar.bz2
sudo tar jxvf linux-3.4.5.tar.bz2
cd linux-3.4.5

$ sudo cp /boot/config-`uname -r` ./.config
$ sudo make menuconfig
Disable xen
Processor Type and Features -> Paravirtualized Guest Support -> Xen

support otherwise you will get this error

sudo make-kpkg clean
sudo fakeroot make-kpkg --initrd --append-to-version=-vanillaice kernel_image kernel_headers
cd ..
sudo dpkg -i linux-image-3.4.*
sudo shutdown -r now

you can install the headers too from /usr/src/linux-headers-3.4.*-*
in my case i can show you how the packages are named

ls *.deb
linux-image-3.4.*-vanillaice_4.4.*-vanillaice-10.00.Custom_amd64.deb
linux-headers-3.4.*-vanillaice_4.4.*-vanillaice-10.00.Custom_amd64.deb

Протокол динамической маршрутизации EIGRP

EIGRP (Enhanced Interior Gateway Routing Protocol) – протокол разработан Cisco systems на основе IGRP.

Для выбора наиболее короткого маршрута используется механизм DUAL (Diffusing Update Algorithm).

Понятия (DUAL):

Feasible distance (FD) – наименьшая вычислительная метрика до каждой удаленной сети.
Reported distance (RD) – вычисленное расстояние от соседа (next-hop) до удаленной сети.
Route Source — индетификационный номер маршрутизатора, который изначально объявлен для достижения маршрута к удаленной сети.
Interface information — интерфейс, через который может быть достигнута удаленная сеть.
Route status — состояние маршрута (Passive – маршрут рабочий, Active – маршрут пересчитывается DUAL)/
Successor – next-hop маршрутизатор с путем без петель и с наименьшей стоимостью пути.
Feasible successor — резервный маршрутизатор со свободным от петель маршрутом.
Feasible condition — условие, используется для выбора successor и feasible successor. RD feasible successor должно быть меньше чем FD текущего маршрута successor.

— EIGRP более прост и менее требователен к ресурсам чем OSPF.
— EIGRP отосится к “distance vector” протоколам.
— EIGRP по умолчанию включено автосуммирование маршрутов, при создании суммарного маршрута, маршрутизатор добавляет в таблицу маршрутизации
этот суммарный маршрут с next-hop указывающим на null0. По умолчанию у суммарного маршрута AD – 5.

У самого протокола Administrative distance EIGRP – 90.

Конфигурирование:

* !!! На всех маршрутизаторах номер автономной системы должен быть одинаковым.

R(config)# router eigrp 33
R(config-router)# network 192.168.100.0 0.0.0.3
R(config-router)# eigrp log-neighbor-changes // Рекомендуется, для мониторинга изменения состояний соседей.
R(config)# int ser 0/0/0
R(config)# bandwidth 128

* bandwidth – используется для указания скорости, должно соотв. скорости физ. интерфейса, если не укажем, будет
соответствовать скорости T1.

R (config)# router eigrp 33
R (config-router)# no auto-summary // Отключить автосуммирование

или

R (config)# int ser 0/0
R (config-if)# ip summary eigrp 33 192.168.100.0 255.255.255.0 // Создание суммарного маршрута вручную.

Характеристики:

— Быстрая сходимость
— Поддержка VLSM и CIDR
— Частичные обновления
— Поддержка протоколов IP, IPX, AppleTalk
— Не зависит от маршрутизируемых протоколов (PDM)
— Сложная метрика
— Использование multicast (224.0.0.10) и unicast адресов, вместо широковещательной рассылки

Три рабочих таблицы:

1. Neighbor table
2. Topology table
3. Routing table

5 типов сообщений:

Hello – обнаружение соседий
Update – информация об изменении маршрутов
Query – при подсчете маршрута (при отсутствии feasible successor), отправляется пакет соседям, чтобы определить нет ли у них feasible successor для этого маршрута
Reply – ответ на Query
ACK – Подтверждение получения отправляется unicast, содержит в себе acknowledgment number, негарантированная доставка

Доставка сообщений: Reliable Transport Protocol (RTP). Пакеты отправляются на
multicast адрес 224.0.0.10

Метрика EIGRP основана на 5 компонентах (по умолчанию используется только 1-й и 2-й):
1. Bandwidth – пропускная способность
2. Delay – задержка
3. Reliability – надежность (от 1 до 255, 255 наилучшее)
4. Loading – загрузка канала (от 1 до 255, 1 наилучшее)
5. MTU

Hello пакеты на Ethernet и PtP отправляются каждые 5 сек, время hold по умолчанию 15 сек. (отправляются без подтверждения);
Multipoint X.25, Frame Relay, ATM – hello 60 сек, hold 180.
Пакеты с информацией об обновлениях отправляются с подтверждением с гарантированной доставкой через протокол RTP.

Проверка EIGRP:

# show ip eigrp interfaces

– команда выводит список рабочих интерфейсов, на которых включен EIGRP.

# show ip protocols

– содержымое команды конфигурации network для каждого процесса маршрутизации и список ip-адресов соседий.

# show ip eigrp neighbors

– известные соседи

# show ip eigrp topology

– показывает все известные маршруты successor и feasible successor для этого маршрутизатора.

# show ip route

– таблица маршрутизации, EIGRP маршруты с кодом “D”.

Debug:

# debug eigrp fsm

– показывает активности feasible successor

# debug eigrp packet

– показывает принимаемые / передаваемые пакеты EIGRP

Протокол динамической маршрутизации OSPF

OSPF ( Open Shortest Path First) протокол динамической маршрутизации

Типы пакетов OSPF:

Hello – Формирование и поддержание смежности между маршрутизаотрами
DBD – Database Description, краткой содержание базы link-state, принимающий проверят свою базу
LSR — Link-State Request, принимющий может запросить более подробную информацию
LSU – ответ на LSR, анонсирование новой информации (LSU содержит 7 типов LSA), LSA (Link State Advertisement) – содержит информацию о соседях и стоимости пути до них
LSAck – подтверждение приема LSU

Hello intervals:
Передаются каждые 10 сек в multiaccess и point-to-point сетях, 30 сек в NBMA.
Dead intervals:
По умолчанию 4 hello, multiaccess и point-to-point – 40 сек, 120 сек в NBMA.

Для построения SPF дерева используется алгоритм Дейкстры (Dijkstra), SPF дерево используется для заполнения таблицы маршрутиазции.

Адимнистративное растояние OSPF – 110
OSPF безклассовый протокол, маска подсети используется.

Включение OSPF на маршрутизаторе:

# R(config)# router ospf 10

10 – номер процесса, от 1 до 65535

Далее прописываются непосредственно присоединенные сети:

# R(config-router)# network 10.10.10.0 0.0.0.255 area 0

0.0.0.255 – wildcard mask
area 0, к примеру все роутеры в одной area 0 (в этой области маршрутизаторы обладают общей link-state информацией).

В multi-access сетях маршрутизаторы выбирают DR (designated router – выделенный маршрутизатор) и BDR маршрутизаторы (резервные), смежность
формируется с DR и BDR маршрутизатором, только DR отсылает информацию.

DR и BDR принимают и передают LSA, остальные маршрутизаторы становятся DROther.

DR пересылает LSA на multicast адрес 224.0.0.5
DROthers пересылают LSA на multicast адрес 224.0.0.6

Выборы DR и BDR не происходят в сетях point-to-point.

Маршрутизатор с самым старшим приоритетом становится DR (второй приоритет BDR), если
приоритеты одинаковые, то по старшему Router id.

Router id выбирается:
1. Использовать ip при введение команды router-id
2. Если 1-е не используется, выбирается старщий ip на loopback интерфейса
3. Если не сконфигурирован loopback, используется старший на физическом интерфейсе
Интерфейс может не использовать в процессе OSPF

Регулировать приоритет можно командой:

# ip ospf priority interface {0-255}

0 – маршрутизатор никогда не будет DR
1 – по умолчанию, выбирается по Router id

Для распространения маршрута по умолчанию используется команда:

# default-information originate

Для каналов более 100 mbit, можно задать пропускную способность:

# R(config-router)#auto-cost reference-bandwidth 10000

Модификация таймеров:

# R (confif-if)# ip ospf hello-interval seconds
# R (confif-if)# ip ospf dead-interval seconds

Интервалы должны совпадать у соседей !!!

OSPF использует cost как метрику для опредления лучших маршрутов, вычисляется:

cost = 10 ^ 8 / bandwidth

Изменить bandwidth можно командой:

# auto-cost reference-bandwidth

 

Узнать реальную полосу пропускания show interface

С обоих сторон необходимо конфигурировать одинаковую полосу пропускания, с
помощью командны Bandwidth

# interface se0/0/0
# bandwidth 64
(cost = 10 ^ 8 / 64000 = 1562)

или явно

# interface se0/0/0
# ip ospf cost 1562

Проверка OSPF:

# show ip protocols

Можно узнать
— ospf process id
— router id
— сети
— административное растояние

# show ip ospf

Можно узнать
— ospf process ID
— router ID
— OSPF area
— время последней работы SPF алгоритма
— SPF планировщик

# show ip ospf interface

— проверить Hello и Dead интервалы

# show ip route

“O” в начале маршрута указывает на то, что используется OSPF

# show ip ospf neighbor

посмотреть соседей

Правила набора текстов

Придерживаясь принятых правил набора текста, вы сможете значительно улучшить внешний вид создаваемых документов, предназначенных как для печати, так и для электронной публикации.

Как вводить текст? Когда использовать неразрывные пробелы? Какой символ выбрать для обозначения тире? Ставится ли пробел перед точкой и после нее? Ответы на эти и другие вопросы вы найдете в данной статье.

  • Единицы измерения отбивать от соответствующих величин неразрывным пробелом (Alt + Num 0160).
  • В качестве тире («Знание — сила») использовать длинное тире (Alt + Num 0151). Длинное тире отбивается от предшествующего слова неразрывным, а от последующего слова — обычным пробелом.
  • Для указания диапазонов («3–5 кг») и в качестве знака «минус» («–32º C») использовать короткое тире (Alt + Num 0150). Короткое тире в диапазонах не отбивается от предшествующей и последующей величин. Знак «минус» не отбивается от последующей величины, но отбивается от предшествующего слова обычным пробелом.
  • Дефис («кое-что») набирается непосредственно на клавиатуре. Дефис является частью слова и не отбивается от предшествующих и последующих символов.
  • В диапазонах единицы измерения указываются только после верхней границы: «2670–2780 мм». Дублировать единицы измерения перед тире не следует.
  • Сокращения при ссылках на рисунки, таблицы, страницы и пр. при указании в середине предложения пишутся со строчной (маленькой) буквы: «Габаритные огни (см. рис. 1)». Если сокращение находится в начале предложения, оно пишется с заглавной буквы.
  • Номера рисунков оформляются следующим образом: «Рис. 1. Общий вид». Точка в конце подписи не ставится. Точка также не ставится, если номер рисунка и таблицы не сопровождается подписью: «Рис. 1».
  • В заголовках следует писать с прописной (большой) буквы только первое слово, как в обычных предложениях. Не следует писать с прописных букв все слова в заголовке.
  • Точки не ставятся в конце заголовков (кроме сокращений).
  • Точки не ставятся в конце ячеек таблиц (кроме сокращений).
  • Точки не ставятся после сокращений стандартных единиц измерения (СИ): «150 м, 16 кг, 300 л». Точки также не ставятся после сокращений «млн» и «млрд» (но после «тыс.» — ставятся): «1 млн», но «23 тыс.». После сокращений единиц измерения, не являющихся стандартными, точки ставятся: «30 шт., 12 000 руб.».
  • Точка после сокращения в конце предложения не дублируется: «Первый, второй и т. д.». Тем не менее, если сокращение с точкой заключено в кавычки или скобки, точка в конце предложения ставится: «Необходимо установить полный комплект (8 шт.).».
  • Знаки препинания точка (.), точка с запятой (;), запятая (,), вопросительный знак (?), восклицательный знак (!), многоточие (…) и двоеточие (:) не отбиваются от предшествующего текста, а от последующего отбиваются пробелом: «зеленый, желтый, синий».
  • В качестве знака многоточия следует использовать три отдельные символа точки (при наборе текстов в Microsoft Word для этого необходимо отключить автозамену многоточия): «…». При использовании многоточия совместно с вопросительным или восклицательным знаками вначале ставятся эти знаки, а затем — две точки: «?..». Многоточие совместно с вопросительным и восклицательным знаками набирается в следующей последовательности: «?!.».
  • Следует избегать сдвоенных пробелов в набираемом тексте. Чтобы контролировать использование пробелов в тексте при работе в Microsoft Word рекомендуется включить режим показа непечатаемых знаков.
  • В случае если в скобки заключается целое предложение (или несколько предложений), точка в конце предложения ставится внутри скобок: «Нажмите кнопку Отмена. (Если данные были изменены, система отобразит окно с предупреждением.)». В противном случае знаки препинания (если они требуются) ставятся после закрывающей скобки: «Выберите требуемые пункты (установите соответствующие флажки).».
  • Следует использовать только общепринятые сокращения.
  • В числах разрядностью 5 или более знаков группы разрядов разделяются по три и отбиваются неразрывными пробелами (Alt + Num 0160): «35 000 руб.». В четырехзначных числах разделение на группы не производится: «3200 шт.».
  • При наборе текста не допускается использовать смешанные регистры, например, вместо символов русского алфавита использовать аналогичные по начертанию символы латинского алфавита. Это затрудняет проверку правописания, поиск, индексирование и другие автоматизированные процедуры.
  • В русскоязычных текстах для обозначения номера следует использовать знак «№» (а не «#»). Знак «№» отбивается от последующего числа неразрывным пробелом: «№ 36».
  • Следует использовать только угловые кавычки: « (Alt + Num 0171) и » (Alt + Num 0187). В качестве вложенных при необходимости следует использовать кавычки вида “ (Alt + Num 0147) и ” (Alt + Num 0148): «Проект “Радуга”». Тем не менее, вложенных кавычек рекомендуется избегать.
  • В качестве скобок следует использовать только круглые скобки, вне зависимости от уровня вложенности. Круглые скобки не отбиваются от заключенного в них текста и отбиваются от внешних фрагментов, за исключением знаков препинания: «Арендная плата составляет 10 000 (десять тысяч) долларов США»; «Нажмите кнопку Выход (в нижней части окна диалога), а затем подтвердите сохранение данных».
  • Буква «ё» пишется в следующих случаях:
    • когда необходимо предупредить неверное чтение и понимание слова, например: узнаём в отличие от узнаем; всё в отличие от все; вёдро в отличие от ведро; совершённый (причастие) в отличие от совершенный (прилагательное);
    • когда надо указать произношение малоизвестного слова, например: река Олёкма.
    • В остальных случаях следует использовать букву «е».

Илья Вихарев

Детальные характеристики с помощью dmidecode

Просмотреть серийные номера железа и более детальные характеристики можно с помощью команды dmidecode:

Вот, пример вывода команды dmidecode с сервера IBM HS22:

[root@xen-bc4 ~]# dmidecode
# dmidecode 2.10
SMBIOS 2.5 present.
64 structures occupying 2619 bytes.
Table at 0x7F6BD000.

Handle 0x0000, DMI type 38, 16 bytes
IPMI Device Information
Interface Type: KCS (Keyboard Control Style)
Specification Version: 2.0
I2C Slave Address: 0x10
NV Storage Device: Not Present
Base Address: 0x0000000000000CA2 (I/O)

Handle 0x0001, DMI type 4, 40 bytes
Processor Information
Socket Designation: Node 1 Socket 1
Type: Central Processor
Family: Xeon
Manufacturer: Intel(R) Corporation
ID: C2 06 02 00 FF FB EB BF
Signature: Type 0, Family 6, Model 44, Stepping 2
Flags:
FPU (Floating-point unit on-chip)
VME (Virtual mode extension)
DE (Debugging extension)
PSE (Page size extension)
TSC (Time stamp counter)
MSR (Model specific registers)
PAE (Physical address extension)
MCE (Machine check exception)
CX8 (CMPXCHG8 instruction supported)
APIC (On-chip APIC hardware supported)
SEP (Fast system call)
MTRR (Memory type range registers)
PGE (Page global enable)
MCA (Machine check architecture)
CMOV (Conditional move instruction supported)
PAT (Page attribute table)
PSE-36 (36-bit page size extension)
CLFSH (CLFLUSH instruction supported)
DS (Debug store)
ACPI (ACPI supported)
MMX (MMX technology supported)
FXSR (Fast floating-point save and restore)
SSE (Streaming SIMD extensions)
SSE2 (Streaming SIMD extensions 2)
SS (Self-snoop)
HTT (Hyper-threading technology)
TM (Thermal monitor supported)
PBE (Pending break enabled)
Version: Intel(R) Xeon(R) CPU X5670 @ 2.93GHz
Voltage: 1.2 V
External Clock: 6400 MHz
Max Speed: 4000 MHz
Current Speed: 2930 MHz
Status: Populated, Enabled
Upgrade: ZIF Socket
L1 Cache Handle: 0x0002
L2 Cache Handle: 0x0003
L3 Cache Handle: 0x0004
Serial Number: Not Specified
Asset Tag: Not Specified
Part Number: Not Specified
Core Count: 6
Core Enabled: 6
Thread Count: 12
Characteristics:
64-bit capable

Handle 0x0002, DMI type 7, 19 bytes
Cache Information
Socket Designation: Internal Cache Level 1
Configuration: Enabled, Not Socketed, Level 1
Operational Mode: Write Back
Location: Internal
Installed Size: 32 kB
Maximum Size: 32 kB
Supported SRAM Types:
Asynchronous
Installed SRAM Type: Asynchronous
Speed: Unknown
Error Correction Type: Single-bit ECC
System Type: Other
Associativity: 16-way Set-associative

Handle 0x0003, DMI type 7, 19 bytes
Cache Information
Socket Designation: Internal Cache Level 2
Configuration: Enabled, Not Socketed, Level 2
Operational Mode: Write Back
Location: Internal
Installed Size: 256 kB
Maximum Size: 256 kB
Supported SRAM Types:
Asynchronous
Installed SRAM Type: Asynchronous
Speed: Unknown
Error Correction Type: Single-bit ECC
System Type: Instruction
Associativity: 16-way Set-associative

Handle 0x0004, DMI type 7, 19 bytes
Cache Information
Socket Designation: Internal Cache Level 3
Configuration: Enabled, Not Socketed, Level 3
Operational Mode: Write Back
Location: Internal
Installed Size: 12288 kB
Maximum Size: 12288 kB
Supported SRAM Types:
Asynchronous
Installed SRAM Type: Asynchronous
Speed: Unknown
Error Correction Type: Single-bit ECC
System Type: Instruction
Associativity:

Handle 0x0005, DMI type 0, 24 bytes
BIOS Information
Vendor: IBM
Version: -[P9E146CUS-1.08]-
Release Date: 04/26/2010
ROM Size: 4096 kB
Characteristics:
PCI is supported
PNP is supported
BIOS is upgradeable
BIOS shadowing is allowed
Boot from CD is supported
Selectable boot is supported
EDD is supported
Japanese floppy for NEC 9800 1.2 MB is supported (int 13h)
Japanese floppy for Toshiba 1.2 MB is supported (int 13h)
5.25"/360 kB floppy services are supported (int 13h)
5.25"/1.2 MB floppy services are supported (int 13h)
3.5"/720 kB floppy services are supported (int 13h)
3.5"/2.88 MB floppy services are supported (int 13h)
Print screen service is supported (int 5h)
8042 keyboard services are supported (int 9h)
Serial services are supported (int 14h)
Printer services are supported (int 17h)
CGA/mono video services are supported (int 10h)
ACPI is supported
USB legacy is supported
LS-120 boot is supported
ATAPI Zip drive boot is supported
BIOS boot specification is supported
Function key-initiated network boot is supported
Targeted content distribution is supported
BIOS Revision: 0.0
Firmware Revision: 0.0

Handle 0x0006, DMI type 1, 27 bytes
System Information
Manufacturer: IBM
Product Name: BladeCenter HS22 -[7870H4G]-
Version: 07
Serial Number: 99N1705
UUID: 75EFE298-6902-11DF-8517-E41F137A0F00
Wake-up Type: Other
SKU Number: XxXxXxX
Family: System x

Handle 0x0007, DMI type 2, 16 bytes
Base Board Information
Manufacturer: IBM
Product Name: 68Y8071
Version: (none)
Serial Number: 05P0PS
Asset Tag: (none)
Features:
Board is a hosting board
Board is replaceable
Location In Chassis: Slot04
Chassis Handle: 0x0008
Type: Server Blade
Contained Object Handles: 0

Handle 0x0008, DMI type 3, 17 bytes
Chassis Information
Manufacturer: IBM
Type: Main Server Chassis
Lock: Not Present
Version: none
Serial Number: -[UUID:AC6587180B4F3356828A9EF654FF3925]-
Asset Tag: none
Boot-up State: Safe
Power Supply State: Safe
Thermal State: Other
Security Status: Other
OEM Information: 0x00000000

Handle 0x0009, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator: ID 0
Internal Connector Type: SAS/SATA Plug Receptacle
External Reference Designator: SAS
External Connector Type: None
Port Type: SAS

Handle 0x000A, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator: ID 1
Internal Connector Type: SAS/SATA Plug Receptacle
External Reference Designator: SAS
External Connector Type: None
Port Type: SAS

Handle 0x000B, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator: Back Panel
Internal Connector Type: Other
External Reference Designator: COM 1 MM
External Connector Type: DB-9 male
Port Type: Serial Port 16550A Compatible

Handle 0x000C, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator: J21
Internal Connector Type: None
External Reference Designator: COM 2
External Connector Type: DB-9 male
Port Type: Serial Port 16550A Compatible

Handle 0x000D, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator: Back Panel
Internal Connector Type: None
External Reference Designator: USB MM1
External Connector Type: Access Bus (USB)
Port Type: USB

Handle 0x000E, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator: Back Panel
Internal Connector Type: None
External Reference Designator: USB MM2
External Connector Type: Access Bus (USB)
Port Type: USB

Handle 0x000F, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator: Item 7
Internal Connector Type: None
External Reference Designator: USB Key
External Connector Type: Access Bus (USB)
Port Type: USB

Handle 0x0010, DMI type 9, 13 bytes
System Slot Information
Designation: I/O Expander Daughter Card
Type: x8 PCI Express
Current Usage: Available
Length: Other
ID: 1
Characteristics:
3.3 V is provided

Handle 0x0011, DMI type 11, 5 bytes
OEM Strings
String 1: IBM SystemX

Handle 0x0012, DMI type 10, 6 bytes
On Board Device Information
Type: Video
Status: Enabled
Description: Matrox G200eV

Handle 0x0013, DMI type 10, 6 bytes
On Board Device Information
Type: SAS Controller
Status: Enabled
Description: LSI SAS 1064E

Handle 0x0014, DMI type 10, 6 bytes
On Board Device Information
Type: Ethernet
Status: Enabled
Description: Ethernet 1 BroadCom 5709S Ethernet Controller

Handle 0x0015, DMI type 10, 6 bytes
On Board Device Information
Type: Ethernet
Status: Enabled
Description: Ethernet 1 BroadCom 5709S Ethernet Controller

Handle 0x0016, DMI type 11, 5 bytes
OEM Strings
String 1: IBM SystemX

Handle 0x0017, DMI type 11, 5 bytes
OEM Strings
String 1: $SI Integrated Management Module 1.10 -[YUOO57H-1.10]-

Handle 0x0018, DMI type 11, 5 bytes
OEM Strings
String 1: $BD

Handle 0x0019, DMI type 11, 5 bytes
OEM Strings
String 1: $CR CRTM Code 1.08 -[P9CP46CUS]-

Handle 0x001A, DMI type 11, 5 bytes
OEM Strings
String 1: $DS Preboot Diagnostics (DSA) 3.01 -[DSYT60K]-

Handle 0x001B, DMI type 11, 5 bytes
OEM Strings
String 1: $MV Min UEFI Version -[P9E146AUS-1.07]-

Handle 0x001C, DMI type 11, 5 bytes
OEM Strings
String 1: $BB Backup BIOS Version -[P9E148AUS]-

Handle 0x001D, DMI type 11, 5 bytes
OEM Strings
String 1: $QP QPI Version -[01.84]-

Handle 0x001E, DMI type 11, 5 bytes
OEM Strings
String 1: $MR MRC Version -[02.11]-

Handle 0x001F, DMI type 11, 5 bytes
OEM Strings
String 1: $CS CSM Version -[CSE127AUX]-

Handle 0x0020, DMI type 12, 5 bytes
System Configuration Options
Option 1: SW? TPM Physical Presence Switch, J? TPM Physical Presence Jumper

Handle 0x0021, DMI type 13, 22 bytes
BIOS Language Information
Installable Languages: 1
English
Currently Installed Language: English

Handle 0x0022, DMI type 27, 14 bytes
Cooling Device
Temperature Probe Handle: 0x0000
Type: Unknown
Status: Unknown
OEM-specific Information: 0x00000000
Nominal Speed: 0 rpm

Handle 0x0023, DMI type 32, 20 bytes
System Boot Information
Status: No errors detected

Handle 0x0024, DMI type 16, 15 bytes
Physical Memory Array
Location: System Board Or Motherboard
Use: System Memory
Error Correction Type: Single-bit ECC
Maximum Capacity: 192 GB
Error Information Handle: Not Provided
Number Of Devices: 18

Handle 0x0025, DMI type 6, 12 bytes
Memory Module Information
Socket Designation: DIMM01
Bank Connections: 0 0
Current Speed: Unknown
Type: DIMM
Installed Size: 4096 MB (Single-bank Connection)
Enabled Size: 4096 MB (Single-bank Connection)
Error Status: OK

Handle 0x0026, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x0024
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 4096 MB
Form Factor: DIMM
Set: None
Locator: DIMM01
Bank Locator: BANK00
Type: Other
Type Detail: Unknown
Speed: 1333 MHz
Manufacturer: Samsung
Serial Number: 44C33F42
Asset Tag: Unknown
Part Number: M392B5170EM1-CH9

Handle 0x0027, DMI type 6, 12 bytes
Memory Module Information
Socket Designation: DIMM02
Bank Connections: 0 0
Current Speed: Unknown
Type: DIMM
Installed Size: 2048 MB (Single-bank Connection)
Enabled Size: 2048 MB (Single-bank Connection)
Error Status: OK

Handle 0x0028, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x0024
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 2048 MB
Form Factor: DIMM
Set: None
Locator: DIMM02
Bank Locator: BANK00
Type: Other
Type Detail: Unknown
Speed: 1333 MHz
Manufacturer: Samsung
Serial Number: F7654142
Asset Tag: Unknown
Part Number: M392B5673EH1-CH9

Handle 0x0029, DMI type 6, 12 bytes
Memory Module Information
Socket Designation: DIMM03
Bank Connections: 0 0
Current Speed: Unknown
Type: DIMM
Installed Size: 4096 MB (Single-bank Connection)
Enabled Size: 4096 MB (Single-bank Connection)
Error Status: OK

Handle 0x002A, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x0024
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 4096 MB
Form Factor: DIMM
Set: None
Locator: DIMM03
Bank Locator: BANK00
Type: Other
Type Detail: Unknown
Speed: 1333 MHz
Manufacturer: Samsung
Serial Number: 18D33D42
Asset Tag: Unknown
Part Number: M392B5170EM1-CH9

Handle 0x002B, DMI type 6, 12 bytes
Memory Module Information
Socket Designation: DIMM04
Bank Connections: 0 0
Current Speed: Unknown
Type: DIMM
Installed Size: 2048 MB (Single-bank Connection)
Enabled Size: 2048 MB (Single-bank Connection)
Error Status: OK

Handle 0x002C, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x0024
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 2048 MB
Form Factor: DIMM
Set: None
Locator: DIMM04
Bank Locator: BANK00
Type: Other
Type Detail: Unknown
Speed: 1333 MHz
Manufacturer: Samsung
Serial Number: 3664142
Asset Tag: Unknown
Part Number: M392B5673EH1-CH9

Handle 0x002D, DMI type 6, 12 bytes
Memory Module Information
Socket Designation: DIMM05
Bank Connections: 0 0
Current Speed: Unknown
Type: DIMM
Installed Size: 4096 MB (Single-bank Connection)
Enabled Size: 4096 MB (Single-bank Connection)
Error Status: OK

Handle 0x002E, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x0024
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 4096 MB
Form Factor: DIMM
Set: None
Locator: DIMM05
Bank Locator: BANK00
Type: Other
Type Detail: Unknown
Speed: 1333 MHz
Manufacturer: Samsung
Serial Number: D9FA3E42
Asset Tag: Unknown
Part Number: M392B5170EM1-CH9

Handle 0x002F, DMI type 6, 12 bytes
Memory Module Information
Socket Designation: DIMM06
Bank Connections: 0 0
Current Speed: Unknown
Type: DIMM
Installed Size: 2048 MB (Single-bank Connection)
Enabled Size: 2048 MB (Single-bank Connection)
Error Status: OK

Handle 0x0030, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x0024
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 2048 MB
Form Factor: DIMM
Set: None
Locator: DIMM06
Bank Locator: BANK00
Type: Other
Type Detail: Unknown
Speed: 1333 MHz
Manufacturer: Samsung
Serial Number: 5664142
Asset Tag: Unknown
Part Number: M392B5673EH1-CH9

Handle 0x0031, DMI type 6, 12 bytes
Memory Module Information
Socket Designation: DIMM07
Bank Connections: 0 0
Current Speed: Unknown
Type: None
Installed Size: Not Installed
Enabled Size: Not Installed
Error Status: OK

Handle 0x0032, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x0024
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: Unknown
Size: No Module Installed
Form Factor: Unknown
Set: None
Locator: DIMM07
Bank Locator: BANK01
Type: Unknown
Type Detail: Unknown
Speed: Unknown
Manufacturer: Not Specified
Serial Number: Not Specified
Asset Tag: Not Specified
Part Number: Not Specified

Handle 0x0033, DMI type 6, 12 bytes
Memory Module Information
Socket Designation: DIMM08
Bank Connections: 0 0
Current Speed: Unknown
Type: None
Installed Size: Not Installed
Enabled Size: Not Installed
Error Status: OK

Handle 0x0034, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x0024
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: Unknown
Size: No Module Installed
Form Factor: Unknown
Set: None
Locator: DIMM08
Bank Locator: BANK01
Type: Unknown
Type Detail: Unknown
Speed: Unknown
Manufacturer: Not Specified
Serial Number: Not Specified
Asset Tag: Not Specified
Part Number: Not Specified

Handle 0x0035, DMI type 6, 12 bytes
Memory Module Information
Socket Designation: DIMM09
Bank Connections: 0 0
Current Speed: Unknown
Type: None
Installed Size: Not Installed
Enabled Size: Not Installed
Error Status: OK

Handle 0x0036, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x0024
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: Unknown
Size: No Module Installed
Form Factor: Unknown
Set: None
Locator: DIMM09
Bank Locator: BANK01
Type: Unknown
Type Detail: Unknown
Speed: Unknown
Manufacturer: Not Specified
Serial Number: Not Specified
Asset Tag: Not Specified
Part Number: Not Specified

Handle 0x0037, DMI type 6, 12 bytes
Memory Module Information
Socket Designation: DIMM10
Bank Connections: 0 0
Current Speed: Unknown
Type: None
Installed Size: Not Installed
Enabled Size: Not Installed
Error Status: OK

Handle 0x0038, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x0024
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: Unknown
Size: No Module Installed
Form Factor: Unknown
Set: None
Locator: DIMM10
Bank Locator: BANK01
Type: Unknown
Type Detail: Unknown
Speed: Unknown
Manufacturer: Not Specified
Serial Number: Not Specified
Asset Tag: Not Specified
Part Number: Not Specified

Handle 0x0039, DMI type 6, 12 bytes
Memory Module Information
Socket Designation: DIMM11
Bank Connections: 0 0
Current Speed: Unknown
Type: None
Installed Size: Not Installed
Enabled Size: Not Installed
Error Status: OK

Handle 0x003A, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x0024
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: Unknown
Size: No Module Installed
Form Factor: Unknown
Set: None
Locator: DIMM11
Bank Locator: BANK01
Type: Unknown
Type Detail: Unknown
Speed: Unknown
Manufacturer: Not Specified
Serial Number: Not Specified
Asset Tag: Not Specified
Part Number: Not Specified

Handle 0x003B, DMI type 6, 12 bytes
Memory Module Information
Socket Designation: DIMM12
Bank Connections: 0 0
Current Speed: Unknown
Type: None
Installed Size: Not Installed
Enabled Size: Not Installed
Error Status: OK

Handle 0x003C, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x0024
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: Unknown
Size: No Module Installed
Form Factor: Unknown
Set: None
Locator: DIMM12
Bank Locator: BANK01
Type: Unknown
Type Detail: Unknown
Speed: Unknown
Manufacturer: Not Specified
Serial Number: Not Specified
Asset Tag: Not Specified
Part Number: Not Specified

Handle 0x003D, DMI type 19, 15 bytes
Memory Array Mapped Address
Starting Address: 0x00000000000
Ending Address: 0x0047FFFFFFF
Range Size: 18 GB
Physical Array Handle: 0x0024
Partition Width: 0

Handle 0x003E, DMI type 4, 40 bytes
Processor Information
Socket Designation: Node 1 Socket 2
Type: Central Processor
Family: Xeon
Manufacturer: Intel(R) Corporation
ID: 00 00 00 00 00 00 00 00
Signature: Type 0, Family 0, Model 0, Stepping 0
Flags: None
Version: Not Specified
Voltage: 1.2 V
External Clock: 6400 MHz
Max Speed: 4000 MHz
Current Speed: Unknown
Status: Unpopulated
Upgrade: ZIF Socket
L1 Cache Handle: Not Provided
L2 Cache Handle: Not Provided
L3 Cache Handle: Not Provided
Serial Number: Not Specified
Asset Tag: Not Specified
Part Number: Not Specified
Characteristics: None

Handle 0xFEFF, DMI type 127, 4 bytes
End Of Table

[root@xen-bc4 ~]#

 

SSH — беспарольная аутентификация с помощью ssh-agent

Генерируем приватный и публичный ключи для сервера с паролем:

root@priovtb-sftp:~# ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa):
/root/.ssh/id_dsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_dsa.
Your public key has been saved in /root/.ssh/id_dsa.pub.
The key fingerprint is:
fe:61:e8:3e:0e:56:b5:13:c1:c7:f0:fe:fd:78:21:fa root@priovtb-sftp
The key's randomart image is:
+--[ DSA 1024]----+
|         .oo     |
|          .oo    |
|          o..    |
|         . +     |
|        S o .    |
|       o . . o o |
|      o o o . o o|
|     . o.o o   .o|
|       o+.. .E...|
+-----------------+

Запустим ssh-agent:

root@priovtb-sftp:~# exec ssh-agent /bin/bash

Проверим, какие ключи хранит в себе ssh-agent:

root@priovtb-sftp:~# ssh-add  -l
The agent has no identities.

Ключей пока нет.

Добавляем приватный ключ:

root@priovtb-sftp:~# ssh-add ~/.ssh/id_dsa
Enter passphrase for /root/.ssh/id_dsa:
Identity added: /root/.ssh/id_dsa (/root/.ssh/id_dsa)

Пробуем соединиться с хостом. Хост запрашивает пароль, потому что ключа пока нет.

root@priovtb-sftp:~# ssh 10.50.10.75
root@10.50.10.75's password:
^C

Заливаем на хост наш ключ. В процессе заливки ключа, хост запросит пользовательский пароль хоста:

root@priovtb-sftp:~# scp /root/.ssh/id_dsa.pub 10.50.10.75:~/.ssh/authorized_keys
root@10.50.10.75's password:
id_dsa.pub                       100%  607     0.6KB/s   00:00

Ключ на хосте. Пробуем соединиться по SSH:

root@priovtb-sftp:~# ssh 10.50.10.75
Linux lina 2.6.32-5-686 #1 SMP Mon Mar 26 05:20:33 UTC 2012 i686

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Thu Mar 29 15:25:00 2012 from 10.50.10.39
root@malina:~# exit
logout
Connection to 10.50.10.75 closed.
root@priovtb-sftp:~#

Отлично. Аутентификация прошла без запроса пароля, но при этом сам ключ запаролен. 🙂

Cisco, QoS и NBAR

Restrict Traffic Flow including P2P (Peer to Peer) using NBAR: An Overview

Introduction

NBAR (Network-Based Application Recognition) is a very indepth topic hence this FAQ will try to illustrate one of its many functionalities and how to action packets that match the protocol criteria required.

NBAR has its niche within the QoS (Quality of Service) crowd where specific applications are given precedence or not as the case maybe depending on the network requirements at the time of the implementation. NBAR allows recognition of a wide variety of applications where QoS may be implemented on them, i.e. from the bandwidth intensive Citrix to the port changing Kazaa P2P (Peer-to-Peer) application.

NBAR allows the classification of protocols from layer 4 to 7 hence allowing the router in some respects to disregard its layer 3 position and to look at the high layer protocols. NBAR can recognise:

• Statically assigned TCP and UDP port numbers

• Non-UDP and non-TCP IP protocols

• Dynamically assigned TCP and UDP port numbers. Classification of such applications requires stateful inspection; that is, the ability to discover the data connections to be classified by parsing the connections where the port assignments are made.

• Sub-port classification or classification based on deep packet inspection; that is, classification by looking deeper into the packet.

NBAR can classify static port protocols. Although access control lists (ACLs) can also be used for this purpose, NBAR is easier to configure and can provide classification statistics that are not available when using ACLs.

NBAR includes a Protocol Discovery feature that provides an easy way to discover application protocols that are transversing an interface. The Protocol Discovery feature discovers any protocol traffic supported by NBAR. Protocol Discovery maintains the following per-protocol statistics for enabled interfaces: total number of input and output packets and bytes, and input and output bit rates. The Protocol Discovery feature captures key statistics associated with each protocol in a network that can be used to define traffic classes and QoS policies for each traffic class.

The router (depending on model and IOS version) has built-in NBAR functionality which may be seen when configuring NBAR:

london-colo-east(config-cmap)#match protocol ?

Or when scrutinising a port-map:

london-colo-east-01-e-01#sh ip nbar port-map

which will demonstrate the ports and IP protocol of the various protoocols present.

An external Packet Description Language Module (PDLM) can be loaded at any time to extend the NBAR list of recognized protocols. PDLMs can also be used to enhance an existing protocol recognition capability. PDLMs allow NBAR to recognize new protocols without requiring a new Cisco IOS image or a router reload, hence PDLMs allow the router to gain the functionality of recognising applications at the application layer for the protoocols which when the router was shipped, was either not available or have changed in its function so much that an update is required.

To view a list of currently available PDLMs or to download a PDLM:

NBAR Packet Description Language Module Download

There are a number of examples, such as Citrix, gnuttella, skinny, etc. This type of traffic would have been hard to classify using standard QoS tecniques, either to minimise the impact of such programs on bandwidth, to drop them or to allocate the most amount of bandwidth to. PDLMs give the router this added ability to recognise the traffic specified by it as well as some other types of traffic pre-defined in the IOS.


Procedure (* optional if application NBAR required on is already present:

CEF should be enabled.

1.)* Copy the pdlm into the router’s flash:

london-colo-east-01-e-01#copy tftp flash
Address or name of remote host []? 192.168.1.254
Source filename []? bittorrent.pdlm
Destination filename [bittorrent.pdlm]? 
Accessing tftp://192.168.1.254/bittorrent.pdlm...
Erase flash: before copying? [confirm]n
Loading bittorrent.pdlm from 192.168.1.254 (via FastEthernet0.1): !
[OK - 4125 bytes]

Verifying checksum... OK (0xA1BF)
4125 bytes copied in 0.192 secs (21484 bytes/sec)
london-colo-east-01-e-01#sh flash:

System flash directory:
File Length Name/status
1 9773168 c1700-k9o3sy7-mz.123-10.bin 
2 4125 bittorrent.pdlm 
[9777424 bytes used, 6737644 available, 16515068 total]
16384K bytes of processor board System flash (Read/Write)

2.) Enable CEF

london-colo-east-01-e-01#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
london-colo-east-01-e(config)#ip cef

3.)* Reference the pdlm in the config:

london-colo-east-01-e-01#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
london-colo-east-01-e(config)#ip nbar pdlm bittorrent.pdlm 
london-colo-east-01-e(config)#

The result:

ip cef
ip nbar pdlm bittorrent.pdlm
!

4.) Create a class-map and policy map and apply it to the interface concerned:

class-map match-all bittorrent
  match protocol bittorrent
!
policy-map bittorrent-policy
  class bittorrent
   drop
!
interface FastEthernet0
 description Facing LAN
 ip address 192.168.1.1 255.255.255.0
 ip nat inside
 service-policy input bittorrent-policy
 speed 100
 full-duplex
!

Basically, within the policy-map bittorrent-policy, the action for any packets matching that protocol arriving on the fa0 interface was to DROP them. Packet manipulation is possible using QoS such as setting the precedence bits or setting maximum/limited bandwidth for further processing down the line but in this instance, the packets are set to be dropped as soon as they arrive on the fa0 interface.

QoS (Quality of Service) and NBAR

QoS should be the suggested reading for any more indepth look at policy-maps. As illustration, following is sample configuration using NBAR and QoS CBWFQ (Class-Based Weighted Fair Queue) for most common P2P protocols.

Unlike the previous sample configuration where P2P traffic is dropped or blocked, this sample configuration objective is to permit with restriction. The restriction is that all P2P traffic will be limited to only 8 kbps bandwidth. Any attempt from P2P traffic to use more than 8 kbps bandwidth will be dropped or blocked.

class-map match-any p2p
 match protocol bittorrent
 match protocol edonkey
 match protocol fasttrack
 match protocol gnutella
 match protocol kazaa2
 match protocol skype
!
policy-map QoS-inbound-policy
 class p2p
   police cir 8000
     conform-action drop
     exceed-action drop
!
interface FastEthernet0
 description Facing LAN
 ip address 192.168.1.1 255.255.255.0
 ip nat inside
 service-policy input QoS-inbound-policy
 speed 100
 full-duplex
!

==============================================================

 

Is your network bandwidth being consumed by Peer-to-Peer (P2P) traffic? (Hint: If you don’t know, it’s time to fire up NBAR and do a little investigating.) One way to stop P2P traffic is to use an access-list to block traffic on the well-know P2P ports. Unfortunately, many P2P technologies no longer rely on fixed ports. This means you can’t depend on access-lists being able to block the traffic. Cisco’s NBAR users packet inspection to determine what traffic class a data stream belongs to. With NBAR, it’s no longer necessary to know what ports an application is using.

Stopping P2P traffic with Cisco NBAR is a simple three step process. In the following example, we’ll use NBAR to block BitTorrent on our router’s Gigabit interface.

  1. Create a class-map to match the protocols to be blocked.
    SLAP(config)#class-map match-any P2P
    SLAP(config-cmap)#match protocol bittorrent
  2. Create a policy-map to specify what should be done with the traffic.
    SLAP(config)#policy-map P2P
    SLAP(config-pmap)#class P2P
    SLAP(config-pmap-c)#drop
  3. Apply the policy to the user-facing (incoming) interface.
    SLAP(config)#interface GigabitEthernet 0/2
    SLAP(config-if)#service-policy input P2P

You can ensure the policy is working with the show policy-map command.

SLAP#show policy-map interface g0/2 input
 GigabitEthernet0/2

  Service-policy input: P2P

    Class-map: P2P (match-any)
      994 packets, 327502 bytes
      30 second offered rate 43000 bps, drop rate 43000 bps
      Match: protocol bittorrent
        994 packets, 327502 bytes
        30 second rate 43000 bps
      drop

    Class-map: class-default (match-any)
      195253 packets, 51828774 bytes
      30 second offered rate 7282000 bps, drop rate 0 bps
      Match: any

In this example you can see that 43Kbps of BitTorrent traffic was blocked. 7.2Mbps of non-BitTorrent traffic was untouched (this is the class-default at the bottom of the output).

Unfortunately, the drop command used in the policy-map above was not introduced until IOS 12.2(13)T. If you are using a version of IOS older than 12.2(13)T, you will need to follow a not-as-simple five step process. This process relies on setting the DSCP field in the incoming packets, and then dropping those packets on the outbound interface. In the following example, we’ll block BitTorrent again, this time using the DSCP field.

  1. Create a class-map to match the protocols to be blocked.
    OLDSLAP(config)#class-map match-any P2P
    OLDSLAP(config-cmap)#match protocol bittorrent
  2. Create a policy-map to specify what should be done with the traffic.
    OLDSLAP(config)#policy-map P2P
    OLDSLAP(config-pmap)#class P2P
    OLDSLAP(config-pmap-c)#set ip dscp 1
  3. Create an access-list to block packets with the DSCP field set to 1.
    OLDSLAP(config)#access-list 100 deny ip any any dscp 1
    OLDSLAP(config)#access-list 100 permit ip any any
  4. Apply the policy to the user-facing (incoming) interface.
    OLDSLAP(config)#interface GigabitEthernet0/2
    OLDSLAP(config-if)#service-policy input P2P
  5. Apply the blocking access-list to the outbound interface.
    OLDSLAP(config)#interface POS1/1
    OLDSLAP(config-if)#ip access-group 100 out

Congratulations, you’ve successfully blocked P2P traffic on your network. Now, bolt the door and be ready for the angry mob with torches and pitchforks.

 

==========================================================

Начиная с IOS версии 12.4 (4) в Cisco стало возможным блокировать Skype. Для этого нужно создать простое правило. Также можно блокировать другие p2p приложения.

class−map match−any p2p
 match protocol skype
policy−map block−p2p
class p2p
drop

int FastEthernet0
description PIX−facing interface
service−policy input block−p2p

Если вы хотите посмотреть какие протоколы съедают ваш канал, то можно добавить в конфиг настройку:

ip nbar protocol-discovery

И потом смотреть с разбивкой по протоколам, какой тип трафика преобладает:

show ip nbar protocol-discovery stats bit-rate top-n 10

Так же можно посмотреть какие порты используют протоколы:

ip nbar port-map protocol-name [tcp | udp] port-number

Cisco PIX/ASA – Capturing Traffic

This document shows how to capture traffic directly at the Cisco PIX/ASA Firewall. Thats a very powerful tool for troubleshooting.

 

The Topology used in this test:

Capturing Traffic on the PIX — Topology

All traffic for the bastionhost (172.16.1.2) has to be captured for further analysis, the IP of the insidehost (10.0.1.12) is source-NATed to 172.16.1.20 when connecting to the DMZ.

This setup is based on the following PixOS-Release:

pix1# show version

Cisco PIX Firewall Version 6.3(3)
...
Hardware:   PIX-515, 64 MB RAM, CPU Pentium 200 MHz
Licensed Features:
Failover:                    Enabled
VPN-DES:                     Enabled
VPN-3DES-AES:                Enabled
Maximum Physical Interfaces: 6
Maximum Interfaces:          10
Cut-through Proxy:           Enabled
Guards:                      Enabled
URL-filtering:               Enabled
Inside Hosts:                Unlimited
Throughput:                  Unlimited
IKE peers:                   Unlimited

The capture-command:

pix1(config)# capture
Not enough arguments.
Usage: capture  [access-list ] [buffer ]
               [ethernet-type ] [interface ]
               [packet-length ]
               [circular-buffer]
       clear capture
       no capture  [access-list []] [circular-buffer]
               [interface ]
       show capture [ [access-list ] [count ]
                     [detail] [dump]]

Configuring the capture-function:

  1. Write an access-list that describes the interesting traffic (optional)
  2. Bind a capture-statement to an interface
  3. Wait for traffic
  4. Display or download the capture

Example:

pix1(config)# access-list capture-bastion permit ip any host bastionhost
pix1(config)# access-list capture-bastion permit ip host bastionhost any
pix1(config)# capture cap1 access-list capture-bastion interface dmz
pix1(config)#
pix1(config)# show capture
capture cap1 access-list capture-bastion interface dmz
pix1(config)#
pix1(config)# show capture cap1
0 packet captured
0 packet shown
pix1(config)#

(now we ping the bastionhost and access the web-server)

The resulting capture on the PIX:

pix1(config)# show capture cap1 detail
9 packets captured
19:28:27.554536 000d.56a9.3bbe 000c.297c.dffa 0x0800 74: 172.16.1.20 > bastionhost:
	icmp: echo request (ttl 128, id 46758)
19:28:27.555131 000c.297c.dffa 0002.b326.0704 0x0800 74: bastionhost > 172.16.1.20:
	icmp: echo reply (ttl 255, id 210)
19:28:38.482488 000d.56a9.3bbe 000c.297c.dffa 0x0800 62: 172.16.1.20.3874 > bastionhost.80:
	S [tcp sum ok] 306572975:306572975(0) win 65520  (DF)
	(ttl 128, id 46777)
19:28:38.483159 000c.297c.dffa 0002.b326.0704 0x0800 62: bastionhost.80 > 172.16.1.20.3874:
	S [tcp sum ok] 2581607285:2581607285(0) ack 306572976 win 15120
	 (DF) (ttl 64, id 211)
19:28:38.483419 000d.56a9.3bbe 000c.297c.dffa 0x0800 54: 172.16.1.20.3874 > bastionhost.80:
	. [tcp sum ok] 306572976:306572976(0) ack 2581607286 win 65520 (DF) (ttl 128, id 46778)
19:28:38.484731 000d.56a9.3bbe 000c.297c.dffa 0x0800 402: 172.16.1.20.3874 > bastionhost.80:
	P 306572976:306573324(348) ack 	2581607286 win 65520 (DF) (ttl 128, id 46779)
19:28:38.485158 000c.297c.dffa 0002.b326.0704 0x0800 60: bastionhost.80 > 172.16.1.20.3874:
	. [tcp sum ok] 2581607286:2581607286(0) ack 306573324 win 15120 (DF) (ttl 64, id 212)
19:28:38.488179 000c.297c.dffa 0002.b326.0704 0x0800 584: bastionhost.80 > 172.16.1.20.3874:
	P 2581607286:2581607816(530) ack 306573324 win 16380 (DF) (ttl 64, id 213)
19:28:38.614714 000d.56a9.3bbe 000c.297c.dffa 0x0800 54: 172.16.1.20.3874 > bastionhost.80:
	. [tcp sum ok] 306573324:306573324(0) ack 2581607816 win 64990 (DF) (ttl 128, id 46783)
9 packets shown
pix1(config)# show capture cap1 dump
13 packets captured
19:28:27.554536 172.16.1.20 > bastionhost: icmp: echo request
0x0000   4500 003c b6a6 0000 8001 29e4 ac10 0114        E..<......).....
0x0010   ac10 0102 0800 315c 0300 1900 6162 6364        ......1....abcd
0x0020   6566 6768 696a 6b6c 6d6e 6f70 7172 7374        efghijklmnopqrst
0x0030   7576 7761 6263                                 uvwabc
19:28:27.555131 bastionhost > 172.16.1.20: icmp: echo reply
0x0000   4500 003c 00d2 0000 ff01 60b8 ac10 0102        E..<......`.....
0x0010   ac10 0114 0000 395c 0300 1900 6162 6364        ......9....abcd
0x0020   6566 6768 696a 6b6c 6d6e 6f70 7172 7374        efghijklmnopqrst
0x0030   7576 7761 6263                                 uvwabc
19:28:38.482488 172.16.1.20.3874 > bastionhost.80: S 306572975:306572975(0)
    win 65520
0x0000   4500 0030 b6b9 4000 8006 e9d7 ac10 0114        E..0..@.........
0x0010   ac10 0102 0f22 0050 1245 eeaf 0000 0000        .....".P.E......
0x0020   7002 fff0 1959 0000 0204 04ec 0101 0402        p....Y..........
19:28:38.483159 bastionhost.80 > 172.16.1.20.3874: S 2581607285:2581607285(0)
    ack 306572976 win 15120
0x0000   4500 0030 00d3 4000 4006 dfbe ac10 0102        E..0..@.@.......
0x0010   ac10 0114 0050 0f22 99e0 3375 1245 eeb0        .....P."..3u.E..
0x0020   7012 3b10 10d3 0000 0204 04ec 0101 0402        p.;.............

Now we want to see more payload:

pix1(config)# clear capture cap1
pix1(config)# show capture cap1
0 packet captured
0 packet shown
pix1(config)#
pix1(config)# capture cap1 packet-length 1500
pix1(config)#
pix1(config)# show capture
capture cap1 access-list capture-bastion packet-length 1500 interface dmz
pix1(config)#

(we access the web-server again)

pix1(config)# show capture cap1 dump
...
19:40:04.374980 172.16.1.20.3876 > bastionhost.80: P 2217891186:2217891534(348)
    ack 3327525020 win 65520
0x0000   4500 0184 b868 4000 8006 e6d4 ac10 0114        E....h@.........
0x0010   ac10 0102 0f24 0050 8432 5572 c656 009c        .....$.P.2Ur.V..
0x0020   5018 fff0 4f1b 0000 4745 5420 2f66 6176        P...O...GET /fav
0x0030   6963 6f6e 2e69 636f 2048 5454 502f 312e        icon.ico HTTP/1.
0x0040   310d 0a48 6f73 743a 2031 3732 2e31 362e        1..Host: 172.16.
0x0050   312e 320d 0a55 7365 722d 4167 656e 743a        1.2..User-Agent:
0x0060   204d 6f7a 696c 6c61 2f35 2e30 2028 5769         Mozilla/5.0 (Wi
0x0070   6e64 6f77 733b 2055 3b20 5769 6e64 6f77        ndows; U; Window
0x0080   7320 4e54 2035 2e31 3b20 656e 2d55 533b        s NT 5.1; en-US;
0x0090   2072 763a 312e 372e 3529 2047 6563 6b6f         rv:1.7.5) Gecko
0x00a0   2f32 3030 3431 3130 3720 4669 7265 666f        /20041107 Firefo
0x00b0   782f 312e 300d 0a41 6363 6570 743a 2069        x/1.0..Accept: i
0x00c0   6d61 6765 2f70 6e67 2c2a 2f2a 3b71 3d30        mage/png,*/*;q=0
0x00d0   2e35 0d0a 4163 6365 7074 2d4c 616e 6775        .5..Accept-Langu
0x00e0   6167 653a 2064 652d 6465 2c64 653b 713d        age: de-de,de;q=
0x00f0   302e 382c 656e 2d75 733b 713d 302e 352c        0.8,en-us;q=0.5,
0x0100   656e 3b71 3d30 2e33 0d0a 4163 6365 7074        en;q=0.3..Accept
0x0110   2d45 6e63 6f64 696e 673a 2067 7a69 702c        -Encoding: gzip,
0x0120   6465 666c 6174 650d 0a41 6363 6570 742d        deflate..Accept-
0x0130   4368 6172 7365 743a 2049 534f 2d38 3835        Charset: ISO-885
0x0140   392d 312c 7574 662d 383b 713d 302e 372c        9-1,utf-8;q=0.7,
0x0150   2a3b 713d 302e 370d 0a4b 6565 702d 416c        *;q=0.7..Keep-Al
0x0160   6976 653a 2033 3030 0d0a 436f 6e6e 6563        ive: 300..Connec
0x0170   7469 6f6e 3a20 6b65 6570 2d61 6c69 7665        tion: keep-alive
0x0180   0d0a 0d0a                                      ....

We can transfer the capture to our workstation:

pix1(config)# copy capture:cap1 tftp://10.0.1.12/bastion.txt
copying Capture to tftp://10.0.1.12/bastion.txt:
pix1(config)#
C:TFTP-Root>dir
 Volume in drive C has no label.
 Volume Serial Number is 5001-0224

 Directory of C:TFTP-Root

16.11.2004  18:50          .
16.11.2004  18:50          ..
16.11.2004  18:49             2.754 bastion.txt
               1 File(s)          2.754 bytes
               2 Dir(s)   1.801.687.040 bytes free

C:TFTP-Root>

The capture on the workstation (viewed with notepad):

We can also export the capture in pcap-format (tcpdump):

pix1(config)# copy capture:cap1 tftp://10.0.1.12/bastion.cap pcap
copying Capture to tftp://10.0.1.12/bastion.cap:
pix1(config)#
C:TFTP-Root>dir
 Volume in drive C has no label.
 Volume Serial Number is 5001-0224

 Directory of C:TFTP-Root

16.11.2004  18:55             .
16.11.2004  18:55             ..
16.11.2004  18:55             5.747 bastion.cap
16.11.2004  18:49             2.754 bastion.txt
               2 File(s)          8.501 bytes
               2 Dir(s)   1.801.527.296 bytes free

C:TFTP-Root>

The capture on the workstation (viewd with Ethereal):

The capture can also be downloaded with a browser

If we want to view or download the capture with a browser we have to activate the https-server (thats automatically done if you have activated the PDM/ASDM). This Example shows the PIXv6 syntax:

pix1(config)# http server enable
pix1(config)#
pix1(config)# http 10.0.1.12 255.255.255.255 inside
pix1(config)#
pix1(config)# domain-name security-planet.de
pix1(config)#
pix1(config)# ca generate rsa key 1024
For  >= 1024, key generation could
  take up to several minutes. Please wait.
Keypair generation process begin.
.Success.

pix1(config)#

We can view the capture in the browser:

Or we can download the capture as pcap:

Finally we delete the capture on the PIX:

pix1(config)# no capture cap1
pix1(config)#
pix1(config)# show capture cap1
ERROR: capture  does not exist
pix1(config)# show capture
pix1(config)#

Источник: http://security-planet.de/2005/07/26/cisco-pix-capturing-traffic/

Настройка port forwarding в Cisco

Задачей будет настроить трансляцию с внешних адресов 200.100.50.56, 200.100.50.57 на адреса 192.168.1.1 — ftp сервис, 192.168.1.2 — веб сервис, 172.18.9.202 — все порты с адреса 200.100.50.57.

Схема подключения наших серверов:

Для проброса портов в Cisco PIX / ASA добавим в конфигурацию NAT-трансляцию:

FTP

static (inside,outside) tcp 200.100.50.56 ftp-data 192.168.1.1 ftp-data netmask 255.255.255.255
static (inside,outside) tcp 200.100.50.56 ftp 192.168.1.1 ftp netmask 255.255.255.255

WEB

static (inside,outside) tcp 200.100.50.56 www 192.168.1.2 www netmask 255.255.255.255 

Пробросим все порты на адрес в DMZ-зоне

static (dmz,outside) 200.100.50.57 172.18.9.202 netmask 255.255.255.255
static (dmz,inside) 200.100.50.57 172.18.9.202 netmask 255.255.255.255 

Тоже самое в IOS будет выглядеть примерно так:

ip nat inside source static tcp 192.168.1.1 21 200.100.50.56 21
ip nat inside source static tcp 192.168.1.2 80 200.100.50.56 80
ip nat inside source static tcp 172.18.9.202 200.100.50.57 extendable

Источник: http://sysadminblog.ru/cisco/2010/05/25/nastroyka-probrosa-portov-port-forwarding-v-cisco-2.html