3.3.7. nmcli를 사용하여 동적 이더넷 연결 추가 및 구성


동적 이더넷 연결 추가

동적 IP 구성을 사용하여 이더넷 구성 프로필을 추가하려면 DHCP 에서 네트워크 구성을 할당할 수 있습니다.
nmcli connection add type ethernet con-name connection-name ifname interface-name
Copy to Clipboard
예를 들어 my-office 라는 동적 연결 프로필을 생성하려면 다음을 수행합니다.
~]$ nmcli con add type ethernet con-name my-office ifname ens3
Connection 'my-office' (fb157a65-ad32-47ed-858c-102a48e064a2) successfully added.
Copy to Clipboard
이더넷 연결을 열려면 다음을 수행합니다.
~]$ nmcli con up my-office
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/5)
Copy to Clipboard
장치 및 연결의 상태를 검토합니다.
~]$ nmcli device status
DEVICE  TYPE      STATE         CONNECTION
ens3    ethernet  connected     my-office
ens9    ethernet  disconnected  --
lo      loopback  unmanaged     --
Copy to Clipboard

동적 이더넷 연결 구성

호스트에서 DHCP 서버로 보낸 호스트 이름을 변경하려면 dhcp-hostname 속성을 수정합니다.
~]$ nmcli con modify my-office my-office ipv4.dhcp-hostname host-name ipv6.dhcp-hostname host-name
Copy to Clipboard
호스트에서 DHCP 서버로 보낸 IPv4 클라이언트 ID를 변경하려면 dhcp-client-id 속성을 수정합니다.
~]$ nmcli con modify my-office my-office ipv4.dhcp-client-id client-ID-string
Copy to Clipboard
IPv6 에 대한 dhcp-client-id 속성이 없으며dhclientIPv6 의 식별자를 만듭니다. 자세한 내용은 dhclient(8) 도움말 페이지를 참조하십시오.
DHCP 서버에서 호스트로 전송된 DNS 서버를 무시하려면 ignore-auto-dns 특성을 수정합니다.
~]$ nmcli con modify my-office my-office ipv4.ignore-auto-dns yes ipv6.ignore-auto-dns yes
Copy to Clipboard
속성 및 설정에 대한 자세한 내용은 nm-settings(5) 도움말 페이지를 참조하십시오.

예 3.9. 대화형 편집기를 사용하여 동적 이더넷 연결 구성

대화형 편집기를 사용하여 동적 이더넷 연결을 구성하려면 다음을 수행합니다.
~]$ nmcli con edit type ethernet con-name ens3

===| nmcli interactive connection editor |===

Adding a new '802-3-ethernet' connection

Type 'help' or '?' for available commands.
Type 'describe [<setting>.<prop>]' for detailed property description.

You may edit the following settings: connection, 802-3-ethernet (ethernet), 802-1x, ipv4, ipv6, dcb
nmcli> describe ipv4.method

=== [method] ===
[NM property description]
IPv4 configuration method.  If 'auto' is specified then the appropriate automatic method (DHCP, PPP, etc) is used for the interface and most other properties can be left unset.  If 'link-local' is specified, then a link-local address in the 169.254/16 range will be assigned to the interface.  If 'manual' is specified, static IP addressing is used and at least one IP address must be given in the 'addresses' property.  If 'shared' is specified (indicating that this connection will provide network access to other computers) then the interface is assigned an address in the 10.42.x.1/24 range and a DHCP and forwarding DNS server are started, and the interface is NAT-ed to the current default network connection.  'disabled' means IPv4 will not be used on this connection.  This property must be set.

nmcli> set ipv4.method auto
nmcli> save
Saving the connection with 'autoconnect=yes'. That might result in an immediate activation of the connection.
Do you still want to save? [yes] yes
Connection 'ens3' (090b61f7-540f-4dd6-bf1f-a905831fc287) successfully saved.
nmcli> quit
~]$
Copy to Clipboard
기본 조치는 연결 프로필을 영구적으로 저장하는 것입니다. 필요한 경우 save 임시 명령을 사용하여 다음에 다시 시작할 때까지 메모리에만 프로필을 저장할 수 있습니다.
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat