dhcpcd/ko
동적 호스트 설정 프로토콜 클라이언트 데몬( D ynamic H ost C onfiguration P rotocol C lient D aemon) ( dhcpcd )은 젠투 리눅스에서 널리 사용하는 DHCP 클라이언트입니다. IPv4 설정과 IPv6 설정을 다 다루는 기능이 있습니다.
설치
USE 플래그
USE flags for net-misc/dhcpcd A fully featured, yet light weight RFC2131 compliant DHCP client
+embedded
|
Embed the definitions of dhcp options in the dhcpcd executable |
+udev
|
Enable virtual/udev integration (device discovery, power and storage device support, etc) |
debug
|
Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces |
ipv6
|
Add support for IP version 6 |
privsep
|
Enable support for privilege separation |
Emerge
dhcpcd를 설치하려면 다음 명령을 사용하십시오:
root
#
emerge --ask net-misc/dhcpcd
설정
파일
모든 dhcpcd 설정은 /etc/dhcpcd.conf 파일에 들어가지만, 최근에는 DHCP 서버가 동작하는 라우터 또는 액세스 포인트에 대부분의 컴퓨터가 붙어있다는 점을 특별히 미리 간주하여 대부분의 설치 상태 그대로인 상황에서 dhcpcd 가 동작합니다. man 5 dhcpcd.conf [1] 명령은 고급 설정 과정이 필요한 경우에 도움을 줄 수 있습니다.
정적 IP 주소
이 경우 네트워크 인터페이스 카드는 정적 IP 주소 로 설정해야하며, /etc/dhcpcd.conf 에 데이터를 추가해야합니다. [1] 다음은 원하는 편집기를 사용하여 DHCPCD 설정 파일에 직접 정적 주소, 라우팅 주소, DNS 주소를 추가해 넣는 예제입니다:
/etc/dhcpcd.conf
static ip_address=192.168.0.10/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1
IPv6 Prefix Request
/etc/dhcpcd.conf
Request a prefix for
eth0.lan
and
eth0.management
to be routed publicly with
eth0.wan
.
# Disable router solicitations for all interfaces, enable only for selected ones
noipv6rs
# Interface configuration for the wan vlan on the eth0 interface
interface eth0.wan
# Enable router solicitation for this interface
ipv6rs
# Request a normal address usins iaid 1 for interface eth0.wan
ia_na 1
# Request a prefix using iaid 2 and assign it to the eth0.lan interface using sla_id 0 and prefix size of 64
ia_pd 2 eth0.lan/0/64
# Request a prefix using iaid 3 and assign it to the eth0.management interface using sla_id 0 and prefix size of 64
ia_pd 3 eth0.management/0/64
사용법
실행
root
#
dhcpcd --help
usage: dhcpcd [-46ABbDdEGgHJKkLnpqTVw]
[-C, --nohook hook] [-c, --script script]
[-e, --env value] [-F, --fqdn FQDN] [-f, --config file]
[-h, --hostname hostname] [-I, --clientid clientid]
[-i, --vendorclassid vendorclassid] [-l, --leasetime seconds]
[-m, --metric metric] [-O, --nooption option]
[-o, --option option] [-Q, --require option]
[-r, --request address] [-S, --static value]
[-s, --inform address[/cidr]] [-t, --timeout seconds]
[-u, --userclass class] [-v, --vendor code, value]
[-W, --whitelist address[/cidr]] [-y, --reboot seconds]
[-X, --blacklist address[/cidr]] [-Z, --denyinterfaces pattern]
[-z, --allowinterfaces pattern] [interface] [...]
dhcpcd -k, --release [interface]
dhcpcd -U, --dumplease interface
dhcpcd --version
dhcpcd -x, --exit [interface]
서비스로 실행
DHCPCD로 네트워크 관리하기 를 참고하십시오.
1회용 DHCP
dhcpd can be manually started on a specific interface, such as enp1s0 with:
root
#
dhcpcd eth0
위 명령의
eth0
을 적당한 네트워크 인터페이스 이름으로 바꾸었는지 확인하십시오.
Renew a lease
To renew the lease on enp1s0 , --rebind or -n can be used:
root
#
dhcpcd -n enp1s0
Release a lease
To release a lease on enp1s0 , --release or -k can be used:
root
#
dhcpcd -k enp1s0
Troubleshooting
- dhcpcd not working for IPv6 (#CONFIG_PACKET is not set)
- If /etc/resolv.conf does not update with VPN's DNS, consider installing net-dns/openresolv .
추가 참조
- Gentoo Handbook - Network configuration - The Handbook's recommendations on handling network interfaces.
- Netifrc - Gentoo's own network configuration scripts.
- Network management using DHCPCD
- Complete Handbook/Configuring the system#Networking information
외부 자료
참고 자료
- ↑ 1.0 1.1 Roy Marples. DHCPCD.CONF(5) , Roy Marples's personal blog , March 9th, 2015. Retrieved on May 07th, 2015.