20150219

Быстрые заметки по procurve.


6. Сбрость конфиг. 
Из cli. 
Дать команду erase startup-config.

Находясь перед коммуатором.
-- Одновременно нажать кнопки reset и clear.
-- Отпустить кнопку reset когда зажгутся лампочки Power и Fault
Кнопку clear продолжаем держать. 
-- Когда начнут мигать лампочки линков на портах (запустится процесс само тестирования) можно отпускать кнопку clear. 

To execute the factory default reset on the switch, perform these steps:
1. Using pointed objects, simultaneously press both the Reset and Clear buttons on the front of the switch. The power and fault lights come on.
2. Continue to press the Clear button while releasing the Reset button.
3. When the Self Test LED begins to flash, release the Clear button.
The switch will then complete its self test and begin operating with its configuration restored to the factory default settings.
 
5. Сбросить незначительные\временные ошибки. 
Нажать reset.


Resetting the switch
When the switch is powered on. This action clears any temporary error  conditions that may have occurred and executes the switch self test.


4. Сбросить пароли. 
Нажать на одну секунду кнопку clear.
Конфинурация при этом не сбросится.  

Deleting Passwords 
When pressed by itself for at least one second, the button deletes any switch console access passwords that you may have configured. Use this feature if you have misplaced the password and need console access. This button is provided as a convenience, however if you are concerned with the security of the switch configuration and operation, you should make sure the switch is installed in a secure location. This button can be disabled by a CLI command.

3. Копирование конфигурации через com порт. 
Сидим на коммутторе через minicom, надо залить на него конфигурацию из бэкапа или с другого коммутатора. 
-- 


2. Перенос конфигурации между двумя коммутаторами. 
Есть два коммутатора hp2626-1 и hp2626-2. Надо перенести конфирурацию с hp2626-1 на hp2626-2
-- Копируем на tftp сервер конфигурацию коммутатора hp2626-1.
hp2626-1# copy startup-config tftp x.x.x.x hp2626-1-config

-- При необходимости редактируем файл hp2626-1-config, меняем hostname, ip адреса и пр.

-- Копируем с tftp сервера конфигурацию на коммутатор hp2626-2.
hp2626-2# copy tftp startup-config x.x.x.x hp2626-1-config
Device may be rebooted, do you want to continue [y/n]? y
Rebooting switch...

##Если на коммутаторе hp2626-1 был включен ssh и https, а на коммутаторе hp2626-2 нет, то возникнет следующая ошибка:

"line: 8. https cannot be enabled with no certificate present. To install a
self-signed certificate,
  * Use 'crypto key generate...' to install RSA key; then
  * Use 'crypto host-cert generate...' to install certificate.

line: 168. ssh cannot be enabled until a host key is configured (use 'crypto' command).
Corrupted download file."

Для решения проблемы создаем ключи и сертификаты для ssh и https:

hp2626-2(config)# crypto key generate ssh
Installing new RSA key.  If the key/entropy cache is

depleted, this could take up to a minute.

hp2626-2(config)# crypto key generate cert 1024 
Installing new RSA key.  If the key/entropy cache is
depleted, this could take up to a minute.

hp2626-m9(config)# crypto host-cert generate self-signed 
 MM/DD[/[YY]YY]        Validity start date for certificate.
 <cr>
Validity start date [01/01/1990]: 02/01/2015
Validity end date   [02/01/2016]: 02/01/2025
Common name            [0.0.0.0]: hp2626-2
Organizational unit  [Dept Name]: IT-Dept
Organization      [Company Name]: IT-Comp
City or location  [City]: Moscow
State name               [State]: MOW
Country code                [US]: RU

Пробуем еще раз загрузить новую конфигурацию:hp2626-2# copy tftp startup-config x.x.x.x hp2626-1-config
Device may be rebooted, do you want to continue [y/n]? y

Rebooting switch...




1. Обновление коммутатора.
-- Проверяем, что в обоих флешках у нас одинаковая версия софта, при необходимости копируем софт из primary флешки в secondary.

hp2626# sh flash
Image           Size(Bytes)   Date   Version
-----           ----------  -------- -------
Primary Image   : 3431516   08/22/07 H.10.45
Secondary Image : 2142958   05/19/03 H.07.31
Boot Rom Version: H.08.02
Current Boot    : Primary

hp2626# copy flash flash secondary

hp2626# sh flash
Image           Size(Bytes)   Date   Version
-----           ----------  -------- -------
Primary Image   : 3431516   08/22/07 H.10.45
Secondary Image : 3431516   08/22/07 H.10.45:
Boot Rom Version: H.08.02
Current Boot    : Primary

-- C tftp сервера закачиваем на коммутатор свежий софт.

hp2626# copy tftp flash x.x.x.x H_10_115.swi
...
Validating and Writing System Software to FLASH...
...

hp2626# sh flash
Image           Size(Bytes)   Date   Version
-----           ----------  -------- -------
Primary Image   : 3525464   04/09/14 H.10.115
Secondary Image : 3431516   08/22/07 H.10.45:
Boot Rom Version: H.08.02
Current Boot    : Primary

-- Задаем флешку с которой будем загружаться.
hp2626# boot system flash primary

##Коммутатор предложит перегрузиться. 

-- Если коммутатор загрузился и все хорошо, то копируем новый софт на secondary флешку.


20150206

Установка и настройка связки Rancid+ViewVC

Статья переехала -> https://mykb.ru/doku.php?id=topic:rancid


Rancid
-- Доставляем необходимые пакеты
# yum install cvs expect gcc MySQL-python telnet

-- Скачиваем и распаковываем свежую версию Rancid.
# wget ftp://ftp.shrubbery.net/pub/rancid/rancid-3.1.tar.gz
# tar -zxvf rancid-3.1.tar.gz

-- Добавляем группу netadm в которую впоследствии будет добавлен пользователь apache.
# groupadd netadm

-- Создаем пользователя rancid и задаем ему пароль.
# useradd -g netadm -d /home/rancid rancid
# passwd rancid

-- Компилируем и устанавлваем rancid.
# pwd
/root/src/rancid-3.1

# ./configure --prefix=/home/rancid
# make install

-- Копируем файл в котором будут содержаться пароли от сетевого оборудования и выставляем права.
# cp /root/src/rancid-3.1/cloginrc.sample /home/rancid/.cloginrc
# chmod 0640 /home/rancid/.cloginrc
# chown -R rancid:netadm /home/rancid/
# chmod 770 /home/rancid/

-- В файле rancid.conf определяем группы сетевого оборудование.
# su - rancid
$ cp ~/etc/rancid.conf ~/etc/rancid.conf.orig
$ joe ~/etc/rancid.conf
...
# list of rancid groups
#LIST_OF_GROUPS="sl joebobisp"
# more groups...
#LIST_OF_GROUPS="$LIST_OF_GROUPS noc billybobisp"
LIST_OF_GROUPS="cisco juniper"
#
...

-- Создаем CVS репозиторий для ранее определенных групп.
$ /home/rancid/bin/rancid-cvs

-- Прописываем оборудование с которых будем снимать конфигурацию.
$ joe ~/var/juniper/router.db
...
srx-test;juniper;up

...
## Обращаем внимание, что в версиях rancid после 3.x в качестве разделителя используется ";".

-- Задаем пользователя, пароль и ip адрес для захода на сетевое оборудование
$ joe ~/.cloginrc
...
add method srx-test ssh
add user srx-test srx-user
add password srx-test srx-passwd
...

# joe /etc/hosts
...
x.x.x.x    srx-test
...

-- Вручную запускаем rancid (от пользователя rancid) и проверяем, что конфигурация снялась.
$ rancid-run -r srx-test
$ ll ~/var/juniper/configs/
total 484
drwxr-x---. 2 rancid netadm   4096 Feb  30 23:59 CVS
-rw-r-----  1 rancid netadm 488712 Feb  30 23:59 srx-test

-- Пишем правило cron для rancid.
$ crontab -e
...
# #############################################
# Crontab for rancid on myserver
# #############################################
# Hourly Check
1 * * * * /home/rancid/bin/rancid-run

