четверг, 27 января 2011 г.

Настройка QoS на ASA Cisco 5505

Всем привет!
Как обычно бывает вдруг решили сделать HotSpot или по простому бесплатный WiFi для наших клиентов, а за одно и правильно обезопасить свою рабочую беспроводную сеть...
Но про безопасную сеть на WPA2-Enterprice я напишу чуть попозже, а в этом посте уже окончание работы - ограничение использования Интернет трафика "халявщиками" :) Ведь не секрет, что если только позволить - то эти дорогие наши клиенты "забьют" канал по самое "не могу" и качество Интернет сервисов для трудящихся станет ниже плинтуса.
Самое правильное - "порезать" канал, т.е. установить ограничение для тех, кто этого достоин.
В моей инфраструктуре на периметре стоит железка Cisco ASA 5505 с Security Plus лицензией, т.е. позволяющей и криптовать трафик и использовать до 20 vlan-ов. Вот в один из портов и приходит патч-корд по которому "течет" трафик от WiFi Free пользователей. На данный порт прикреплен vlan интерфейс через который все и происходит. По совету "старших тогаищей" я не стал пробовать shaping трафика, да и честно признаться, я не уверен, что моя железка умеет это делать в полном смысле этого слова. Поэтому все решал через QoS и Police. Как вы, наверное, знаете при конфигурировании QoS необходимо выполнить 3 этапа:
1. Создать Policy-Map
2. Сконфигурировать приоритет(-ы) этой Policy-Map, причем, это делается через ACL
3. Связать полученную Policy-Map с тем интерфейсом, на котором нам нужен QoS
А теперь немного листинга с cisco.com:

Step 1 To add or edit a policy map, enter the following command:

hostname(config)# policy-map name

For example:

hostname(config)# policy-map QoS_policy

Step 2 To configure priority queueing, enter the following commands:

hostname(config-pmap)# class priority_map_name
hostname(config-pmap-c)# priority

where the priority_map_name is the class map you created for prioritized traffic in "Identifying Traffic for QoS Using Class Maps" section.

For example:

hostname(config)# class-map priority-class
hostname(config-cmap)# match tunnel-group Tunnel-Group-1
hostname(config-cmap)# match dscp ef
hostname(config-cmap)# policy-map QoS_policy
hostname(config-pmap)# class priority_class
hostname(config-pmap-c)# priority

Step 3 To configure policing, enter the following commands:

hostname(config-pmap)# class policing_map_name
hostname(config-pmap-c)# police {output | input} conform-rate [conform-burst]
[conform-action [drop | transmit]] [exceed-action [drop | transmit]]

where the policing_map_name is the class map you created for prioritized traffic in "Identifying Traffic for QoS Using Class Maps" section.

The conform-burstargument specifies the maximum number of instantaneous bytes allowed in a sustained burst before throttling to the conforming rate value, between 1000 and 512000000 bytes.

The conform-action keyword sets the action to take when the rate is less than the conform_burst value.

The conform-rate argument sets the rate limit for this traffic flow; between 8000 and 2000000000 bits per second.

The drop keyword drops the packet.

The exceed-action keyword sets the action to take when the rate is between the conform-rate value and the conform-burst value.

The input keyword enables policing of traffic flowing in the input direction.

The output keyword enables policing of traffic flowing in the output direction.

The transmit keyword transmits the packet.

For example:

hostname(config)# class-map policing-class
hostname(config-cmap)# match any
hostname(config-cmap)# policy-map QoS_policy
hostname(config-pmap)# class police_class
hostname(config-pmap-c)# police output 56000 10500

Step 4 To activate the policy map on one or more interfaces, enter the following command:

hostname(config)# service-policy policymap_name {global | interface interface_name}

Where global applies the policy map to all interfaces, and interface applies the policy to one interface. Only one global policy is allowed.

Interface service policies take precedence over the global service policy for a given feature. For example, if you have a global policy with inspections, and an interface policy with TCP normalization, then both inspections and TCP normalization are applied to the interface. However, if you have a global policy with inspections, and an interface policy with inspections, then only the interface policy inspections are applied to that interface.

Более детально - вот здесь

понедельник, 10 января 2011 г.

Делаем собственную службу в Windows 2008 R2

Всем привет!
Как обычно, на заметку, что часто бывает надо не не сразу сможешь найти... Сегодня мне очень надо было сделать из простой программы службу Windows, да и Бог-то с ней скажет кто-то, но в Windows Server 2008 R2 не все так просто и легко, как было в Windows 2000 или даже в Windows 2003... Помните - ResKit? Еще бы! Я его тоже помню и даже люблю... :) И вот, решил я поставить обычный TFTP сервер простенький и дешевенький как службу на могучий серваГ Win2k8R2... SrvAny - не проходит, пришлось искать обходные пути и я их нашел! Итак, как ставить свою службу на Windows 2008 R2 (сразу хочу сказать, что я просто копирую решение, ссылко на первоисточник - в конце :))

Here's what to do ...

1.At the time of this posting, there is no Windows Server 2008 Resource Kit Tools, so get the "srvany.exe " from the "Windows Server 2003 Resource Kit Tools " and copy it to a suitable location on your Win2008 server (e.g. C:\Windows\System32\ ).
2.Use "sc " to create a new service that launches "srvany " (e.g. sc create MyService binPath= C:\Windows\System32\srvany.exe DisplayName= "My Custom Service" )
3.Using RegEdit : create a "Parameters " key for your service (e.g. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MyService\Paramaters\ )
4.Using RegEdit : within the newly created "Parameters " key , create a string value called "Application " and enter the full path to the application you are wanting to run as a service. (No quotes required.)

And that should do it.

Note : some applications store their settings in a user hive, not under HKEY_LOCAL_MACHINE, so you will need to run the application to configure it, and then configure the service to run as that user.

Enjoy!

Надеюсь, вам это поможет, как и мне - действительно все работает! :)))
Ссылка здесь
Дружно говорим спасибо Graeme.N!