[AIX 네트워크 관리 21] TCP/IP (15) DHCPv6 서버·클라이언트 구성과 릴레이 에이전트

핵심 정리

  • DHCPv6 서버는 /etc/dhcpv6/dhcpsdv6.cnf를 읽고 SRC 명령으로 시작하며, 재부팅 뒤에도 쓰려면 /etc/rc.tcpip에 넣습니다. 예: subnet dead:dead:aaaa:: 48 { option 23 … }. 키워드는 대소문자를 구분하고 {는 키워드와 같은 줄에 있어야 합니다. 예제는 /usr/samples/tcpip/dhcpv6.
  • 컨테이너는 subnet(전역에만), class(옵션 15), vendor(옵션 16), client(옵션 1 DUID), inoption(요청 옵션)이며 최대 7단계로 중첩합니다. vendor·inoption은 하위 컨테이너를 가질 수 없습니다. 선택 순서와 상속은 DHCPv4와 같습니다.
  • 로깅은 파일 맨 위의 logging_info { … }(logFileSize KB, logFileName 기본 /var/tmp/dhcpsdv6.log, numLogFiles, logItem). 전역 키워드: leaseExpiredInterval(900초), reservedTime·reservedTimeInterval, saveInterval(3600초), clientpruneintv, numprocessthreads(30), numpacketthreads(5), numloggingthreads(1), duid, preference-number(255), unicast-enable, (6.1) auth·auth-keyfile.
  • 컨테이너 옵션: range·exclude, stealfromchildren·peer·parent, balance-option·balance-policy(fill·rotate)·fill-count, interface-id. 공통 옵션: reconfig-policy, rapid-commit, prefered-lifetime(43200초), valid-lifetime(86400초), rebind(80%), renew(50%), unicast-option, option 번호 값(23 DNS 서버, 24 도메인 목록).
  • 클라이언트 /etc/dhcpv6/dhcpc6.cnf: log-로 시작하는 키워드, duid LLT|LL|EN …, info-only 인터페이스(주소 없이 구성 정보만), renew-time·rebind-time, solicit-maxcount·timeout, option ia-na|ia-ta|request-option|rapid-commit|user-class|vendor-class|vendor-opts|reconf-accept|dns-servers|domain-list, interface en1 { … }. 릴레이 /etc/dhcprd.cnf: relay IPv4|IPv6|ALL, server, server6, option6, single-site.
항목 내용
버전 AIX 5.3, AIX 6.1 (6.1에서 지연 인증 auth·auth-keyfile이 더해짐)
원문 Networks and communication management — 5.3판 200216쪽, 6.1판 279294쪽
파일 /etc/dhcpv6/dhcpsdv6.cnf, /usr/samples/tcpip/dhcpv6, /var/tmp/dhcpsdv6.log, /etc/dhcpv6/dhcpsdv6.keys, /etc/dhcpv6/dhcpc6.cnf, /etc/dhcprd.cnf, /etc/rc.tcpip
관련 명령어 dhcpsdv6, dhcpcd6, dhcprd, startsrc

기본으로 DHCP 서버는 옵션과 주소의 초기 데이터베이스를 지정하는 /etc/dhcpv6/dhcpsdv6.cnf 파일을 읽어 구성됩니다.

서버는 SRC 명령으로 시작합니다. dhcpsdv6을 재부팅 뒤에도 시작하려면 /etc/rc.tcpip 파일에 항목을 더합니다.

DHCP 서버 구성은 보통 네트워크에서 DHCP를 쓰는 데 가장 어려운 부분입니다. 먼저 어느 네트워크에 DHCP 클라이언트를 둘지 정합니다. 네트워크의 서브넷마다 DHCP 서버가 데이터베이스에 더해야 할 주소 풀이 됩니다. 예:

text
subnet dead:dead:aaaa:: 48 {
        option 23 dead::beef beef:aaaa::bbbb:c aaaa:bbbb::cccc  #nameserver list
        option 24 austin.ibm.com ibm.com                        # domain list
 }

위 예는 접두사가 48비트인 서브넷 dead:dead:aaaa::를 보여 줍니다. 이 서브넷의 모든 주소, 곧 dead:dead:aaaa::1부터 dead:dead:aaaa:ffff:ffff:ffff:ffff:ff7f까지가 풀에 들어갑니다. 줄 끝 { 앞에 범위를 지정하거나, 서브넷 컨테이너 안에 range나 exclude 문을 넣을 수도 있습니다.

주석은 #(파운드 기호)로 시작합니다. 처음 #부터 줄 끝까지의 텍스트는 DHCP 서버가 무시합니다. 각 option 줄은 서버가 클라이언트에게 무엇을 하라고 알려 줄 때 씁니다.

서버가 옵션을 해석하는 법을 모르면 기본 방법으로 클라이언트에 옵션을 보냅니다. 덕분에 DHCP 서버는 RFC에 정의되지 않았지만 특정 클라이언트나 클라이언트 구성이 쓸 수 있는 사이트 전용 옵션도 보낼 수 있습니다.

DHCPv6 구성 파일

구성 파일에는 주소 부분과 옵션 정의 부분이 있습니다. 이 부분들은 컨테이너로 옵션, 수정자, 경우에 따라 다른 컨테이너를 담습니다.

컨테이너(옵션을 묶는 방법)는 식별자로 클라이언트를 묶음으로 나눕니다. 컨테이너 종류는 subnet, class, vendor, inoption, client입니다. 지금은 사용자가 정의하는 일반 컨테이너가 없습니다. 식별자는 클라이언트를 고유하게 정의하므로, 예를 들어 클라이언트가 서브넷 사이를 옮겨 다녀도 추적할 수 있습니다. 둘 이상의 컨테이너 종류로 클라이언트 접근을 정의할 수 있습니다.

옵션은 DNS 주소나 도메인 이름처럼 클라이언트에 돌려주는 식별자입니다.

수정자를 고른 뒤에는 로깅을 설정합니다. 로깅 매개변수는 database처럼 컨테이너에 지정하지만 컨테이너 키워드는 logging_info입니다. DHCP 구성을 배울 때는 로깅을 가장 높은 수준으로 켜 두기를 권합니다. 또 로깅 하위 시스템이 초기화된 뒤 구성 오류가 기록되도록, 로깅 구성은 다른 구성 파일 데이터보다 앞에 지정하는 것이 가장 좋습니다. logitem 키워드로 로깅 수준을 켜고, logitem 키워드를 지워 끕니다. 로깅의 다른 키워드로 로그 파일 이름, 파일 크기, 돌려 쓰는 로그 파일 수를 지정할 수 있습니다.

DHCPv6 컨테이너

DHCP 서버가 요청을 받으면 패킷을 해석하고, 식별 키로 어떤 컨테이너, 옵션, 주소를 꺼낼지 정합니다.

컨테이너 종류마다 클라이언트를 식별하는 옵션이 다릅니다.

  • subnet 컨테이너는 hintlist 필드나 받은 인터페이스의 주소로 클라이언트가 어느 서브넷에 속하는지 판단합니다.
  • class 컨테이너는 옵션 15(OPTION_USER_CLASS 식별자)의 값을 씁니다.
  • vendor는 옵션 16(OPTION_VENDOR_CLASS)의 값을 씁니다.
  • client 컨테이너는 DHCP 클라이언트 DUID의 옵션 1(OPTION_CLIENTID)을 씁니다.
  • inoption 컨테이너는 클라이언트가 요청한 옵션과 맞춥니다.

서브넷을 빼고는 컨테이너마다 맞는 값을 정규식 일치를 포함해 지정할 수 있습니다.

보이지 않는 컨테이너인 global 컨테이너도 있습니다. 옵션과 수정자는 덮어쓰거나 거부하지 않는 한 global 컨테이너에 놓입니다. 대부분의 컨테이너는 다른 컨테이너 안에 둘 수 있으며, 이는 보이는 범위를 뜻합니다. 컨테이너에는 주소 범위가 있을 수도 없을 수도 있습니다. 서브넷은 본래 범위가 있습니다.

컨테이너와 하위 컨테이너의 기본 규칙은 다음과 같습니다.

  • global 수준에서는 subnet 컨테이너만 유효합니다.
  • 서브넷은 자기 자신을 포함해 다른 컨테이너 안에 둘 수 없습니다.
  • 제한된 컨테이너는 그 안에 같은 종류의 일반 컨테이너를 둘 수 없습니다(예를 들어 Accounting 클래스만 허용하는 옵션이 있는 컨테이너는, 글자 a로 시작하는 모든 클래스를 허용하는 옵션이 있는 컨테이너를 포함할 수 없습니다).
  • 제한된 client 컨테이너는 하위 컨테이너를 가질 수 없습니다.
  • inoption 컨테이너는 하위 컨테이너를 가질 수 없습니다.

이 규칙에 따라 특정 클라이언트나 클라이언트 묶음별로 옵션을 나누는 컨테이너 계층을 만들 수 있습니다.

클라이언트가 여러 컨테이너에 맞으면 DHCP 서버는 요청을 데이터베이스로 넘기고 컨테이너 목록을 만듭니다. 목록은 깊이와 우선순위 순서로 나열됩니다. 우선순위는 컨테이너 사이의 암묵적 계층으로 정해집니다. 엄격한 컨테이너가 일반 컨테이너보다 우선순위가 높습니다. client, class, vendor, subnet 순서로, 그리고 컨테이너 종류 안에서는 깊이 순서로 정렬합니다. 그러면 가장 구체적인 것부터 가장 덜 구체적인 것까지 정렬된 목록이 나옵니다. 예:

text
Subnet 1
    --Class 1
    --Client 1
Subnet 2
    --Class 1
    ----Vendor 1
    ----Client 1
    --Client 1

이 예에는 서브넷 Subnet 1과 Subnet 2가 있습니다. 클래스 이름 Class 1 하나, 벤더 이름 Vendor 1 하나, 클라이언트 이름 Client 1 하나가 있습니다. Class 1과 Client 1은 여러 곳에 정의되어 있습니다. 서로 다른 컨테이너에 있으므로 이름은 같아도 그 안의 값은 다를 수 있습니다. Client 1이 옵션 목록에 Class 1을 지정해 Subnet 1에서 DHCP 서버로 메시지를 보내면, DHCP 서버는 다음 컨테이너 경로를 만듭니다.

text
Subnet 1, Class 1, Client 1

가장 구체적인 컨테이너가 마지막에 나옵니다. 주소를 얻으려고 목록을 거꾸로 훑어 처음 쓸 수 있는 주소를 찾습니다. 그다음 옵션을 얻으려고 목록을 앞에서부터 훑습니다. 컨테이너에 option deny가 없으면 옵션은 앞의 값을 덮어씁니다. 또 Class 1과 Client 1은 Subnet 1 안에 있으므로 컨테이너 우선순위에 따라 정렬됩니다. 같은 클라이언트가 Subnet 2에서 같은 메시지를 보내면 만들어지는 컨테이너 목록은 다음과 같습니다.

text
Subnet 2, Class 1, Client 1 (at the Subnet 2 level), Client 1 (at the Class 1 level)

Subnet 2가 먼저, 그다음 Class 1, 그다음 Subnet 2 수준의 Client 1이 나옵니다(이 client 문은 계층에서 한 단계 아래에만 있기 때문입니다). 계층상 첫 client 문에 맞는 클라이언트는 Subnet 2 안 Class 1의 Client 1에 맞는 클라이언트보다 덜 구체적입니다.

계층 안의 깊이로 고른 우선순위는 컨테이너 자체의 우선순위로 바뀌지 않습니다. 예를 들어 같은 클라이언트가 같은 메시지를 보내면서 벤더 식별자를 지정하면 컨테이너 목록은 다음과 같습니다.

text
Subnet 2, Class 1, Vendor 1, Client 1 (at Subnet 2 level), Client 1 (at Class 1 level)

컨테이너 우선순위는 client 컨테이너가 클라이언트 하나 이상을 정의하는 가장 구체적인 방법이라는 일반 개념을 따르므로 검색 성능을 높입니다. class 컨테이너는 client 컨테이너보다 덜 구체적인 주소를, vendor는 그보다 덜, subnet은 가장 덜 구체적인 주소를 담습니다.

DHCPv6 주소와 주소 범위

어떤 컨테이너 종류든 주소 범위를 가질 수 있으며, 서브넷은 반드시 주소 범위가 있어야 합니다.

컨테이너 안의 각 범위는 상위 범위의 부분 집합이어야 하고 다른 컨테이너의 범위와 겹치면 안 됩니다. 예를 들어 서브넷 안에 클래스를 정의하고 그 클래스에 범위가 있으면, 그 범위는 서브넷 범위의 부분 집합이어야 합니다. 또 그 class 컨테이너 안의 범위는 같은 수준의 다른 범위와 겹치면 안 됩니다.

범위는 컨테이너 줄에 적고 range와 exclude 문으로 고쳐, 컨테이너에 떨어진 주소 묶음을 연결할 수 있습니다. 서브넷의 위쪽 열 개 주소와 그다음 열 개 주소를 쓸 수 있다면, 서브넷 절에 범위로 이 주소들을 지정해 메모리 사용과, 지정한 범위에 없는 다른 클라이언트와 주소가 충돌할 가능성을 모두 줄일 수 있습니다.

주소를 고르면 목록에서 그 뒤에 오는, 주소 범위가 있는 컨테이너는 그 자식과 함께 목록에서 빠집니다. 빠진 컨테이너의 네트워크별 옵션은 그 컨테이너 안의 주소를 쓰지 않으면 유효하지 않습니다.

DHCPv6 구성 파일 옵션

주소를 정하려고 목록을 추린 뒤 클라이언트에 줄 옵션 묶음을 만듭니다.

이 선택 과정에서 옵션은 deny를 만나지 않는 한 앞서 고른 옵션을 덮어쓰며, deny를 만나면 거부한 옵션을 클라이언트에 보낼 목록에서 뺍니다. 이 방법으로 부모 컨테이너에서 상속받아 지정해야 할 데이터의 양을 줄입니다.

DHCPv6 서버 전용 옵션

마지막으로 지정할 매개변수는 패킷 처리기 수, 가비지 수집 스레드 실행 빈도 등을 제어하는 서버 전용 옵션입니다.

예를 들어 서버 전용 옵션 두 가지는 다음과 같습니다.

옵션 설명
reservedTime DHCP 클라이언트에 ADVERTISE를 보낸 뒤 주소가 예약 상태로 남아 있는 시간
reservedTimeInterval DHCP 서버가 reservedTime보다 오래 예약 상태에 있는 주소가 있는지 주소를 훑어보는 빈도

이 옵션들은 SOLICIT 메시지를 멀티캐스트하고는 REQUEST 메시지를 멀티캐스트하지 않거나 REQUEST가 네트워크에서 사라지는 클라이언트가 여럿 있을 때 유용합니다. 이 매개변수를 쓰면 규격을 따르지 않는 클라이언트를 위해 주소가 끝없이 예약되는 일을 막습니다.

또 하나 특히 유용한 옵션은 저장 빈도를 나타내는 SaveInterval입니다.

/etc/dhcpv6/dhcpsdv6.cnf 파일

DHCPv6 서버는 /etc/dhcpv6/dhcpsdv6.cnf 파일을 편집해 구성합니다.

키워드는 대소문자를 구분합니다. {를 적을 때는 키워드와 같은 줄에 있어야 합니다. 예제 구성 파일은 /usr/samples/tcpip/dhcpv6에 있습니다.

/etc/dhcpv6/dhcpsdv6.cnf 파일에는 다음 스탠자를 쓸 수 있습니다.

  • 로깅
  • 전역 키워드
  • 중첩하지 않는 컨테이너 문
  • 중첩하는 컨테이너 문
  • 옵션
  • 공통 옵션

DHCPv6 로깅

로깅 스탠자의 항목에 쓰는 DHCPv6 서버 키워드입니다. 이 스탠자는 없어도 되지만, 있으면 구성 파일 맨 위에 있어야 합니다. 형식은 다음과 같습니다.

text
logging_info { log_options }

log_options 값은 다음 가운데 무엇이든 될 수 있습니다.

표 65. 로깅 스탠자 항목의 키워드, 값, 설명

키워드 값 설명
logFileSize num 로그 파일의 크기. num은 로그 파일의 최대 크기(KB)입니다. 이 크기에 이르면 로그 파일을 돌립니다. 지정하지 않으면 크기 제한이 없다고 봅니다.
logFileName "filename" 로그 파일의 이름. 기본 파일 이름과 위치는 /var/tmp/dhcpsdv6.log입니다.
numLogFiles num 돌려 쓸 로그 파일 수. 기본값은 0입니다.
logItem type 원하는 로깅 종류. 올바른 종류: SYSERR(플랫폼과의 인터페이스에서 난 시스템 오류), OBJERR(프로세스 안 객체 사이의 오류), PROTERR(클라이언트와 서버 사이의 프로토콜 오류), WARNING(사용자가 주의할 만한 경고), EVENT(프로세스에 일어난 이벤트), ACTION(프로세스가 한 동작), INFO(쓸모 있을 수 있는 정보), ACNTING(누구에게 언제 서비스했는지), TRACE(디버깅용 코드 흐름)

DHCPv6 전역 키워드

전역 키워드 스탠자 항목에 쓰는 키워드 값입니다. 전역 키워드는 컨테이너 밖에서만 유효합니다. 다음 값을 쓸 수 있습니다.

표 66. 전역 키워드 스탠자 항목의 키워드, 값, 설명

키워드 값 설명
UsedIpAddressExpiredInterval num [units] BAD 상태의 주소를 되찾아 다시 유효성을 시험하는 빈도. 단위를 정하지 않으면 초입니다. 기본값은 -1입니다.
leaseExpiredInterval num [units] BOUND 상태의 주소가 만료되었는지 확인하는 빈도. 만료되었으면 상태를 EXPIRED로 옮깁니다. 단위를 정하지 않으면 초이며 기본값은 900초입니다.
reservedTime num [units] 주소가 FREE 상태로 되찾아지기 전에 RESERVED 상태로 머무는 시간. 단위를 정하지 않으면 초이며 기본값은 -1입니다.
reservedTimeInterval num [units] RESERVE 상태의 주소를 FREE 상태로 되찾아야 하는지 확인하는 빈도. 단위를 정하지 않으면 초이며 기본값은 900초입니다.
saveInterval num [units] DHCP 서버가 열린 데이터베이스를 강제로 저장하는 빈도. 부하가 큰 서버는 60초나 120초로 합니다. 단위를 정하지 않으면 초이며 기본값은 3600초입니다.
clientpruneintv num [units] DHCP 서버가 어떤 주소와도 연결되지 않은(UNKNOWN 상태) 클라이언트를 데이터베이스에서 지우게 하는 빈도. DHCP 서버의 메모리 사용을 줄입니다. 단위를 정하지 않으면 초이며 기본값은 3600초입니다.
numprocessthreads num 만들 패킷 처리 스레드 수. 최소 1이며, process 스레드 하나가 클라이언트 하나를 처리합니다. 기본값은 30입니다.
numpacketthreads num 만들 패킷 스레드 수. 최소 1이며 기본값은 5입니다.
numloggingthreads num 로깅 스레드 수. 기본값은 1입니다.
numduidbuckets num table manager가 쓰며 numprocessthreads와 직접 관련됩니다. 기본값은 53입니다.
numclientbuckets num 클라이언트 레코드를 저장하는 데 쓸 버킷 수. 기본값은 1021입니다.
ignoreinterfacelist interface [interface] 무시할 인터페이스 목록. 인터페이스 하나나 여럿일 수 있습니다.
backupfile "filename" 데이터베이스 백업에 쓸 파일. 기본 파일은 /etc/dhcpv6/db_file6.crbk입니다.
checkpointfile "filename" 데이터베이스 체크포인트 파일. 첫 체크포인트 파일은 지정한 경로이고, 둘째는 경로의 마지막 글자를 2로 바꾼 것입니다. 그래서 체크포인트 파일 이름은 2로 끝나면 안 됩니다.
clientrecorddb "filename" 데이터베이스 저장 파일. DHCP 서버가 서비스한 모든 클라이언트 레코드가 들어 있습니다. 기본 파일은 /etc/dhcpv6/db_file6.cr입니다.
duid idtype value [value] 서버를 식별하는 데 씁니다. duid 1 interface, duid 2 interface, duid 3 enterprise number identifier, duid number 0xhexdigit 형식을 쓸 수 있습니다.
preference-number num 클라이언트가 정보를 얻을 서버로 이 서버를 얼마나 선호할지 알게 합니다. 값이 클수록 클라이언트가 이 서버를 쓸 가능성이 큽니다. 기본값이자 최댓값은 255입니다.
unicast-enable policy 서버의 유니캐스트 정책. 서버가 유니캐스트로 통신하게 합니다. 기본으로 켜져 있습니다.
tablemgr-policy policy 서버가 들어오는 클라이언트를 더 잘 관리하도록 table manager를 둡니다. 기본으로 켜져 있습니다.
auth policy (6.1) 서버가 지연 인증을 지원하게 합니다. 기본으로 꺼져 있습니다.
auth-keyfile "filename" (6.1) 클라이언트의 지연 인증 키가 든 파일. 기본 파일은 /etc/dhcpv6/dhcpsdv6.keys입니다.

DHCPv6 중첩하지 않는 컨테이너 문

DHCPv6 서버 키워드 subnet은 중첩하지 않는 컨테이너 문에 씁니다. 중첩하지 않는 컨테이너 문은 전역 키워드의 일부로만 있을 수 있습니다.

표 67. 중첩하지 않는 컨테이너 문 항목의 키워드, 값, 설명

키워드 값 설명
subnet subnetid prefix-length [range] {OPTIONS} 쓸 서브넷을 지정합니다. subnetid는 IPv6 주소여야 하고, prefix-length는 128보다 작은 양의 정수여야 합니다.

DHCPv6 중첩하는 컨테이너 문

중첩하는 컨테이너 문은 subnet 안의 옵션으로만 있을 수 있습니다.

따로 밝히지 않는 한 모든 컨테이너는 그 안에 다른 컨테이너를 중첩할 수 있습니다. 중첩의 최대 깊이는 subnet과 global 컨테이너를 포함해 7입니다(subnet 컨테이너 아래에는 중첩 컨테이너가 다섯 개까지만 있을 수 있습니다).

vendor와 inoption 컨테이너는 그 안에 다른 컨테이너를 중첩할 수 없습니다.

표 68. 중첩하는 컨테이너 문 항목의 키워드, 값, 설명

키워드 값 설명
class name [range] {OPTIONS|COMMON OPTIONS } class 컨테이너. name 값은 문자열 하나, 공백으로 구분한 문자열들, 정규식, 16진수 0xhexdigit입니다.
vendor name [range] {OPTIONS|COMMON OPTIONS } vendor 컨테이너. name 값은 문자열 하나, 공백으로 구분한 문자열들, 정규식, 16진수 0xhexdigit입니다.
client <id | 0 0xhexdigit | regular expression> <ip | range | none | any> {OPTIONS|COMMON OPTIONS } client 컨테이너. id는 1-hexdigit, 2-hexdigit, 3-hexdigit이고, <ip|range|none|any>는 ID가 맞는 클라이언트에 줄 IP 주소입니다.
inoption icode keytomatch [range] { OPTIONS|COMMON OPTIONS } inoption 컨테이너. icode는 클라이언트가 지정할 들어오는 옵션 코드나 번호이고, keytomatch는 맞춰 볼 옵션 데이터입니다.

DHCPv6 cnf 파일 옵션

여기 나오는 DHCPv6 cnf 파일 옵션은 컨테이너 안에만 있을 수 있습니다.

표 69. 옵션 스탠자 항목의 키워드, 값, 설명

키워드 값 설명
exclude range 현재 범위에서 뺄 IP 범위. 컨테이너 문에 범위를 지정하지 않았을 때 자주 씁니다.
exclude ip 현재 범위에서 뺄 IP 주소
range range 현재 범위를 늘리는 데 쓸 IP 범위. 컨테이너 문에 범위를 지정하지 않았을 때 자주 씁니다.
range ip 범위를 늘리려고 더할 IP 주소
stealfromchildren policy 주소가 모두 바닥나면 자식 컨테이너에서 주소를 가져옵니다. 기본으로 꺼져 있습니다.
stealfrompeer policy 주소가 모두 바닥나면 같은 수준(peer) 컨테이너에서 주소를 가져옵니다. 기본으로 꺼져 있습니다.
stealfromparent policy 주소가 모두 바닥나면 부모 컨테이너에서 주소를 가져옵니다. 기본으로 꺼져 있습니다.
balance-option { balance-policy | <option | option option ...> } 옵션 분배 컨테이너. 이 컨테이너 안에 지정한 옵션은 정책에 따라 클라이언트에 줍니다. subnet 컨테이너 아래에만 있을 수 있습니다.
balance-policy b_policy b_policy 값은 fill이나 rotate입니다. 기본값은 rotate입니다.
fill-count num 같은 옵션의 다음 인스턴스를 나눠 주기 전에 한 옵션을 줄 횟수
interface-id "interface" subnet 아래에만 쓸 수 있습니다. 이 인터페이스로 받은 클라이언트 요청만 주소를 얻을 수 있습니다.

DHCPv6 공통 옵션

DHCPv6 공통 옵션 키워드입니다. 컨테이너 안이나 전역 부분에 있을 수 있습니다.

표 70. 공통 옵션의 키워드, 값, 설명

키워드 값 설명
reconfig-policy policy 서버가 클라이언트에 재구성 메시지를 보내게 합니다. 기본으로 설정되어 있지 않으며 꺼진 것으로 봅니다.
rapid-commit policy 서버가 그 컨테이너나 전역으로 rapid commit을 하게 합니다. 기본으로 설정되어 있지 않으며 꺼진 것으로 봅니다.
prefered-lifetime num [units] IANA나 IATA의 선호 수명. 기본값은 43200초입니다.
valid-lifetime num [units] IANA나 IATA의 유효 수명. 기본값은 86400초입니다.
rebind num 주소의 rebind 시간 백분율(0~100). 기본값은 80%입니다.
renew num 주소의 renew 시간 백분율(0~100). 기본값은 50%입니다.
unicast-option policy 컨테이너가 유니캐스트로 메시지 교환을 제공하게 합니다. 서버 정책과 달라도 개별 컨테이너와 서브넷마다 켜고 끌 수 있습니다. 기본으로 설정되어 있지 않으며 꺼진 것으로 봅니다.
option num <string|strings| hex> 옵션 목록은 아래 DHCPv6 서버 파일의 알려진 옵션을 봅니다.
change-optiontable optiontable vendor 컨테이너 안에서만 쓸 수 있습니다.

DHCPv6 서버 파일의 알려진 옵션

다음은 DHCPv6 서버 파일의 알려진 옵션입니다. 지정 가능 열이 "아니요"인 옵션은 구성 파일에 지정할 수 없으며, 지정하면 무시됩니다.

번호 기본 데이터 형 지정 가능 설명
1 없음 아니요 Solicit
2 없음 아니요 Advertise
3 없음 아니요 Request
4 없음 아니요 Confirm
5 없음 아니요 Address
6 없음 아니요 Option Request
7 숫자 아니요 서버의 선호 번호
8 없음 아니요 Elapse Time
9 없음 아니요 Relay Message
11 없음 아니요 Auth
12 ASCII 문자열 yes, no, true, false 예 Unicast
13 없음 아니요 Status
14 ASCII 문자열 yes, no, true, false 예 Rapid Commit
15 없음 아니요 User Class
16 없음 아니요 Vendor Class
17 없음 아니요 Vendor Option
18 없음 아니요 Interface ID
19 없음 아니요 Reconfiguration Message
20 ASCII 문자열 yes, no, true, false 예 Reconfiguration Accept
23 공백으로 구분한 IPv6 주소 예 DNS 서버
24 ASCII 문자열 예 도메인 목록

(원문 표의 1~5행은 설명이 "지정 가능" 열에 붙어 있어 이 글에서는 설명 열로 옮겼습니다.)

DHCPv6 매개변수 값

DHCPv6 매개변수에 쓸 수 있는 값입니다.

매개변수 값
units second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years
interface en0, en1, tr0
identifier 숫자나 문자
policy yes, no, true, false
range ipv6addresss-ipv6addresss
regular expression "!epression to match$", "!epression to match^"

/etc/dhcpv6/dhcpsdv6.cnf 파일 예

다음 /etc/dhcpv6/dhcpsdv6.cnf 파일 예로 파일 내용을 대략 볼 수 있습니다.

text
logging_info{
        logFileSize 4000
        logItem     SYSERR
        logItem     PROTERR
        logItem     WARNING
        logItem     EVENT
        logItem     ACTION
        logItem     INFO
        logItem     ACNTING
        logItem     TRACE
        numLogFiles     3
        logFileName "/var/tmp/dhcpsdv6.log"
}
duid 1 en0
numprocessthreads 10
numpacketthreads  5
preference-number 255
reconfig-policy no
rapid-commit  no
unicast-option    yes
leaseExpiredInterval  3000 seconds
unicast-enable          yes
saveInterval            60 seconds
reservedTimeInterval    8000 seconds
reservedTime            10000 seconds
clientpruneintv         20  seconds
subnet bbbb:aaaa:: 40 bbbb:aaaa::0004-bbbb:aaaa::000f {
        balance-option {
               option 23 dead::beef
               option 23 beef::aaaa
               option 24 yahoo.com
        }
subnet dead:dead:aaaa:: 48 dead:dead:aaaa:aaaa::0006-dead:dead:aaaa:aaaa::000a {
        interface-id "en1"
        preferred-lifetime      100 seconds
        valid-lifetime          200 seconds
        rapid-commit  yes
        option 23 dead::beef beef:aaaa::bbbb:c aaaa:bbbb::cccc
        option 24 ibm.com austin.ibm.com
}
영어 원문

DHCPv6 configuration

By default, the DHCP server is configured by reading the /etc/dhcpv6/dhcpsdv6.cnf file, which specifies the initial database of options and addresses.

The server is started from SRC commands. If dhcpsdv6 is intended to start across reboots, add an entry into the /etc/rc.tcpip file.

Configuring the DHCP server is usually the hardest part of using DHCP in your network. First, decide what networks you want to have DHCP clients on. Each subnet in your network represents a pool of addresses that the DHCP server must add to its database. For example:

text
subnet dead:dead:aaaa:: 48 {
        option 23 dead::beef beef:aaaa::bbbb:c aaaa:bbbb::cccc  #nameserver list
        option 24 austin.ibm.com ibm.com                        # domain list
 }

The example above shows a subnet, dead:dead:aaaa::, with a prefix of 48 bits. All addresses in this subnet, dead:dead:aaaa::1 through dead:dead:aaaa:ffff:ffff:ffff:ffff:ff7f, are in the pool. Optionally, a range can be specified on the end of the line before the '{' or a range or exclude statement can be included in the subnet container.

Comments begin with a # (pound sign). Text from the initial #, to the end of the line, is ignored by the DHCP server. Each option line is used by the server to tell the client what to do.

If the server does not understand how to parse an option, it uses default methods to send the option to the client. This also allows the DHCP server to send site-specific options that are not RFC defined, but may be used by certain clients or client configurations.

DHCPv6 configuration file

The configuration file has an address section and an option definition section. These sections use containers to hold options, modifiers, and, potentially, other containers.

A container (a method to group options) uses an identifier to classify clients into groups. The container types are subnet, class, vendor, inoption, and client. Currently, there is not a generic user-definable container. The identifier uniquely defines the client so that the client can be tracked if, for example, it moves between subnets. More than one container type can be used to define client access.

Options are identifiers that are returned to the client, such as DNS address or domain names.

After selecting modifiers, the next item to set up is logging. Logging parameters are specified in a container like the database, but the container keyword is logging_info. When learning to configure DHCP, it is advisable to turn logging to its highest level. Also, it is best to specify the logging configuration before any other configuration file data to ensure that configuration errors are logged after the logging subsystem is initialized. Use the logitem keyword to turn on a logging level or remove the logitem keyword to disable a logging level. Other keywords for logging allow the specification of the log filename, file size, and the number of rotating log files.

DHCPv6 containers:

When the DHCP server receives a request, the packet is parsed and identifying keys determine which containers, options, and addresses are extracted.

Each type of container uses a different option to identify a client:

  • The subnet container uses the hintlist field or the interface address of the receiving interface to determine from which subnet the client belongs.

  • The class container uses the value in option 15 (OPTION_USER_CLASS Identifier).

  • The vendor uses the value in option 16 (OPTION_VENDOR_CLASS).

  • The client container uses the option 1 (OPTION_CLIENTID) from the DHCP client's DUID.

  • The inoption container matches the client's requested option.

Except for subnets, each container allows the specification of the value that matches it, including regular expression matching.

There is also an implicit container, the global container. Options and modifiers are placed in the global container unless overridden or denied. Most containers can be placed inside other containers implying a scope of visibility. Containers may or may not have address ranges associated with them. Subnets, by their nature, have ranges associated with them.

The basic rules for containers and subcontainers are:

  • Only subnet containers are valid at the global level.

  • Subnets cannot be placed inside other containers, including itself.

  • Restricted containers cannot have regular containers of the same type within them. (For example, a container with an option that only allows a class of Accounting cannot include a container with an option that allows all classes that start with the letter a.)

  • Restricted client containers cannot have subcontainers.

  • Inoption containers cannot have subcontainers

Given the above rules, you can generate a hierarchy of containers that segment your options into groups for specific clients or sets of clients.

If a client matches multiple containers, The DHCP server passes the request to the database, and a container list is generated. The list is presented in order of depth and priority. Priority is defined as an implicit hierarchy in the containers. Strict containers are higher priority than regular containers. Clients, classes, vendors, and subnets are sorted, in that order, and within container type by depth. This generates a list ordered by most specific to least specific. For example:

text
Subnet 1
    --Class 1
    --Client 1
Subnet 2
    --Class 1
    ----Vendor 1
    ----Client 1
    --Client 1

The example shows two subnets, Subnet 1 and Subnet 2. There is one class name, Class 1, one vendor name, Vendor 1, and one client name, Client 1. Class 1 and Client 1 are defined in multiple places. Because they are in different containers, their names can be the same but values inside them can be different. If Client 1 sends a message to the DHCP server from Subnet 1 with Class 1 specified in its option list, the DHCP server would generate the following container path:

text
Subnet 1, Class 1, Client 1

The most specific container is listed last. To get an address, the list is examined in reverse hierarchy to find the first available address. Then, the list is examined in forward hierarchy to get the options. Options override previous values unless an option deny is present in the container. Also, because Class 1 and Client 1 are in Subnet 1, they are ordered according to the container priority. If the same client is in Subnet 2 and sends the same message, the container list generated is:

text
Subnet 2, Class 1, Client 1 (at the Subnet 2 level), Client 1 (at the Class 1 level)

Subnet 2 is listed first, then Class 1, then the Client 1 at the Subnet 2 level (because this client statement is only one level down in the hierarchy). The hierarchy implies that a client matching the first client statement is less specific than the client matching Client 1 of Class 1 within Subnet 2.

Priority selected by depth within the hierarchy is not superseded by the priority of the containers themselves. For example, if the same client issues the same message and specifies a vendor identifier, the container list is:

text
Subnet 2, Class 1, Vendor 1, Client 1 (at Subnet 2 level), Client 1 (at Class 1 level)

Container priority improves search performance because it follows a general concept that client containers are the most specific way to define one or more clients. The class container holds less specific addresses than a client container; vendor is even less specific; and subnet is the least specific.

DHCPv6 addresses and address ranges:

Any container type can have associated address ranges; subnets must have associated address ranges.

Each range within a container must be a subset of the range and must not overlap with ranges of other containers. For example, if a class is defined within a subnet and the class has a range, the range must be a subset of the subnet range. Also, the range within that class container cannot overlap with any other ranges at its level.

Ranges can be expressed on the container line and modified by range and exclude statements to allow for disjoint address sets associated with a container. If you have the top ten addresses and the second ten addresses of a subnet available, the subnet can specify these addresses by range in the subnet clause to reduce both memory use and the chance of address collision with other clients not in the specified ranges.

After an address has been selected, any subsequent container in the list that contains address ranges is removed from the list along with its children. Network-specific options in removed containers are not valid if an address is not used from within that container.

DHCPv6 configuration file options:

After the list has been culled to determine addresses, a set of options is generated for the client.

In this selection process, options overwrite previously selected options unless a deny is encountered, in which case, the denied option is removed from the list being sent to the client. This method allows inheritance from parent containers to reduce the amount of data that must be specified.

DHCPv6 server-specific options:

The last set of parameters to specify are server-specific options that allow the user to control the number of packet processors, how often the garbage collection threads are run, and so on.

For example, two server-specific options are:

reservedTime Indicates how long an address stays in the reserved state after sending an ADVERTISE to the

DHCP client

reservedTimeInterval Indicates how often the DHCP server scans through the addresses to see if there are any that have been in the reserved state longer than reservedTime.

These options are useful if you have several clients that multicast SOLICIT messages and, either they do not multicast their REQUEST message, or their REQUEST message gets lost in the network. Using these parameters keeps addresses from being reserved indefinitely for a noncompliant client.

Another particularly useful option is SaveInterval, which indicates how often saves occur.

/etc/dhcpv6/dhcpsdv6.cnf file

The DHCPv6 server is configured by editing the /etc/dhcpv6/dhcpsdv6.cnf file.

The keywords are case sensitive. When a '{' is listed, it must be on the same line as the keyword. A sample configuration file can be found in /usr/samples/tcpip/dhcpv6.

Following is the description of the /etc/dhcpv6/dhcpsdv6.cnf file. The following stanzas are allowed in this file:

  • Logging

  • Global keywords

  • Non-nested container statements

  • Nested container statements

  • Options

  • Common options

DHCPv6 logging:

The DHCPv6 server keywords described here are for entries in the logging stanza.

This stanza is not required to exist but if present, must be at the top of the configuration file. It has the following format:

text
logging_info { log_options }

The log_options values can be any of the following:

Table 65. Keywords, values, and descriptions for entries in the logging stanza.

Keyword Value Description
logFileSize num Specifies the size of the log file. The num value is the maximum size of the log file in kilobytes. The log file will be rotated after this size is reached. Infinite size is assumed if logFileSize is not specified.
logFileName "filename" Specifies the name of the log file. The filename value will be the name of the log file. The default file name and location is /var/tmp/dhcpsdv6.log.
numLogFiles num Specifies the number of log files for file rotation. The default is 0.

Table 65. Keywords, values, and descriptions for entries in the logging stanza. (continued)

Keyword Value Description
logItem type Specifies the types of logging desired. The following types are valid: SYSERR System error, at the interface to the platform. OBJERR Object error, in between objects in the process. PROTERR Protocol error, between client and server. WARNING Warning, worth of attention from the user. EVENT Event occurred to the process. ACTION Action taken by the process. INFO Information that might be useful. ACNTING Who was served when. TRACE Code flow, for debugging.
DHCPv6 global keywords:

The keyword values described here are for entries in the global keyword stanza.

The global keywords are only valid outside a container. The following values are allowed:

Table 66. Keywords, values, and descriptions for entries in the global keywords stanza.

Keyword Value Description
UsedIpAddressExpiredInterval num [units] Specifies how often addresses placed in the BAD state are recouped and retested for validity. If a unit is not set, the system default is set to seconds. The default value is -1.
leaseExpiredInterval num [units] Specifies how often addresses in the BOUND state are checked to see if they have expired. If the address has expired, the state is moved to EXPIRED. If a unit is not set, the system default is set to seconds. The default value 900 seconds.
reservedTime num [units] Specifies how long addresses should sit in RESERVED state before being recouped into the FREE state. If unit is not set, the system default is set to seconds. The default value is -1.
reservedTimeInterval num [units] Specifies how often addresses in the RESERVE state are checked to see if they should be recouped into the FREE state. If unit not set, the system default is set to seconds. The default value is 900 seconds.
saveInterval num [units] Specifies how often the DHCP server should force a save of the open databases. For heavily loaded servers, this should be 60 or 120 seconds. If unit is not set, the system default is set to seconds. The default value is 3600 seconds.
clientpruneintv num [units] Specifies how often the DHCP server has the databases remove clients are not associated with any address (in the UNKNOWN state). This reduces the memory use of the DHCP server. If units is not set, the system default is set to seconds. The default value is 3600 seconds.
numprocessthreads num Specifies the number of packet processors threads to create. Minimum of one. Each processthread handles one client. By default it is 30.

Table 66. Keywords, values, and descriptions for entries in the global keywords stanza. (continued)

Keyword Value Description
numpacketthreads num Specifies the number of packet threads to create. This minimum is 1, but by default it is set to 5.
numloggingthreads num Specifies the number of logging threads. Default is 1.
numduidbuckets num This is used by the table manager, and has a direct correlation to the numprocessthreads. By default, it is set to 53.
numclientbuckets num How many buckets will be used to store the client records. By default it is 1021.
ignoreinterfacelist interface [interface] List of interfaces to ignore. It can be a single interface or multiple interfaces.
backupfile "filename" The file to use for database backups. The default file is /etc/dhcpv6/db_file6.crbk
checkpointfile "filename" Specifies the database checkpoint files. The first checkpoint file is the path. The second checkpoint file is path with the last character replaced with a 2. So, the checkpoint file should not end in 2.
clientrecorddb "filename" Specifies the database save file. The file contains all the client records the DHCP server has serviced. The default file is /etc/dhcpv6/db_file6.cr
duid idtype value [value] Used to identify the server. The following values are allowed: • duid 1 interface • duid 2 interface • duid 3 enterprise number identifier • duid number 0xhexdigit
preference-number num Allows the clients to identify the server it prefers to obtain information from. The higher the value, the greater the chance the client will use this server for its services. The default and maximum value is 255.
unicast-enable policy Unicast policy for the server, this allows the server to communicate using unicast. By default this is turned on.
tablemgr-policy policy Allows the server to have a table manager to better manage incoming clients. By default this is turned on.
auth policy Allows the server to support delayed authentication. By default this is turned off.
auth-keyfile "filename" The file that contains the delayed authentication keys for the clients. The default file is /etc/dhcpv6/dhcpsdv6.keys.

DHCPv6 non-nested container statements:

The DHCPv6 server keyword subnet is for entries in the non-nested container statements.

Non-nested container statements can only exist as part of the global keywords.

Table 67. Keywords, values, and descriptions for entries in the non-nested container statements.

  • subnet — subnetid prefix-length [range] {OPTIONS} Specifies subnet to be used. The subnetid must be an IPv6 address. The prefix-length must be a positive integer less than 128.
  • DHCPv6 nested container statements:

Nested container statements can only exist as an option inside subnet.

All containers can have other containers nested within it unless otherwise stated. The maximum depth of nesting is seven, including the subnet and the global container (only five nested containers can exist under a subnet container).

Vendor and Inoption containers cannot have any other containers nested within it.

Table 68. Keywords, values, and descriptions for entries in the nested container statements.

Keyword Value Description
class name [range] {OPTIONS|COMMON OPTIONS } Class container. The name value is one string, space separated strings, regular expression, hex 0xhexdigit, 0xhexdigit
vendor name [range] {OPTIONS|COMMON OPTIONS } Vendor container. The name value is one string, space separated strings, regular expression, hex 0xhexdigit, 0xhexdigit
client <id | 0 0xhexdigit | regular expression> <ip | range | none | any> {OPTIONA|COMMON OPTIONS } Client container. id- 1-hexdigit, 2-hexdigit, 3-hexdigit <ip|range|none|any> - IP address to give to clients that match the ID
inoption icode keytomatch [range] { OPTIONS|COMMON OPTIONS } Inoption container icode - incoming option code or number to be specified by the client keytomatch - The option data to be matched against.

DHCPv6 cnf file options:

The cnf file options described here for DHCPv6 can only exist inside a container.

Table 69. Keywords, values, and descriptions for entries in the options stanza.

Keyword Value Description
exclude range IP range to exclude from the current range, often used when a range is not specified as part of the container statement
exclude ip IP address to exclude from the current range
range range IP range use to extend the current range, often used when a range is not specified as part of the container statement
range ip IP address to add, used to extend the range
stealfromchildren policy Steal address from children containers if all addresses are exhausted. By default this is turned off.
stealfrompeer policy Steal addresses from peer containers if all addresses are exhausted. By default this is turned off.
stealfromparent policy Steal addresses from parent containers if all addresses are exhausted. By default this is turned off.
balance-option { balance-policy | <option | option option ...> } Balance options container, options specified within this container will be given to the client base on the policy. This keyword can only exist under the subnet container.
balance-policy b_policy The b_policy value can be fill or rotate. The default is rotate.
fill-count num The number of times an option will be given out before handing out the next instance of the same option
interface-id "interface" This can only be listed under subnet. Clients requests received on this interface will be allowed to obtain addresses.
DHCPv6 common options:

These keywords are common DHCPv6 options.

These can exist inside the containers or in the global section:

Table 70. Keywords, values, and descriptions for common options.

Keyword Value Description
reconfig-policy policy Allows the server to send reconfiguration message to the client. By default this is not set and is considered off.
rapid-commit policy Allows for the server to do rapid commit for the container or globally set. By default this is not set and is considered off.
prefered-lifetime num [units] The preferred lifetime of the IANA or IATA. The default is 43200 seconds.
valid-lifetime num [units] The valid lifetime of the IANA or IATA. The default is 86400 seconds.
rebind num The rebind time percent 0-100 for the address. The default value is 80 percent.
renew num The renew time percent 0-100 for the address. The default value is 50 percent.
unicast-option policy Allows containers to offer message exchange by unicasting, this can use used to turn on and off individual containers and subnets even if the server policy differs. By default this is not set and is considered off.
option num <string|stings| hex> For the list of options, see “DHCPv6 server file known options.”
change-optiontable optiontable Only allowed within a vendor container.
DHCPv6 server file known options:

The known file options of the DHCPv6 server are described here.

The following options are the DHCPv6 server file known options. The options that have "No" in the Can Specify column cannot be specified in the configuration file; if they are specified, they will be ignored.

Option number Default data type Can specify? Description
1 None No Solicit
2 None No Advertise
3 None No Request
4 None No Confirm
5 None No Address

6 None No Option Request 7 number No The preference number of the server 8 None No Elapse Time 9 None No Relay Message 11 None No Auth 12 ASCII string yes, no, true, false Yes Unicast 13 None No Status 14 ASCII string yes, no, true, false Yes Rapid Commit 15 None No User Class 16 None No Vendor Class 17 None No Vendor Option 18 None No Interface ID 19 None No Reconfiguration Message 20 ASCII string yes, no, true, false Yes Reconfiguration Accept 23 Space separated IPv6 addresses Yes DNS servers

24 ASCII string Yes Domain list

DHCPv6 parameter values:

These values can be used for the DHCPv6 parameters.

units: second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years

interface: en0, en1, tr0

identifier: numbers or characters

policy: yes, no, true, false

range: ipv6addresss-ipv6addresss

regular expression: "!epression to match$", "!epression to match^"

Example /etc/dhcpv6/dhcpsdv6.cnf file:

The sample /etc/dhcpv6/dhcpsdv6.cnf file shown here provides a glimpse of the file's contents.

(40줄짜리 예는 위 한글 본문에 그대로 실었습니다.)

DHCPv6 클라이언트 구성

DHCPv6 클라이언트는 /etc/dhcpv6/dhcpc6.cnf 파일로 구성합니다.

이 파일에 지정할 수 있는 지시어는 다음과 같습니다. dhcpcd6을 재부팅 뒤에도 시작하려면 /etc/rc.tcpip 파일에 항목을 더합니다.

로깅 키워드

올바른 로깅 키워드는 다음과 같습니다(원문은 DHCPv6 서버의 키워드라고 적음).

표 71. 로깅 키워드와 설명

키워드 설명
log-file-name 가장 최근 로그 파일의 경로와 이름. 덜 최근의 파일 이름에는 1부터 (n-1)까지 번호가 붙으며, 번호가 클수록 덜 최근의 파일입니다.
log-file-size 로그 파일의 최대 크기(KB). 가장 최근 로그 파일이 이 크기에 이르면 이름을 바꾸고 새 파일을 만듭니다.
log-file-num 가장 최근 로그 파일이 log-file-size에 이르러 이름을 바꾸고 새 파일을 만들 때 유지할 로그 파일의 최대 수
log-item 기록할 로그 항목. SYSERR(시스템 오류), OBJERR(객체 오류), PROTERR(프로토콜 오류), WARNING(경고), EVENT(일어난 이벤트), ACTION(프로세스가 한 동작), INFO(추가 정보), ACNTING(누구에게 언제 서비스했는지), TRACE(코드 흐름, 디버깅)

DUID 키워드

DUID 항목에 쓰는 키워드 값입니다. DUID 항목의 형식은 다음과 같습니다.

text
duid  <duid_type> <value>  <value> ...

DUID 종류는 키워드나 숫자로 적을 수 있어, 앞으로 정의될 DUID 종류도 쓸 수 있습니다. 지금 RFC 3315가 정의한 DUID 종류는 세 가지입니다.

표 72. DUID 항목의 키워드와 값

키워드 설명
LLT DUID-LLT 종류(값 1)
LL DUID-LL(값 2)
EN DUID-EN 종류(값 3)

DUID 항목의 구체적인 형식은 쓰는 키워드에 따라 다릅니다.

text
duid  LLT    <interface name>
duid  LL     <interface name>
duid  EN     <enterprise number>  <enterprise identifier>
duid  <number>  <hex data (prefixed with ’0x’)

정보 전용 키워드

정보 전용 키워드의 형식은 info-only interface name입니다.

표 73. 정보 전용 키워드와 설명

키워드 설명
info-only interface name 클라이언트가 서버에서 주소가 아니라 구성 정보만 얻어야 할 인터페이스 이름을 지정합니다.

임대 갱신과 rebind 키워드

임대 갱신과 rebind 키워드입니다(원문은 DHCPv6 서버의 키워드라고 적음).

표 74. 임대 갱신과 rebind 키워드와 설명

키워드 설명
rebind-time value (서버가 응답하지 않아) 클라이언트가 임대를 갱신하지 못했을 때, 다른 서버에 연락해 임대를 rebind할 시각
renew-time value 임대를 갱신하려고 클라이언트가 임대 정보를 얻은 서버에 연락할 시각

solicit 재전송 키워드

solicit 재전송 키워드에는 solicit-maxcount와 solicit-timeout이 있습니다.

표 75. solicit 재전송 키워드와 설명

키워드 설명
solicit-maxcount 서버에서 응답을 받기 전에 클라이언트가 서버로 보내는 solicit 메시지 수
solicit-timeout 서버에서 응답을 받기 전에 클라이언트가 서버로 solicit 메시지를 보내려 시도하는 시간

옵션 키워드

옵션 키워드가 'interface' 스탠자 밖에 있으면 전역으로 보며 모든 인터페이스에 적용됩니다. 'interface' 스탠자 안에 있으면 그 인터페이스에만 적용됩니다.

옵션 스탠자의 형식은 다음과 같습니다.

text
option <keyword | option code>
option <keyword | option code> exec "exec string"
option <keyword | option code> { option specific parameters }
option <keyword | option code> { option specific parameters } exec "exec string"

옵션 코드는 IANA에 등록된 옵션 코드로 지정할 수 있습니다. 그러나 일부 옵션은 다음 키워드로도 지정할 수 있습니다.

키워드 옵션 코드
ia-na 3
ia-ta 4
request-option 6
rapid-commit 14
user-class 15
vendor-class 16
vendor-opts 17
reconf-accept 20
dns-servers 23
domain-list 24

키워드마다의 설명은 다음과 같습니다.

키워드 설명
ia-na 옵션 3. 지정하면 클라이언트가 서버에 임시가 아닌 주소를 요청합니다. 형식: option ia-na [ { parameters } ] [ exec "exec string" ]. 매개변수: ia-id value, renew-time value, rebind-time value. 사용자가 원하는 값을 지정하는 선택 매개변수이며, 값은 10진수나 '0x'를 붙인 16진수입니다.
ia-ta 옵션 4. 지정하면 클라이언트가 서버에 임시 주소를 요청합니다. 형식: option ia-ta [ { parameters } ] [ exec "exec string" ]. 매개변수: ia-id value(선택, 10진수나 '0x'를 붙인 16진수)
request-option 옵션 6. 지정하면 클라이언트가 서버에 옵션 목록을 요청합니다. 형식: option request-option { parameters } [ exec "exec string" ]. 매개변수는 공백으로 구분한 옵션 코드(10진수) 목록입니다.
rapid-commit 옵션 14. 지정하면 클라이언트가 Solicit-Reply 메시지 교환을 할 준비가 되어 있음을 알립니다. 형식: option rapid-commit [exec "exec string"]. 선택 exec 문 말고는 매개변수가 없습니다.
user-class 옵션 15. 지정하면 클라이언트가 자기가 나타내는 사용자나 응용 프로그램의 종류를 알립니다. 형식: option user-class { parameters } [ exec "exec string" ]. 매개변수(필수)는 user class 데이터 하나 이상이며, 각각 길이 제한 없는 문자열입니다(공백이 있으면 따옴표로 감쌈). 형식은 class value class value입니다.
vendor-class 옵션 16. 지정하면 클라이언트가 실행 중인 하드웨어의 제조사를 알립니다. 형식: option vendor-class { parameters } [ exec "exec string" ]. 매개변수(필수)는 제조사의 등록 Enterprise 번호와 vendor class 데이터 하나 이상(하드웨어 구성의 특성을 설명하는 문자열)이며 형식은 vendor-id value class value class value입니다.
vendor-opts 옵션 17. 지정하면 클라이언트가 벤더 전용 정보를 서버에 알립니다. 형식: option vendor-opts <enterprise-number> { parameters } [ exec "exec string" ]]. 매개변수(필수)는 등록 Enterprise 번호와 vendor option 데이터 하나 이상(벤더 옵션 코드와 문자열·16진 옵션 데이터)이며 형식은 vendor-id value option opcode option-data option opcode option-data입니다.
reconf-accept 옵션 20. 지정하면 클라이언트가 서버의 reconfigure 메시지를 받아들일지 서버에 알립니다. 형식: option reconf-accept [ { exec "exec string" } ]. exec 문 말고는 매개변수가 없습니다.
dns-servers 옵션 23. 지정하면 클라이언트가 선호하는 DNS 서버 묶음을 서버에 알립니다. 형식: option dns-servers [ { parameters } ] [ exec "exec string" ]. 매개변수는 공백이나 줄로 구분한 IPv6 주소 목록입니다.
domain-list 옵션 24. 지정하면 클라이언트가 선호하는 도메인 목록을 알립니다. 형식: option domain-list [ { parameters } ] [ exec "exec string" ]. 매개변수는 공백이나 줄로 구분한 도메인 이름 문자열 목록입니다.

인터페이스 키워드

인터페이스 키워드의 형식은 interface <interface name> [ { option declaration/s } ]입니다.

표 76. 인터페이스 키워드와 설명

  • interface <interface name> [ { option declaration/s } ]: interface 문은 옵션 선언 하나 이상을 인수로 받습니다. interface 스탠자 안에 지정한 옵션은, 모든 인터페이스에 적용되는 interface 스탠자 밖의 옵션과 달리 이 인터페이스에만 적용됩니다.
  • 예: interface en1 { option ia-na { ia-id 01 renew-time 0x40 rebind-time 0x60 } option request-option { 3 23 24 } option user-class { class ibm class "userclassA and B" class "userclassB" } option vendor-class { vendor-id 1234 class "vendorclassA" class "vendorclassB" } option vendor-opts { vendor-id 2343 option 89 vendoroption89 option 90 vendoroption90 } option reconf-accept
영어 원문

DHCPv6 client configuration

The /etc/dhcpv6/dhcpc6.cnf file is used to configure the DHCPv6 clients.

The directives that can be specified in this file are included here. If dhcpcd6 is intended to start across reboots, add an entry into the /etc/rc.tcpip file.

Logging keywords

The valid logging keywords of the DHCPv6 server are described here.

The following keywords are valid:

Table 71. Keywords and descriptions for logging keywords.

  • log-file-name — The path and file name of the most recent log file. The less recent filenames have number 1 to (n-1) appended to the filename; the larger the number the less recent the file.
  • log-file-size — Specifies the maximum size of a log file in KB. When the size of the most recent log file reaches this value, it is renamed and a new file is created.
  • log-file-num — Specifies the maximum number of log files maintained when the size of the most recent log file reaches the log-file-size value and the file is renamed to generate a new file.
  • log-item — Specifies the log items that need to be logged. SYSERR System error OBJERR Object error PROTERR Protocol error WARNING Warning EVENT Event occurred ACTION Action taken by the process INFO Additional information ACNTING Who was served when TRACE code flow, debugging

DUID keywords

The following keyword values are for DUID entries.

The format of the DUID entries are as follows:

text
duid  <duid_type> <value>  <value> ...

DUID type can be a keyword or a number, leaving room for any DUID types that may be defined in future. There are three DUID types currently defined by RFC 3315 :

Table 72. Keywords and values for DUID entries.

  • LLT — DUID-LLT type (value 1)
  • LL — DUID-LL (value 2)
  • EN — DUID-EN type (value 3)

The specific format of the DUID entries depends on the keyword being used.

text
duid  LLT    <interface name>
duid  LL     <interface name>
duid  EN     <enterprise number>  <enterprise identifier>
duid  <number>  <hex data (prefixed with ’0x’)

Information-only keyword

The information-only keyword is in the format info-only interface name.

Following is the information-only keyword:

Table 73. Keyword and description of the information-only keyword.

  • info-only interface name — This keyword specifies the interface name for which the client has to obtain only configuration information and not addresses from the server.

Lease renewal and rebind keywords

The lease renewal and rebind keywords described here are for the DHCPv6 server.

Table 74. Keywords and descriptions for lease renewal and rebind keywords

  • rebind-time value — In the event of the client failing to renew its lease (because the server does not respond), the rebind-time specifies the time at which the client contacts the other servers to rebind the lease.
  • renew-time value — The renew-time specifies the time at which the client contacts the server from which the client obtained lease information, in order to renew the lease.

Solicit retransmission keywords

The solicit retransmission keywords include solicit-maxcount and solicit-timeout.

Table 75. Keywords and descriptions for solicit retransmission keywords

  • solicit-maxcount — The solicit-maxcount keyword specifies the number of solicit messages that the client sends to the server before the client receives a response from the server.
  • solicit-timeout — The solicit-timeout keyword specifies the time until which the client attempts to send solicit message to the server before the client receives a response from the server.

Option keywords

If the option keywords appear outside of 'interface' stanzas, then they are considered global. Such options apply to all interfaces. If the option keywords appear inside 'interface' stanzas, these options apply only to that interface.

The options stanza follows this format:

text
option <keyword | option code>
option <keyword | option code> exec "exec string"
option <keyword | option code> { option specific parameters }
option <keyword | option code> { option specific parameters } exec "exec string"

An option code can be specified using the IANA registered option code. However, some of the options can also be specified using keywords shown below:

  • ia-na — 3
  • ia-ta — 4
  • request-option — 6
  • rapid-commit — 14
  • user-class — 15
  • vendor-class — 16
  • vendor-opts — 17
  • reconf-accept — 20
  • dns-servers — 23
  • domain-list — 24

Additional explanation of each keyword follows:

Keyword Purpose, format, and parameters ia-na Purpose Specifies option 3. If specified, the client requests for non-temporary addresses from the server. Format option ia-na [ { parameters } ] [ exec "exec string" ] Parameters Option ia-na takes the following parameters:

ia-id value renew-time value rebind-time value

These parameters specify the user-preferred values and are optional. The value specified can be a decimal number or a hex number prefixed with '0x'

ia-ta Purpose Specifies option 4. If specified, the client requests for a temporary addresses from the server. Format option ia-ta [ { parameters } ] [ exec "exec string" ] Parameters option ia-ta takes the following parameters:

ia-id value

This parameter specifies the user's preferred values and is optional. The value specified can be a decimal number or a hex number prefixed with '0x'

Keyword Purpose, format, and parameters request-option Purpose Specifies option 6. If specified, the client requests a list of options from the server. Format option request-option { parameters } [ exec "exec string" ] Parameters option request-option takes a space separated list of option codes (in decimal) as the argument rapid-commit Purpose Specifies option 14. If specified, the client indicates that the client is prepared to perform the Solicit-Reply message exchange. Format option rapid-commit [exec "exec string"] Parameters Does not take any parameters other than the optional exec statement user-class Purpose specifies option 15. If specified, the client indicates the type or category of user or applications it represents. Format option user-class { parameters } [ exec "exec string" ] Parameters Option user-class takes one or more instances of user class data. Each instance of user class data is a quoted or unquoted string of arbitrary length. If a string contains a blank space, it must be enclosed in quotes. The parameters are required. The format for the parameter is:

class value class value

where value is a quoted or unquoted string.

vendor-class Purpose Specifies option 16. If specified, the client indicates the vendor that manufactured the hardware on which the client is running. Format option vendor-class [ exec "exec string" ] Parameters Option vendor-class takes the vendor's registered Enterprise number and one or more instances of vendor class data. Each instance of vendor class data is a quoted or unquoted string of arbitrary length, each of which describes some characteristic of the client's hardware configuration. The parameters are not optional. The format is:

vendor-id value class value class value

where value is a quoted or unquoted string.

vendor-opts Purpose Specifies option 17. If specified, the client indicates the vendor-specific information to the server. Format option vendor-opts <enterprise-number> { parameters } [ exec "exec string" ]] Parameters Option vendor-opts takes the vendor's registered Enterprise number and one or more instances of vendor option data. Each instance of vendor option data is a vendor option code followed by a option data in string or hex format. The parameters are not optional. The format is:

vendor-id value option opcode option-data option opcode option-data

where option-data is a quoted or non-quoted or a hex string (prefixed with '0x')

Keyword Purpose, format, and parameters reconf-accept Purpose Specifies option 20. If specified, the client indicates to the server whether the client is willing to accept reconfigure message from the server. Format option reconf-accept [ { exec "exec string" } ] Parameters option reconf-accept takes no option specific parameters, other than the exec statement. dns-servers Purpose specifies option 23. If specified, the client indicates to the server the preferred set of DNS servers Format option dns-servers [ { parameters } ] [ exec "exec string" ] Parameters option dns-servers takes a space/line separated list of IPv6 addresses as argument. domain-list Purpose specifies option 24. If specified, the client indicates the preferred domain list. Format option domain-list [ { parameters } ] [ exec "exec string" ] Parameters option domain-list takes a space/line separated list of domain name strings.

Interface keywords

The interface keyword is in the format interface <interface name> [ { option declaration/s } ].

Table 76. Keyword and description for the interface keywords.

  • interface <interface name> [ { option declaration/s } ] — The interface statement takes one or more option declarations as arguments. These options, specified within interface stanza are specific to this interface, unlike the options declared outside of the interface stanza, which apply to all the interfaces.
  • interface en1 { option ia-na { ia-id 01 renew-time 0x40 rebind-time 0x60 } option request-option { 3 23 24 } option user-class { class ibm class "userclassA and B" class "userclassB" } option vendor-class { vendor-id 1234 class "vendorclassA" class "vendorclassB" } option vendor-opts { vendor-id 2343 option 89 vendoroption89 option 90 vendoroption90 } option reconf-accept

DHCP 릴레이 에이전트

/etc/dhcprd.cnf 파일은 DHCP와 BOOTP 릴레이 에이전트의 구성 파일입니다. 파일의 형식과 쓸 수 있는 지시어와 키워드는 다음과 같습니다.

지시어는 다음 형식으로 지정합니다.

text
< keyword > < value1 > ... < valueN >

릴레이 에이전트가 시작하거나 다시 시작할 때 이 매개변수의 유무와 값을 씁니다.

이 매개변수 묶음은 이 서버가 유지할 로그 파일을 지정합니다. 매개변수마다 키워드로 식별하고 뒤에 값이 옵니다.

키워드 값 정의
numLogFiles 0~n 로그 파일 수. 0이면 로그 파일을 유지하지 않으며 로그 메시지를 어디에도 표시하지 않습니다. n은 가장 최근 로그 파일이 최대 크기에 이르러 새 로그 파일을 만들 때 유지하는 로그 파일의 최대 수입니다.
logFileSize KB 단위 로그 파일의 최대 크기. 가장 최근 로그 파일이 이 크기에 이르면 이름을 바꾸고 새 로그 파일을 만듭니다.
logFileName 파일 경로 가장 최근 로그 파일의 이름. 덜 최근의 로그 파일 이름에는 1부터 (n - 1)까지 번호가 붙으며, 번호가 클수록 덜 최근의 파일입니다.
logItem 기록할 항목 하나 SYSERR(플랫폼과의 인터페이스에서 난 시스템 오류), OBJERR(프로세스 안 객체 사이의 오류), PROTERR(클라이언트와 서버 사이의 프로토콜 오류), WARNING(사용자가 주의할 만한 경고), EVENT(프로세스에 일어난 이벤트), ACTION(프로세스가 한 동작), INFO(쓸모 있을 수 있는 정보), ACNTING(누구에게 언제 서비스했는지), TRACE(디버깅용 코드 흐름)

예를 들어 /etc/dhcprd.cnf 파일에는 다음 항목이 들어갈 수 있습니다.

text
numLogFiles  4
logFileSize  1000
logFileName    /usr/tmp/dhcprd.log
logItem     SYSERR
logItem     OBJERR
logItem     PROTERR
logItem     WARNING
logItem     EVENT
logItem     ACTION
logItem     INFO
logItem     ACNTING
logItem     TRACE
키워드 값 정의
relay IPv4, IPv6, ALL 패킷 릴레이 모드. IPv4면 DHCPv4 릴레이 에이전트로만 동작하며 이것이 기본 모드입니다. IPv6면 DHCPv6 릴레이 에이전트로만 동작합니다. ALL이면 DHCPv4와 DHCPv6 릴레이 에이전트로 모두 동작합니다.
server IP 주소 BOOTP나 DHCP 서버의 IP 주소. 패킷은 이 파일에 나열한 서버로 전달됩니다.
server6 IPv6 주소 DHCPv6 서버의 IPv6 주소. 패킷은 여기 나열한 서버로 전달됩니다.
option6 <option code> <option data> DHCPv6 릴레이 에이전트 옵션. 릴레이 모드가 IPv6일 때만 유효합니다. 옵션 코드는 10진수로, 옵션 데이터는 따옴표가 있거나 없는 문자열이나 16진수(0x 접두사)로 지정합니다.
single-site 릴레이 에이전트가 실행되는 장치가 한 사이트에만 속함을 지정합니다.
영어 원문

DHCP relay agent

The /etc/dhcprd.cnf file is the configuration file for the DHCP and BOOTP relay agent. The format of the file and the allowed directives and keywords are explained here.

The directives are specified in the following format:

text
< keyword > < value1 > ... < valueN >

The presence and values of these parameters are used by the relay agent that is started or restarted.

This set of parameters specifies the log files that will be maintained by this server. Each parameter is identified by a keyword and followed by its value.

Keyword Value Definition
numLogFiles 0 to n Number of log files. If 0 is specified, no log file will be maintained and no log message is display anywhere. n is the maximum number of log files maintained as the size of the most recent log file reaches its maximum size and a new log file is created.
logFileSize In KB Maximum size of a log file. When the size of the most recent log file reaches this value, it is renamed and a new log file is created.
logFileName file path Name of the most recent log file. Less recent log files have the number 1 to (n - 1) appended to their names; the larger the number, the less recent the file.
logItem One item that will be logged. SYSERR System error, at the interface to the platform. OBJERR Object error, in between objects in the process. PROTERR Protocol error, between client and server. WARNING Warning, worth of attention from the user. EVENT Event occurred to the process. ACTION Action taken by the process. INFO Information that might be useful. ACNTING Who was served when. TRACE Code flow, for debugging.

For example, an /etc/dhcprd.cnf file may have the following entries:

text
numLogFiles  4
logFileSize  1000
logFileName    /usr/tmp/dhcprd.log
logItem     SYSERR
logItem     OBJERR
logItem     PROTERR
logItem     WARNING
logItem     EVENT
logItem     ACTION
logItem     INFO
logItem     ACNTING
logItem     TRACE
Keyword Value Definition
relay IPv4, IPv6, or ALL Specifies the mode of packet relay. If IPv4 is specified, the relay agent acts only as DHCPv4 relay agent. This is the default mode of the relay agent. If IPv6 is specified, the relay agent acts only as DHCPv6 relay agent. If ALL is specified, the relay agent acts both as DHCPv4 and DHCPv6 relay agent.
server IP address Specifies the IP address of a BOOTP or DHCP server. The packet will be forwarded to the servers listed in this file.
server6 IPv6 address Specifies the IPv6 address of the DHCPv6 server. The packet will be forwarded to the servers listed here.
option6 <option code> <option data> Specifies the DHCPv6 relay agent options. The keyword is valid only if the relay mode is set to IPv6. The option code value is specified as a decimal number. The option data value is specified as quoted or non-quoted string or in hexadecimal format (prefixed with 0x)
single-site Specifies that the device on which the relay agent is running belongs to only one site.