# Daily Clean Up of Diff Files at 11 50 pm
50 23 * * * /usr/bin/find /home/rancid/var/logs -type f -mtime +2 -exec rm {} \;

# Daily Clean Up of .SITE.run.lock Files at 11 50 pm
50 23 * * * rm /tmp/.*.lock
...

###
### Написать про почту
###

ViewVC
-- Скачиваем и распаковываем свежую версию ViewVC.
# wget http://viewvc.tigris.org/files/documents/3330/49392/viewvc-1.1.23.tar.gz
# tar zxvf viewvc-1.1.23.tar.gz

-- Устанавливаем viewvc.
# cd viewvc-1.1.23
# ./viewvc-install
...
ViewVC file installation complete.

Consult the INSTALL document for detailed information on completing the
installation and configuration of ViewVC on your system.  Here's a brief
overview of the remaining steps:

  1) Edit the /usr/local/viewvc-1.1.23/viewvc.conf file.

  2) Either configure an existing web server to run
     /usr/local/viewvc-1.1.23/bin/cgi/viewvc.cgi.
     
     Or, copy /usr/local/viewvc-1.1.23/bin/cgi/viewvc.cgi to an
     already-configured cgi-bin directory.
     
     Or, use the standalone server provided by this distribution at
     /usr/local/viewvc-1.1.23/bin/standalone.py.
...

-- Настраиваем viewvc для работы с CVS репозиторием.
# cd /usr/local/viewvc-1.1.23/
# joe viewvc.conf
...
## Example:
## cvs_roots = cvsroot: /opt/cvs/repos1,
##             anotherroot: /usr/local/cvs/repos2
##
#cvs_roots =

cvs_roots = cvsroot: /home/rancid/var/CVS 
...
## Example:
## root_parents = /opt/svn: svn,
##                /opt/cvs: cvs
##
#root_parents =

root_parents = /home/rancid/var/CVS : cvs
...
## Example:
## rcs_dir = /usr/bin/
##
#rcs_dir =

rcs_dir = /usr/local/bin
...
## use_rcsparse: Use the rcsparse Python module to retrieve CVS
## repository information instead of invoking rcs utilities [EXPERIMENTAL]
##
use_rcsparse = 1
...

-- Копируем файлы query.cgi и viewvc.cgi в рабочую папку веб-сервера.
# cp /usr/local/viewvc-1.1.23/bin/cgi/*.cgi /var/www/cgi-bin
# ll /var/www/cgi-bin
total 8
-rwxr-xr-x. 1 root root 1782 Feb 30 23:59 query.cgi
-rwxr-xr-x. 1 root root 1781 Feb 30 21:59 viewvc.cgi

-- Правим /etc/https/conf.d/vhosts.conf
# joe /etc/https/conf.d/vhosts.conf
...
# Custom Rancid Config
<VirtualHost *:80>
        DocumentRoot /var/www
        ScriptAlias /cgi-bin/ "/var/www/cgi-bin"
        ScriptAlias /viewvc /var/www/cgi-bin/viewvc.cgi
        ScriptAlias /query /var/www/cgi-bin/query.cgi
<Directory "/var/www/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>
</VirtualHost>
...

-- Добавляем пользователя apache в группу netadm.
# joe /etc/group
...
netadm:x:5000:apache
...

-- Создаем mysql базу данных и пользователей.
# mysql -u root -p
mysql> create database viewvc_db;
mysql> create user 'viewvc_user'@'localhost' identified by 'pass1';
mysql> grant all privileges on viewvc_db.* to 'viewvc_user'@'localhost' with grant option;
mysql> create user 'viewvc_rouser'@'localhost' identified by 'pass2';
mysql> grant all privileges on viewvc_db.* to 'viewvc_rouser'@'localhost' with grant option;
mysql> flush privileges;

-- Создаем структуру базы данных viewvc_db.
# cd /usr/local/viewvc-1.1.23/bin/
# ./make-database
./make-database:20: DeprecationWarning: The popen2 module is deprecated.  Use the subprocess module.
  import popen2
