User Tools

Site Tools


qnote:junos

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
qnote:junos [2017/04/17 12:07] – [Перенести кусок конфигурации с одного srx на другой] kqnote:junos [2021/08/12 08:35] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ===== Быстрые заметки по Junos ===== ===== Быстрые заметки по Junos =====
 +
 +==== Анализ проблемы с pppoe ====
 +
 +В одном офисе перестал работать pppoe канал в интернет.\\
 +Со стороны провайдера было видно srx, но не проходила аутентификация. 
 +
 +При установлении pppoe соединения маршрутизаторы общаются по протоколу [[https://ru.wikipedia.org/wiki/LCP|LCP]] - Link Control Protocol. \\ 
 +Что бы разобраться в проблеме надо посмотреть обмен LCP сообщениями. 
 +
 +Смотрим трафик на интерфейсе к которому подключен провайдер.\\
 +<code>
 +root@srx> monitor traffic interface pp0.0 extensive count 100
 +</code>
 +
 +Начало новой сессии, srx послылает запрос на согласование (Conf-Request) параметров (опций) подключения. 
 +<code>
 +18:03:52.248235 Out 
 +        ...
 +        -----original packet-----
 +        54:e0:32:00:00:01 > 00:1e:67:00:00:02, ethertype PPPoE S (0x8864), length 36: PPPoE  [ses 37713]LCP (0xc021), length 16: LCP, Conf-Request (0x01), id 70, length 16
 +        encoded length 14 (=Option(s) length 10)
 +        0x0000: c021 0146 000e 
 +          MRU Option (0x01), length 4: 1492
 +            0x0000: 05d4 
 +          Magic-Num Option (0x05), length 6: 0x5665bd0c
 +            0x0000: 5665 bd0c 
 +</code>
 +
 +Провайдер согласился с предложенными значениям параметров (Conf-Ack). 
 +<code>
 +18:03:52.268010  In 
 +        ...
 +        -----original packet-----
 +        00:1e:67:00:00:02 > 54:e0:32:00:00:01, ethertype PPPoE S (0x8864), length 60: PPPoE  [ses 37713]LCP (0xc021), length 16: LCP, Conf-Ack (0x02), id 70, length 16
 +        encoded length 14 (=Option(s) length 10)
 +        0x0000: c021 0246 000e 
 +          MRU Option (0x01), length 4: 1492
 +            0x0000: 05d4 
 +          Magic-Num Option (0x05), length 6: 0x5665bd0c
 +            0x0000: 5665 bd0c 
 +</code>
 +
 +Провайдер предложил следующую пачку опций, в т.ч. и метот аутентификации - PAP (Auth-Prot Option). 
 +<code>
 +18:03:54.132155  In 
 +        ...
 +        -----original packet-----
 +        00:1e:67:00:00:02 > 54:e0:32:00:00:01, ethertype PPPoE S (0x8864), length 60: PPPoE  [ses 37713]LCP (0xc021), length 37: LCP, Conf-Request (0x01), id 2, length 37
 +        encoded length 35 (=Option(s) length 31)
 +        0x0000: c021 0102 0023 
 +          PFC Option (0x07), length 2: 
 +          MRU Option (0x01), length 4: 1492
 +            0x0000: 05d4 
 +          Magic-Num Option (0x05), length 6: 0x2840ee38
 +            0x0000: 2840 ee38 
 +          Auth-Prot Option (0x03), length 4: PAP
 +            0x0000: c023 
 +          MRRU Option (0x11), length 4: 2048
 +            0x0000: 0800 
 +          12-Bit seq # Option (0x12), length 2: 
 +          End-Disc Option (0x13), length 9: MAC 00:1e:67:00:00:03
 +            0x0000: 0300 1e67 0278 27
 +</code>
 +
 +SRX не согласился (Conf-Reject) с предложенными провайдером значениями папаметров,  и послал список неугодных опций. 
 +<code>
 +18:03:54.132528 Out 
 +        ...
 +        -----original packet-----
 +        54:e0:32:00:00:01 > 00:1e:67:00:00:02, ethertype PPPoE S (0x8864), length 43: PPPoE  [ses 37713]LCP (0xc021), length 23: LCP, Conf-Reject (0x04), id 2, length 23
 +        encoded length 21 (=Option(s) length 17)
 +        0x0000: c021 0402 0015 
 +          PFC Option (0x07), length 2: 
 +          MRRU Option (0x11), length 4: 2048
 +            0x0000: 0800 
 +          12-Bit seq # Option (0x12), length 2: 
 +          End-Disc Option (0x13), length 9: MAC 00:1e:67:00:00:03
 +            0x0000: 0300 1e67 0278 27
 +</code>
 +
 +Провайдер еще раз предлагает метот аутентификации PAP (Auth-Prot Option)
 +<code>
 +18:03:54.134273  In 
 +        ...
 +        -----original packet-----
 +        00:1e:67:00:00:02 > 54:e0:32:00:00:01, ethertype PPPoE S (0x8864), length 60: PPPoE  [ses 37713]LCP (0xc021), length 20: LCP, Conf-Request (0x01), id 3, length 20
 +        encoded length 18 (=Option(s) length 14)
 +        0x0000: c021 0103 0012 
 +          MRU Option (0x01), length 4: 1492
 +            0x0000: 05d4 
 +          Magic-Num Option (0x05), length 6: 0x2840ee38
 +            0x0000: 2840 ee38 
 +          Auth-Prot Option (0x03), length 4: PAP
 +            0x0000: c023 
 +</code>
 +
 +SRX поправляет и предлагает CHAP (Auth-Prot Option). 
 +<code>
 +18:03:54.134654 Out 
 +        ...
 +        -----original packet-----
 +        54:e0:32:00:00:01 > 00:1e:67:00:00:02, ethertype PPPoE S (0x8864), length 31: PPPoE  [ses 37713]LCP (0xc021), length 11: LCP, Conf-Nack (0x03), id 3, length 11
 +        encoded length 9 (=Option(s) length 5)
 +        0x0000: c021 0303 0009 
 +          Auth-Prot Option (0x03), length 5: CHAP, MD5
 +            0x0000: c223 05
 +</code>
 +
 +Последние два сообщения еще раз десять ходят в обе стороны и потом согласование параметров начинается заново. \\ 
 +После осозная проблемы связались с провайдером и попросили переделать аутентификацию на CHAP.  
 +
 +----
 +
 +==== TCP-RST в настройках зоны безопасности ====
 +
 +tcp-rst - Send RST for NON-SYN packet not matching TCP session
 +
 +<code>
 +[edit]
 +root@bluebox# set security zones security-zone TRUST ?   
 +Possible completions:
 +  <[Enter]>            Execute this command
 +> address-book         Address book entries
 +  application-tracking  Enable Application tracking support for this zone
 ++ apply-groups         Groups from which to inherit configuration data
 ++ apply-groups-except  Don't inherit configuration data from these groups
 +  description          Text description of zone
 +> host-inbound-traffic  Allowed system services & protocols
 +> interfaces           Interfaces that are part of this zone
 +  screen               Name of ids option object applied to the zone
 +  tcp-rst              Send RST for NON-SYN packet not matching TCP session
 +  |                    Pipe through a command
 +</code>
 +
 +==== Посмотреть тип железа и серийник ====
 +**show chassis hardware**
 +<code>
 +[edit security utm]
 +root@msk-02-srx2# run show chassis hardware
 +Hardware inventory:
 +Item             Version  Part number  Serial number     Description
 +Chassis                                AU3911AF0XXX      SRX100H
 +Routing Engine   REV 18   750-021773   AT3911AF0XXX      RE-SRX100H
 +FPC 0                                                    FPC
 +  PIC 0                                                  8x FE Base PIC
 +Power Supply 0
 +
 +</code>
 +
 +==== dhcp helper ====
 +<code>
 +[edit]
 +admin@nsk-01-srx2# show forwarding-options
 +...
 +helpers {
 +    bootp {
 +        server 192.168.10.22;
 +        server 192.168.9.12;
 +        vpn;
 +        interface {
 +            vlan.502;
 +            vlan.504;
 +            vlan.501;
 +            vlan.506;
 +        }
 +    }
 +}
 +</code>
 +
 +==== host inbound traffic - bootp, dhcp ====
 +
 +<code>
 +[edit security zones security-zone trust]
 +admin@msk-04-srx1# show
 +interfaces {
 +    vlan.501 {
 +        host-inbound-traffic {
 +            system-services {
 +                ping;
 +                traceroute;
 +                ssh;
 +                dhcp;
 +            }
 +        }
 +    }
 +    vlan.502 {
 +        host-inbound-traffic {
 +            system-services {
 +                ping;
 +                traceroute;
 +                bootp;
 +            }
 +        }
 +    }
 +</code>
 +
 +**bootp** - надо использовать когда на srx настроен dhcp хелпер ([edit forwarding-options helpers bootp]).\\
 +**dhcp** - надо использовать когда на самом srx настроен dhcp сервер. 
 +
 +==== Juniper open dns server ====
 +<code>
 +name-server {
 +    208.67.222.222;
 +    208.67.220.220;
 +}
 +</code>
 +
 +==== Схема прохождения пакета через srx  ==== 
 +{{workbook:jno-332:junos-flow-module.png?600}}
 +
 +==== Подрезать скорость  ==== 
  
 ==== Скрыть часть конфига ====  ==== Скрыть часть конфига ==== 
Line 479: Line 690:
 ---- ----
  
-==== Сброс пароля для 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>". 
- 
-<code> 
-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>  
-</code> 
- 
-** Задаем новый пароль root, применяем конфигурацию и перезагружаемся ** 
-<code> 
-root> configure  
-Entering configuration mode 
- 
-[edit] 
-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! 
-</code> 
- 
-Подробное описание процедуры:\\ 
-http://www.juniper.net/documentation/en_US/junos13.3/topics/task/configuration/authentication-root-password-recovering.html 
- 
----- 
  
 ==== Посмотреть загрузку cpu ==== ==== Посмотреть загрузку cpu ====
qnote/junos.1492420027.txt.gz · Last modified: (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki