예: LAC 가입자에 대한 DHCPv6 및 ICMPv6 제어 트래픽을 제외하도록 필터 구성
이 예는 LAC에서 터널링된 가입자에 대한 유휴 시간 초과 감지를 위해 DHCPv6 및 ICMPv6 제어 패킷을 고려 대상에서 제외하는 표준 무상태 방화벽 필터를 구성하는 방법을 보여줍니다.
요구 사항
이 예를 구성하기 전에 디바이스 초기화를 제외한 특별한 구성은 필요하지 않습니다.
개요
LAC의 가입자 액세스는 가입자 세션이 설정된 후 가입자가 유휴 상태를 유지할 수 있는 최대 기간을 지정하는 유휴 타임아웃 기간을 구성하여 제한할 수 있습니다. LAC는 가입자의 업스트림 및 다운스트림 데이터 트래픽을 모니터링하여 가입자가 비활성 상태인지 여부를 판단합니다. 세션 계정 통계를 기반으로 합니다. 데이터 트래픽이 어느 방향으로든 감지되는 한 가입자는 유휴 상태로 간주되지 않습니다. 유휴 시간 초과 기간 동안 트래픽이 탐지되지 않으면 가입자는 RADIUS 시작 연결 해제 또는 CLI 시작 로그아웃과 유사하게 정상적으로 로그아웃됩니다.
그러나 L2TP 가입자에 대한 터널이 설정된 후 LAC에서 터널을 통과하는 모든 패킷은 데이터 패킷으로 처리됩니다. 결과적으로 세션에 대한 계정 통계는 정확하지 않으며 DHCPv6 및 ICMPv6 제어 패킷이 전송되는 한 가입자는 유휴 상태로 간주되지 않습니다.
Junos OS 릴리스 17.2R1부터 이러한 제어 패킷에서 일치하는 용어로 제품군에 대한 inet6 방화벽 필터를 정의할 수 있습니다. 필터 용어에 종료 작업 사용을 exclude-accounting 포함하여 이러한 제어 패킷을 삭제합니다.
구성
CLI 빠른 구성
이 예를 빠르게 구성하려면, 아래 명령을 복사하여 텍스트 파일로 붙여 넣은 다음 모든 라인브레이크를 제거하고, 네트워크 구성을 일치하는 데 필요한 세부 사항을 바꾸고 [edit] 계층 수준에서 명령을 CLI로 복사해 붙여 넣습니다.
set access profile v6-exclude-idle session-options client-idle-timeout 10 set access profile v6-exclude-idle session-options client-idle-timeout-ingress-only edit firewall family inet6 filter EXCLUDE-ACCT-INET6-FILTER set interface-specific set term EXCLUDE-ACCT-DHCP-INET6 from next-header udp set term EXCLUDE-ACCT-DHCP-INET6 from source-port 546 set term EXCLUDE-ACCT-DHCP-INET6 from source-port 547 set term EXCLUDE-ACCT-DHCP-INET6 from destination-port 546 set term EXCLUDE-ACCT-DHCP-INET6 from destination-port 547 set term EXCLUDE-ACCT-DHCP-INET6 then count exclude-acct-dhcpv6 set term EXCLUDE-ACCT-DHCP-INET6 then exclude-accounting set term EXCLUDE-ACCT-ICMP6 from next-header icmp6 set term EXCLUDE-ACCT-ICMP6 from icmp-type router-solicit set term EXCLUDE-ACCT-ICMP6 from icmp-type neighbor-solicit set term EXCLUDE-ACCT-ICMP6 from icmp-type neighbor-advertisement set term EXCLUDE-ACCT-ICMP6 then count exclude-acct-icmpv6 set term EXCLUDE-ACCT-ICMP6 then exclude-accounting set term default then accept top edit dynamic-profiles pppoe-dynamic-profile interfaces pp0 unit "$junos-interface-unit" set family inet6 filter input EXCLUDE-ACCT-INET6-FILTER set family inet6 filter output EXCLUDE-ACCT-INET6-FILTER set actual-transit-statistics
필터 구성
단계별 절차
다음 예는 구성 계층에서 다양한 수준의 탐색이 필요합니다. CLI 탐색에 대한 정보는CLI 사용자 가이드의 구성 모드에서 CLI 편집기 사용을 참조하십시오.
필터를 구성하려면 다음을 수행합니다.
가입자 세션에 대한 유휴 시간 제한을 설정합니다.
[edit access profile v6-exclude-idle] user@host# set session-options client-idle-timeout 10
유휴 시간 초과가 수신 트래픽에만 적용되도록 지정합니다.
[edit access profile v6-exclude-idle] user@host# set session-options client-idle-timeout-ingress-only
계정 통계에서 DHCPv6 제어 패킷을 제외하는 방화벽 필터 용어를 정의합니다.
첫 번째 Next Header(다음 헤더) 필드가 UDP(17)로 설정된 패킷에서 일치 항목을 지정합니다.
[edit firewall family inet6 filter EXCLUDE-ACCT-INET6-FILTER] user@host# set term EXCLUDE-ACCT-DHCP-INET6 from next-header udp
소스 포트가 546 또는 547(DHCPv6)인 패킷에서 일치 항목을 지정합니다.
[edit firewall family inet6 filter EXCLUDE-ACCT-INET6-FILTER] user@host# set term EXCLUDE-ACCT-DHCP-INET6 from source-port 546 user@host# set term EXCLUDE-ACCT-DHCP-INET6 from source-port 547
DHCP 대상 포트가 546 또는 547(DHCPv6)인 패킷에서 일치 항목을 지정합니다.
[edit firewall family inet6 filter EXCLUDE-ACCT-INET6-FILTER] user@host# set term EXCLUDE-ACCT-DHCP-INET6 from destination-port 546 user@host# set term EXCLUDE-ACCT-DHCP-INET6 from destination-port 547
일치하는 DHCPv6 패킷을 계산합니다.
[edit firewall family inet6 filter EXCLUDE-ACCT-INET6-FILTER] user@host# set term EXCLUDE-ACCT-DHCP-INET6 then count exclude-acct-dhcpv6
일치하는 DHCPv6 패킷을 계정 통계에서 제외합니다.
[edit firewall family inet6 filter EXCLUDE-ACCT-INET6-FILTER] user@host# set term EXCLUDE-ACCT-DHCP-INET6 then exclude-accounting
계정 통계에서 ICMPv6 제어 패킷을 제외하는 방화벽 필터 용어를 정의합니다.
첫 번째 다음 헤더 필드가 ICMPv6(58)로 설정된 패킷에서 일치 항목을 지정합니다.
[edit firewall family inet6 filter EXCLUDE-ACCT-INET6-FILTER] user@host# set term EXCLUDE-ACCT-ICMP6 from next-header icmp6
ICMPv6 메시지 유형의 패킷에서 일치 항목을 지정합니다.
[edit firewall family inet6 filter EXCLUDE-ACCT-INET6-FILTER] user@host# set term EXCLUDE-ACCT-ICMP6 from icmp-type router-solicit user@host# set term EXCLUDE-ACCT-ICMP6 from icmp-type neighbor-solicit user@host# set term EXCLUDE-ACCT-ICMP6 from icmp-type neighbor-advertisement
일치하는 ICMPv6 패킷을 계산합니다.
[edit firewall family inet6 filter EXCLUDE-ACCT-INET6-FILTER] user@host# set term EXCLUDE-ACCT-ICMP6 then count exclude-acct-icmpv6
일치하는 ICMPv6 패킷을 계정 통계에서 제외합니다.
[edit firewall family inet6 filter EXCLUDE-ACCT-INET6-FILTER] user@host# set term EXCLUDE-ACCT-DHCP-INET6 then exclude-accounting
다른 모든 패킷을 수락하는 기본 필터 용어를 정의합니다.
[edit firewall family inet6 filter EXCLUDE-ACCT-INET6-FILTER] user@host# set term default then accept
동적 프로필을 구성하여 제품군의 입력 및 출력 인터페이스에
inet6필터를 적용합니다.[edit dynamic-profiles pppoe-dynamic-profile interfaces pp0 unit "$junos-interface-unit"] user@host# set family inet6 filter input EXCLUDE-ACCT-INET6-FILTER user@host# set family inet6 filter output EXCLUDE-ACCT-INET6-FILTER
가입자 관리의 정확한 회계를 가능하게 합니다.
[edit dynamic-profiles pppoe-dynamic-profile interfaces pp0 unit "$junos-interface-unit"] user@host# set actual-transit-statistics
결과
구성 모드에서 show access, show firewall 및 show dynamic-profiles 명령을 입력하여 구성을 확인합니다. 출력 결과가 의도한 구성대로 표시되지 않으면 이 예의 지침을 반복하여 구성을 수정하십시오.
user@host# show access
profile v6-exclude-idle {
session-options {
client-idle-timeout 10;
client-idle-timeout-ingress-only;
}
}
user@host# show firewall
family inet6 {
filter EXCLUDE-ACCT-INET6-FILTER {
interface-specific;
term EXCLUDE-ACCT-DHCP-INET6 {
from {
next-header udp;
source-port [ 546 547 ];
destination-port [ 546 547 ];
}
then {
count exclude-acct-dhcpv6;
exclude-accounting
}
}
term EXCLUDE-ACCT-ICMP6 {
from {
next-header icmp6;
icmp-type [ router-solicit neighbor-solicit neighbor-advertisement ]
}
then {
count exclude-acct-icmpv6;
exclude-accounting;
}
}
term default {
then accept;
}
}
}
user@host# show dynamic-profiles
pppoe-dynamic-profile {
interfaces {
pp0 {
unit "$junos-interface-unit" {
actual-transit-statistics;
family inet6 {
filter {
input EXCLUDE-ACCT-INET6-FILTER;
output EXCLUDE-ACCT-INET6-FILTER;
}
}
}
}
}
}
디바이스 구성을 마쳤으면 구성 모드에서 commit을(를) 입력합니다.