MySQL Hostname (leave blank for default): 
MySQL Port (leave blank for default): 
MySQL User: viewvc_user
MySQL Password: pass1
ViewVC Database Name [default: ViewVC]: viewvc_db

Database created successfully.  Don't forget to configure the 
[cvsdb] section of your viewvc.conf file.

-- Настраиваем viewvc для работы с mysql.
# joe /usr/local/viewvc-1.1.23/viewvc.conf
...
[cvsdb]

## enabled: Enable database integration feature.
##
enabled = 1

## host: Database hostname.  Leave unset to use a local Unix socket
## connection.
##
host = localhost

## post: Database listening port.
##
port = 3306

## database_name: ViewVC database name.
##
database_name = viewvc_db

## user: Username of user with read/write privileges to the database
## specified by the 'database_name' configuration option.
##
user = viewvc_user

## passwd: Password of user with read/write privileges to the database
## specified by the 'database_name' configuration option.
##
passwd = pass1

## readonly_user: Username of user with read privileges to the database
## specified by the 'database_name' configuration option.
##
readonly_user = viewvc_rouser

## readonly_passwd: Password of user with read privileges to the database
## specified by the 'database_name' configuration option.
##
readonly_passwd = pass2
...

-- Заполняем базу данных. 
# cd /usr/local/viewvc-1.1.23/bin/
# ./cvsdbadmin rebuild /home/rancid/var/CVS/CVSROOT/
Using repository root `/home/rancid/var/CVS'
Purging existing data for repository root `/home/rancid/var/CVS'
[CVSROOT/loginfo [0 commits]]
[CVSROOT/editinfo [0 commits]]
[CVSROOT/config [0 commits]]
[CVSROOT/notify [0 commits]]
[CVSROOT/verifymsg [0 commits]]
[CVSROOT/cvswrappers [0 commits]]
[CVSROOT/rcsinfo [0 commits]]
[CVSROOT/modules [0 commits]]
[CVSROOT/commitinfo [0 commits]]
[CVSROOT/checkoutlist [0 commits]]
[CVSROOT/taginfo [0 commits]]

-- Пробуем зайти на веб-интерфейс
http://x.x.x.x/viewvc

Все должно быть хорошо.

## Нормальной работе мне мешал selinux, в чем проблема не разбирался, просто отключил.

###
###Написать про https и пароли
checking Socket.pm version... Socket version 2.006 required--this is only version 1.82 at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
configure: error: Socket.pm is older than 2.006; upgrade from http://metacpan.org/pod/Socket

cpan App::cpanminus
cpanm Socket



###

--- 

При написании заметки использовались материалы:
http://www.cj-gerow.com/ceg/?p=1900
http://ciscoskills.net/2015/01/03/install-rancid-and-viewvc-on-centos-7/

Установка и бэкап RackTables

1. Скачиваем свежий racktables.
# wget http://downloads.sourceforge.net/project/racktables/RackTables-0.20.10.tar.gz

2. Распаковываем архив.
# tar zxvf RackTables-0.20.10.tar.gz

3. Копируем файлы в директорию где будет работать racktables.
# cp -r RackTables-0.20.10/wwwroot/ /var/www/html/racktables/

4. Создаем базу racktables_db.
# mysql -u root -p
mysql> create database racktables_db;
mysql> grant all on racktables_db.* to racktables_user;
mysql> grant all on racktables_db.* to racktables_user@localhost;
mysql> set password for racktables_user@localhost=password('xxx');

5. Доставляем необходимые пакеты.
# yum install php-mbstring php-bcmath

6. Заходим браузером на http://x.x.x.x/racktables и следуем инструкциям.
Когда попросят создаем файл secret.php и задаем права.
# touch /var/www/html/racktables/inc/secret.php
# chmod 666 /var/www/html/racktables/inc/secret.php

Когда попросят меняем права и владельца для secret.php.
# chown apache:root /var/www/html/racktables/inc/secret.php
# chmod 400 /var/www/html/racktables/inc/secret.php

7. Правим /etc/httpd/conf.d/vhosts.conf
<VirtualHost *:80>
     ServerAdmin i@xxx.org
     DocumentRoot /var/www/html/racktables
     ServerName racktables.xxx.org
     ServerAlias www.racktables.xxx.org
     ErrorLog logs/racktables_err_log
     CustomLog logs/rackables_acc_log common
</VirtualHost>

8. Бэкап и восстановление.
# mysqldump -u racktables_user -p  racktables_db > racktables_db.dump
# mysql -u racktables_user -p racktables_db < racktables_db.dump

---

При написании заметки использовались материалы:
http://www.binaryroyale.com/installing-racktables/
https://wiki.racktables.org/index.php/RackTablesInstallHowto

20150205

Быстрые заметки по junos

19. Ошщибка комита при достижении максимального количества зон безопасности. 

root@srx100B# commit check
error: zone quota exceeded (usage 11 > max 10)
error: configuration check-out failed
 


18. Ошибки на физическом интерфейсе. 
http://networking.ringofsaturn.com/Routers/junipershowint.php

Input errors:
Errors: 0, Drops: 0, Framing errors: 0, Runts: 0, Policed discards: 0, L3 incompletes: 0, L2 channel errors: 0, L2 mismatch timeouts: 0, FIFO errors: 0, Resource errors: 0


Output errors:
Carrier transitions: 5, Errors: 0, Drops: 0, Collisions: 0, Aged packets: 0, FIFO errors: 0, HS link CRC errors: 0, MTU errors: 0, Resource errors: 0


Carrier transitions:
"Carrier transitions just mean the link has flapped. See the exact description from Juniper

   Carrier transitions—Number of times the interface has gone from down
     to up. This number does not normally increment quickly,
    increasing only when the cable is unplugged, the far-end system is
    powered down and then up, or another problem occurs. If the number
    of carrier transitions increments quickly (perhaps once every 10 seconds),
    the cable, the far-end system, or the PIC or PIM is malfunctioning.

You would need to do basic troubleshooting to find out why the link is flapping. Those steps would be different if it was a telco circuit or an P2P ethernet cable."

Input errors:
Errors: 468, Drops: 0, Framing errors: 468, Runts: 0, Policed discards: 71, L3 incompletes: 0, L2 channel errors: 0, L2 mismatch timeouts: 0, FIFO errors: 0, Resource errors: 0

Framing errors:
KB27597
Это ошибка в контрольнной сумме пришедшего на интерфейс пакета, пакет "бьется" и контрольные суммы отправленного и полученно пакета не совпадают.

Решение проблемы с Framing errors заключается в:
-- проверить, что с обоих концов правильно настроены скорость и дуплекс порта.
-- поменять патч-корд
-- поменять порт оборудования


Policed discards: 71
Дропаются протоколы которык не в "security interface host-inbound-traffic protocols". При случае проверить с ospf.

"Frames that the incoming packet match code discarded because they were not recognized or of interest. Usually, this field reports protocols that the JUNOS software does not handle, such as CDP."




17. Скорость создания сессий.
KB23428

root@srx2> show security monitoring fpc ?
Possible completions:
  <fpc-slot>           FPC slot number (0..0)
root@srx2> show security monitoring fpc 0 ?
Possible completions:
  <[Enter]>            Execute this command
  |                    Pipe through a command
admin@msk-01-srx2> show security monitoring fpc 0  
FPC 0
  PIC 0
    CPU utilization          :    3 %
    Memory utilization       :   57 %
    Current flow session     :  469
    Current flow session IPv4:  469
    Current flow session IPv6:    0
    Max flow session         : 524288
Total Session Creation Per Second (for last 96 seconds on average):   15
IPv4  Session Creation Per Second (for last 96 seconds on average):   15

IPv6  Session Creation Per Second (for last 96 seconds on average):    0

SNMP OID
root@srx2> show snmp mib walk .1.3.6.1.4.1.2636.3.39.1.12.1.4.1.5 
jnxJsNodeSessionCreationPerSecond.0 = 15

Когда два srx работают в режиме кластера в выводе появится строка "jnxJsNodeSessionCreationPerSecond.1 = "

