Junos OS에서 SNMP 구성
SNMP 구성
디바이스에서 실행되는 Junos OS 소프트웨어에서 SNMP를 구현할 수 있습니다. 기본적으로 SNMP는 활성화되지 않습니다. SNMP를 활성화하려면 계층 수준에 SNMP [edit] 구성 문을 포함해야 합니다.
SNMP에 대한 최소 요구 사항을 구성하려면 계층 수준에서 [edit snmp] include 문을 포함 community public 합니다.
완전한 SNMP 기능을 구성하려면 snmp를 참조하십시오.
[edit snmp] 계층 수준의 구성 문
이 항목에서는 계층 수준에서 [edit snmp] 모든 구성 문과 구성 계층에서 해당 수준을 보여줍니다. Junos OS를 구성할 때 현재 계층 수준은 프롬프트 앞 줄의 배너에 표시됩니다.user@host#
[edit] snmp { alarm-management { alarm-list-name list-name { alarm-id id { alarm-state state { description alarm-description; notification-id notification-id-of-alarm; resource-prefix alarm-resource-prefix; varbind-index varbind-index-in-alarm-varbind-list; varbind-subtree alarm-varbind-subtree; varbind-value alarm-varbind-value; } } } } client-list client-list-name { ip-addresses; } community community-name { authorization authorization; client-list-name client-list-name; clients { address <restrict>; } logical-system logical-system-name { routing-instance routing-instance-name; clients { address <restrict>; } } routing-instance routing-instance-name { clients { address <restrict>; } } view view-name; } contact contact; description description; engine-id (local suffix-string | unique-id hex-string | use-default-ip-address | use-mac-address); } filter-duplicates; interface [ interface-names ]; location location; name name; nonvolatile { commit-delay seconds; } {rmon { alarm (SNMP RMON) index { description description; falling-event-index index; falling-threshold integer; falling-threshold-interval seconds; interval seconds; request-type (get-next-request | get-request | walk-request); rising-event-index index; rising-threshold integer; sample-type type; startup-alarm alarm; syslog-subtag syslog-subtag; variable oid-variable; } event index { community community-name; description description; type type; } } traceoptions { file filename <files number> <size size> <world-readable | no-world-readable> <match regular-expression>; flag flag; memory-trace; no-remote-trace; no-default-memory-trace; } trap-group group-name { categories { category; } destination-port port-number; routing-instance instance; logical-system logical-system-name; targets { address; } version (all | v1 | v2); } trap-options { agent-address outgoing-interface; source-address address; enterprise-oid; logical-system logical-system-name { routing-instance routing-instance-name { source-address address; } } routing-instance routing-instance-name { source-address address; } } v3 { notify name { tag tag-name; type (trap | inform); } notify-filter profile-name { oid oid (include | exclude); } snmp-community community-index { community-name community-name; security-name security-name; tag tag-name; } target-address target-address-name { address address; address-mask address-mask; logical-system logical-system; port port-number; retry-count number; routing-instance instance; tag-list tag-list; target-parameters target-parameters-name; timeout seconds; } target-parameters target-parameters-name { notify-filter profile-name; parameters { message-processing-model (v1 | v2c | v3); security-level (authentication | none | privacy); security-model (usm | v1 | v2c); security-name security-name; } } usm { local-engine { user username { authentication-md5 { authentication-password authentication-password; } authentication-none; authentication-sha { authentication-password authentication-password; } privacy-aes128 { privacy-password privacy-password; } privacy-none; } } } vacm { access { group group-name { (default-context-prefix | context-prefix context-prefiix){ security-model (any | usm | v1 | v2c) { security-level (authentication | none | privacy) { notify-view view-name; read-view view-name; write-view view-name; } } } } } security-to-group { security-model (usm | v1 | v2c) { security-name security-name { group group-name; } } } } } view view-name { oid object-identifier (include | exclude); } }
SNMP에 대한 기본 설정 구성
다음 섹션에서는 기본 SNMP 구성에 대한 정보와 Junos OS를 실행하는 디바이스에서 기본 SNMP 작업을 구성하는 몇 가지 예를 설명합니다.
SNMPv1 및 SNMPv2에 대한 기본 설정 구성
기본적으로 Junos OS를 실행하는 디바이스에서 SNMP를 활성화할 수 없습니다. Junos OS를 실행하는 디바이스에서 SNMP를 활성화하려면 계층 수준에서 [edit snmp] 문을 포함 community public 합니다.
SNMPv1 및 SNMPv2 Get 및 GetNext 운영 활성화
[edit]
snmp {
community public;
}
공공으로 정의된 커뮤니티는 모든 클라이언트에 모든 MIB 데이터에 대한 액세스 권한을 부여합니다.
디바이스에서 SNMPv1 및 SNMPv2 Set 작업을 활성화하려면 계층 수준에서 [edit snmp] 다음 문을 포함해야 합니다.
SNMPv1 및 SNMPv2 설정 운영 활성화
[edit snmp]
view all {
oid .1;
}
community private {
view all;
authorization read-write;
}
다음 예는 디바이스의 SNMPv1 및 SNMPv2 트랩에 대한 기본 최소 구성을 보여줍니다.
SNMPv1 및 SNMPv2 트랩 구성
[edit snmp]
trap-group jnpr {
targets {
192.168.69.179;
}
}
SNMPv3에 대한 기본 설정 구성
다음 예는 디바이스에서 , 및 작업을 활성화Get하기 위한 최소 SNMPv3 구성을 보여줍니다(구성은 인증이 설정됨, 개인정보 보호가 설정됨 md5 none).Set GetNext
SNMPv3 Get, GetNext 및 운영 설정
[edit snmp]
v3 {
usm {
local-engine {
user jnpruser {
authentication-md5 {
authentication-key "$9$guaDiQFnAuOQzevMWx7ikqP"; ## SECRET-DATA
}
privacy-none;
}
}
}
vacm {
security-to-group {
security-model usm {
security-name jnpruser {
group grpnm;
}
}
}
access {
group grpnm {
default-context-prefix {
security-model any {
security-level authentication {
read-view all;
write-view all;
}
}
}
}
}
}
}
view all {
oid .1;
}
다음 예제는 디바이스의 SNMPv3 알림에 대한 기본 구성을 보여줍니다(구성에는 다음에 대한 인증 및 개인정보 설정이 있음 none).
SNMPv3 정보 구성
[edit snmp]
v3 {
usm {
remote-engine 00000063200133a2c0a845c3 {
user RU2_v3_sha_none {
authentication-none;
privacy-none;
}
}
}
vacm {
security-to-group {
security-model usm {
security-name RU2_v3_sha_none {
group g1_usm_auth;
}
}
}
access {
group g1_usm_auth {
default-context-prefix {
security-model usm {
security-level authentication {
read-view all;
write-view all;
notify-view all;
}
}
}
}
}
}
target-address TA2_v3_sha_none {
address 192.168.69.179;
tag-list tl1;
address-mask 255.255.252.0;
target-parameters TP2_v3_sha_none;
}
target-parameters TP2_v3_sha_none {
parameters {
message-processing-model v3;
security-model usm;
security-level none;
security-name RU2_v3_sha_none;
}
notify-filter nf1;
}
notify N1_all_tl1_informs {
type inform; # Replace inform with trap to convert informs to traps.
tag tl1;
}
notify-filter nf1 {
oid .1 include;
}
}
view all {
oid .1 include;
}
다음 예에 표시된 것과 같이 계층 수준에서 [edit snmp v3 notify N1_all_tl1_informs] 문 값을 type 다음으로 trap 설정하여 SNMPv3 알림을 트랩으로 변환할 수 있습니다.
정보를 트랩으로 변환
user@host# set snmp v3 notify N1_all_tl1_informs type trap
또한보십시오
SNMP 세부 정보 구성
SNMP를 사용하여 연락처 이름 및 장치 위치와 같은 기본 관리 세부 정보를 저장할 수 있습니다. 그러면 문제를 해결하거나 감사를 수행할 때 관리 시스템이 원격으로 이 정보를 검색할 수 있습니다. SNMP 용어로는 MIB-2의 시스템 그룹 내에서 발견되는 sysName, sysContact, sysDescription 및 sysLocation 객체입니다(RFC 1213, TCP/IP 기반 인터넷의 네트워크 관리를 위한 관리 정보 베이스: MIB-II에 정의됨). SNMP에서 관리하는 각 시스템의 Junos OS 구성에서 직접 초기 값을 설정할 수 있습니다.
SNMP가 관리하는 디바이스의 경우, 항상 이름, 위치, 연락처 및 설명 정보를 구성하고 업데이트합니다.
SNMP 세부 정보를 설정하려면:
커밋 지연 타이머 구성
라우터 또는 스위치가 SNMP 비휘발성 Set 요청을 처음 수신하면 Junos OS XML 프로토콜 세션이 열리고 다른 사용자 또는 어플리케이션이 후보 구성을 변경하는 것을 방지합니다(명령줄 인터페이스[CLI] configure exclusive 명령과 동일). 후보 구성이 커밋되는 동안 라우터가 새로운 SNMP Set 요청을 수신하면 SNMP Set 요청이 거부되고 오류가 생성됩니다. 5초가 경과하기 전에 라우터가 새로운 SNMP Set 요청을 수신하면 커밋-지연 타이머(마지막 SNMP 요청을 받고 커밋이 요청되는 사이의 시간 길이)는 5초로 재설정됩니다.
기본적으로 타이머는 5초로 설정됩니다. SNMP Set 응답 및 커밋 시작을 위한 타이머를 구성하려면 계층 수준에서 [edit snmp nonvolatile] 문을 포함 commit-delay 합니다.
[edit snmp nonvolatile] commit-delay seconds;
seconds 는 SNMP 요청이 수신되고 커밋이 응시자 구성을 위해 요청되는 사이의 시간 길이입니다. 명령 및 구성 잠금에 대한 configure exclusive 자세한 내용은 Junos OS CLI 사용자 가이드 를 참조하십시오.
Junos OS를 실행하는 디바이스에서 SNMP 구성
기본적으로 SNMP는 Junos OS를 실행하는 디바이스에서 비활성화되어 있습니다. 라우터 또는 스위치에서 SNMP를 활성화하려면 계층 수준에 SNMP [edit snmp] 구성 문을 포함해야 합니다.
SNMP에 대한 최소 요구 사항을 구성하려면 계층 수준에서 [edit snmp] include 문을 포함 community public 합니다.
여기서 정의된 커뮤니티는 public 모든 클라이언트에 모든 MIB 데이터에 대한 읽기 액세스 권한을 부여합니다.
완전한 SNMP 기능을 구성하려면 계층 수준에서 [edit snmp] 다음 문을 포함합니다.
snmp { client-list client-list-name { ip-addresses; } community community-name { authorization authorization; client-list-name client-list-name; clients { address restrict; } routing-instance routing-instance-name { clients { addresses; } } logical-system logical-system-name { routing-instance routing-instance-name { clients { addresses; } } } view view-name; } contact contact; description description; engine-id { (local suffix-string | unique-id hex-string | use-default-ip-address | use-mac-address); } filter-duplicates; health-monitor { falling-threshold integer; interval seconds; rising-threshold integer; } interface [ interface-names ]; location location; name name; nonvolatile { commit-delay seconds; } rmon { alarm index { description text-description; falling-event-index index; falling-threshold integer; falling-threshold-interval seconds; interval seconds; request-type (get-next-request | get-request | walk-request); rising-event-index index; sample-type type; startup-alarm alarm; syslog-subtag syslog-subtag; variable oid-variable; } event index { community community-name; description text-description; type type; } } traceoptions { file filename <files number> <size size> <world-readable | no-world-readable> <match regular-expression>; flag flag; } trap-group group-name { categories { category; } destination-port port-number; routing-instance instance; targets { address; } version (all | v1 | v2); } trap-options { agent-address outgoing-interface; source-address address; } view view-name { oid object-identifier (include | exclude); } }
또한보십시오
변경 내역 표
기능 지원은 사용 중인 플랫폼과 릴리스에 따라 결정됩니다. 기능 탐색기를 사용하여 플랫폼에서 기능이 지원되는지 확인합니다.
[edit snmp] CLI에서 패킷 크기 옵션이 활성화됩니다.