root@srx2> show snmp mib walk .1.3.6.1.4.1.2636.3.39.1.12.1.4.1      
jnxJsClusterMonitoringNodeIndex.0 = 0
jnxJsClusterMonitoringNodeDescr.0 = single
jnxJsNodeCurrentTotalSession.0 = 485
jnxJsNodeMaxTotalSession.0 = 0
jnxJsNodeSessionCreationPerSecond.0 = 15
jnxJsNodeSessCreationPerSecIPv4.0 = 15
jnxJsNodeSessCreationPerSecIPv6.0 = 0
jnxJsNodeCurrentTotalSessIPv4.0 = 485
jnxJsNodeCurrentTotalSessIPv6.0 = 0

16. MOTD
Message of the day
set system login message "Privet Serega! NE PEREGRUZHAI srx! Lozhis` spat`=) WBR EKS and Levin."

15. Залить текущий junos на бэкапный раздел. 
root@srx-master> request system snapshot slice alternate
node0:
--------------------------------------------------------------------------
Formatting alternate root (/dev/ad0s1a)...

Copying '/dev/ad0s2a' to '/dev/ad0s1a' .. (this may take a few minutes)
The following filesystems were archived: /

node1:
--------------------------------------------------------------------------
Formatting alternate root (/dev/ad0s2a)...
Copying '/dev/ad0s1a' to '/dev/ad0s2a' .. (this may take a few minutes)
The following filesystems were

На кластере можно дать команду только на активной ноде.


14. Перенести кусок конфигурации с одного srx на другой. 
Будем переносить записи в address book.

Отображаем конфирацию  в set стиле.
[edit security address-book UNTRUST-BOOK]
root@srx-old# show | display set    
set security address-book UNTRUST-BOOK address perevod-korona.ru dns-name perevod-korona.ru ipv4-only
set security address-book UNTRUST-BOOK address wupos.westernunion.com dns-name wupos.westernunion.com ipv4-only
...

Подгружаем конфигурацию.
У команды load есть ключ relative который подкружает set не от корня конфигуации, а от текущего места. 
{primary:node1}[edit security address-book]
root@srx-new# load set terminal 
[Type ^D at a new line to end input]
set security address-book UNTRUST-BOOK address perevod-korona.ru dns-name perevod-korona.ru ipv4-only
set security address-book UNTRUST-BOOK address wupos.westernunion.com dns-name wupos.westernunion.com ipv4-only
...
^D

Нюансы.
Если сразу переносить много конфига, то RE возможно будет не успевать его отрабатывать и будут появляться ошибки вида - "terminal:2:(4) syntax error: address".
Проблема описана в KB15472. Как решить в линуксовом терминале пока не придумал.
Если сидеть на srx через череp minicom, то заливаться будет без ошибок - скорость соединения маленькая.


13. Обновить софт в srx
root> request system software add ?              
Possible completions:
  <package-name>       URL or pathname of package
  best-effort-load     Load succeeds if at least one statement is valid
  delay-restart        Don't restart processes
  no-copy              Don't save copies of package files
  no-validate          Don't check compatibility with current configuration
  partition            Format and re-partition the media before installation
  reboot               Reboot system after adding package
  unlink               Remove the package after successful installation

  validate             Check compatibility with current configuration

root> request system software add no-copy http://192.168.10.12/junos/junos-srxsme-12.1X47-D25.4-domestic.tgz

12. KB25265
http://kb.juniper.net/InfoCenter/index?page=content&id=KB25265

root@srx> ping ocsp.comodoca.com      
PING6(56=40+8+8 bytes) :: --> 2a02:1788:2fd::b2ff:5301
ping: sendmsg: No route to host
ping6: wrote ocsp.comodoca.com 16 chars, ret=-1
^C
--- ocsp.comodoca.com ping6 statistics ---
1 packets transmitted, 0 packets received, 100% packet loss

root@srx> ping ocsp.comodoca.com inet
PING ocsp.comodoca.com (178.255.83.1): 56 data bytes
64 bytes from 178.255.83.1: icmp_seq=0 ttl=57 time=79.415 ms
^C
--- ocsp.comodoca.com ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max/stddev = 79.415/79.415/79.415/0.000 ms

11. Записать вывод команды в файл. 
root@srx> show services application-identification application detail | save ai-app-detail
Файл запишется в домашнюю директорию пользователя.

10. Истекли лицензии  appid-sig и idp-sig. 
root@srx> show system license
License usage:
                                 Licenses     Licenses    Licenses    Expiry
  Feature name                       used    installed      needed
  av_key_kaspersky_engine               1            0           1    28 days
  dynamic-vpn                           0            2           0    permanent
  ax411-wlan-ap                         0            2           0    permanent
  appid-sig                             1            0           1    invalid
        - APPID Signature

Все ранее настроенные политики продолждают работать.
Нельзя обновить сигнатуры и верме комита увеличилось секунд на 40.

root@srx# commit
[edit security idp idp-policy Recommended rulebase-ips rule 1 match attacks]
  'predefined-attack-groups "[Recommended]IP - Critical"'
    Security Package is being used, however license is not valid/has expired. This may be in violation of policy.
commit complete

9. Смысл maximum-transactions в настройках вложенных приложений (nested applications).
nested-application my:XAKEP-SSL {
    type XAKEP;
    protocol SSL;
    signature NestedApplication:XAKEP-SSL {
        member m01 {
            context ssl-server-name;
            pattern xakep.ru;
            direction client-to-server;
        }
        maximum-transactions 1;
    }
}

maximum-transactions - максимальное количество совпадений  с "подписью" при  при достижении которого считается, что это именно это приложение. 

8. Посмотеть список и детальную информацию по типам приложений с которыми работает AppFW и IDP на srx.

root@srx> show services application-identification application summary
Application(s): 800
Nested Application(s): 981
  Applications                                 Disabled         ID      Order
  junos:ZENGUARD-SSL                            No               1987    33799
  junos:FACEBOOK-TIMELINE                       No               1986    33793
  junos:FACEBOOK-STATUS-UPDATE                  No               1985    33794
  junos:GOLFZON-MEMBERS-SSL                     No               1984    33792
  junos:AFREECA-HTTP-STREAM                     No               1982    33790
....

root@srx> show services application-identification application summary | match HTTP    
  junos:AFREECA-HTTP-STREAM                     No               1982    33790   
  junos:WECHAT-HTTP                             No               1932    33751   
  junos:SSH-OVER-HTTP                           No               1907    33586   
  junos:YAHOO-FINANCE-HTTP                      No               1896    33722   
  junos:AIM-HTTP-API                            No               1865    33700   
  junos:ALIWANGWANG-HTTP                        No               1863    33704   
  junos:BAIDU-HI-HTTP                           No               1859    33703   
  junos:GROOVE-HTTP                             No               1264    33669   
...

root@srx> show services application-identification application detail junos:YAHOO-FINANCE-HTTP
Application Name: junos:YAHOO-FINANCE-HTTP                                  
Application type: YAHOO-FINANCE-HTTP                                        
Description: This signature detects Yahoo! finance, a site from Yahoo! that provides financial news and information.
Application ID: 1896  
Disabled: No              
Number of Parent Group(s): 1    
Application Groups:
    junos:web:finance                          
Application Tags:
    characteristic        : Bandwidth Consumer                              
    characteristic        : Loss of Productivity                            
    risk                  : 2                                              
    subcategory           : Finance                                        
    category              : Web                                            
Signature NestedApplication:YAHOO-FINANCE-HTTP                          
    Layer-7 Protocol: HTTP                                              
    Chain Order: no      
    Maximum Transactions: 1                
    Order: 33722          
    Member(s): 1          
        Member 0      
            Context: http-header-host    
            Pattern: (.*\.)?finance\.yahoo\.com                        
            Direction: CTS                                

7. Посмотреть настройки стантардных junos application
root> show configuration groups junos-defaults applications

6. Посмотреть кто залогинился.
root> show system users no-resolve  
 5:38PM  up 28 days,  2:04, 4 users, load averages: 0.10, 0.06, 0.04
USER     TTY      FROM                              LOGIN@  IDLE WHAT
root     p0                                                          3:17PM   2:04 cli        
root     p1                                                          3:03PM     55 cli        
root     p2                                                          4:21PM     56 cli        
root     p3                                                          5:31PM      - cli

5. Поставить таймаут на ssh/telnet сессию.
root> set cli idle-timeout 60
Idle timeout set to 60 minutes

root> show cli
CLI complete-on-space set to on
CLI idle-timeout set to 60 minutes
CLI restart-on-upgrade set to on
CLI screen-length set to 55
CLI screen-width set to 207
CLI terminal is 'xterm'
CLI is operating in enhanced mode
CLI timestamp disabled
CLI working directory is '/cf/root'


4. Передернуть руками ноду в кластере.


root> request chassis cluster failover redundancy-group [0|1] node [0|1]

Увести RG0 на node1
root> request chassis cluster failover redundancy-group 0 node 1

После этого приоритет node1 для RG0 станет равным 255.
Что бы привести приоритет в соответствие с настройками надо дать комануду:  
root> request chassis cluster failover reset redundancy-group 0

После этого, в зависимости от настройки "Preempt", RG0 останется или на node1 или вернется на node0.


3. Сброс конфигурации junos.
[edit]
root# load factory-default  
warning: activating factory configuration

[edit]
root# set system root-authentication plain-text-password         
New password:
Retype new password:

[edit]
root# commit 
commit complete

2. Сброс пароля для root.
-- Подключиться консолью к маршрутизатору и включить его.
Дождаться "Hit [Enter] to boot immediately, or space bar for command prompt."
и нажать пробел.  Появится приглашение "loader>".

-- Загрузиться в single mode.
loader> boot -s
Kernel entry at 0x801000d8 ...

Дождаться "Enter full pathname of shell or 'recovery' for root password recovery or RETURN for /bin/sh:" и ввести команду "recovery". Ждем приглашения "root>".

NOTE: Once in the CLI, you will need to enter configuration mode using
NOTE: the 'configure' command to make any required changes. For example,
NOTE: to reset the root password, type:
NOTE:    configure
NOTE:    set system root-authentication plain-text-password
NOTE:    (enter the new password when asked)
NOTE:    commit
NOTE:    exit
NOTE:    exit
NOTE: When you exit the CLI, you will be asked if you want to reboot
NOTE: the system

Starting CLI ... 
root> 

-- Задаем новый пароль root, применяем конфигурацию и перезагружаемся. 
root> configure 
Entering configuration mode

root# set system root-authentication plain-text-password     
New password:
Retype new password:

[edit]
root# commit 
commit complete

[edit]
root# exit 
Exiting configuration mode

root> request system reboot 
Reboot the system ? [yes,no] (no) yes 

Shutdown NOW!

--
Подробное описание процедуры:
http://www.juniper.net/documentation/en_US/junos13.3/topics/task/configuration/authentication-root-password-recovering.html

1. Посмотреть загрузку cpu.
user@srx> show chassis routing-engine
Routing Engine status:
    Temperature                 57 degrees C / 134 degrees F
    Total memory              1024 MB Max   655 MB used ( 64 percent)
      Control plane memory     544 MB Max   457 MB used ( 84 percent)
      Data plane memory        480 MB Max   202 MB used ( 42 percent)
    CPU utilization:
      User                       4 percent
      Background                 0 percent
      Kernel                    10 percent
      Interrupt                  0 percent
      Idle                      85 percent
    Model                      
    Serial ID                  
    Start time                     2015-02-04 19:03:18 GMT-3
    Uptime                         26 minutes, 6 seconds
    Last reboot reason             0x200:normal shutdown
    Load averages:                 1 minute   5 minute  15 minute
                                       0.07       0.17       0.61

user@srx> show chassis forwarding      
FWDD status:
  State                                 Online  
  Microkernel CPU utilization        14 percent
  Real-time threads CPU utilization   0 percent
  Heap utilization                   42 percent
  Buffer utilization                  1 percent
  Uptime:                               22 minutes, 39 seconds