nmcli
, nmtui
, 그리고 설정 파일을 이용하여 고정 IP 설정 방법을 단계별로 정리합니다.구분 | 방법 | 특징 | 장점 | 단점 | 추천 사용 경우 |
---|---|---|---|---|---|
1 | nmcli 명령어 기반 | CLI (Command Line Interface) 방식 | 빠르고 정확함스크립트 자동화 가능원격에서도 가능 | 명령어 암기 필요처음엔 다소 진입장벽 | 서버 운영, 대량 배포 자동화, 원격 설정 |
2 | nmtui 터미널 기반 GUI 도구 | 텍스트 기반 GUI | 직관적 메뉴 선택초보자 접근 쉬움원격 SSH에서도 사용 가능 | 세부 옵션 한계 스크립트화 어려움 | 초기 셋업, 비정기적 수동 설정 |
3 | 설정 파일 직접 수정 | 직접 설정파일(nmconnection) 수정 | 파일 복사, 템플릿 활용 용이백업 및 이식성 좋음 | 문법 오류 발생 가능적용 전 reload 필요 | 시스템 복제, 백업 복원, 수작업 운영 |
# nmcli connection show<br>
출력 예시:
NAME UUID TYPE DEVICE
enp5s0f1 7c06e8db-317c-363e-8e16-626c230a063e ethernet enp5s0f1
Wired connection 1 d79c523e-cdeb-315e-8f21-700982053ce2 ethernet enp5s0f0
lo e962bcfc-b939-4c94-b5ee-4af56ef916ce loopback lo
# nmcli connection modify "Wired connection 1" ipv4.addresses 192.168.204.245/24
# nmcli connection modify "Wired connection 1" ipv4.gateway 192.168.204.254
# nmcli connection modify "Wired connection 1" ipv4.dns 168.126.63.1
# nmcli connection modify "Wired connection 1" ipv4.method manual
# nmcli connection down "Wired connection 1" && nmcli connection up "Wired connection 1"
# nmcli device show enp5s0f0
출력 예시:
GENERAL.DEVICE: enp5s0f0
GENERAL.TYPE: ethernet
GENERAL.HWADDR: 00:25:90:E0:B6:0E
GENERAL.MTU: 1500
GENERAL.STATE: 100 (connected)
GENERAL.CONNECTION: Wired connection 1
GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/11
WIRED-PROPERTIES.CARRIER: on
IP4.ADDRESS[1]: 192.168.204.245/24
IP4.GATEWAY: 192.168.204.254
IP4.ROUTE[1]: dst = 192.168.204.0/24, nh = 0.0.0.0, mt = 100
IP4.ROUTE[2]: dst = 0.0.0.0/0, nh = 192.168.204.254, mt = 100
IP4.DNS[1]: 168.126.63.1
IP6.ADDRESS[1]: fe80::431:653a:1a13:2485/64
IP6.GATEWAY: --
IP6.ROUTE[1]: dst = fe80::/64, nh = ::, mt = 1024
# nmtui
# nmcli device show enp5s0f0
출력 예시:
GENERAL.DEVICE: enp5s0f0
GENERAL.TYPE: ethernet
GENERAL.HWADDR: 00:25:90:E0:B6:0E
GENERAL.MTU: 1500
GENERAL.STATE: 100 (connected)
GENERAL.CONNECTION: Wired connection 1
GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/11
WIRED-PROPERTIES.CARRIER: on
IP4.ADDRESS[1]: 192.168.204.245/24
IP4.GATEWAY: 192.168.204.254
IP4.ROUTE[1]: dst = 192.168.204.0/24, nh = 0.0.0.0, mt = 100
IP4.ROUTE[2]: dst = 0.0.0.0/0, nh = 192.168.204.254, mt = 100
IP4.DNS[1]: 168.126.63.1
IP6.ADDRESS[1]: fe80::431:653a:1a13:2485/64
IP6.GATEWAY: --
IP6.ROUTE[1]: dst = fe80::/64, nh = ::, mt = 1024
# vi /etc/NetworkManager/system-connections/Wired\ connection\ 1.nmconnection
설정 예시:
[connection]
id=Wired connection 1
uuid=d79c523e-cdeb-315e-8f21-700982053ce2
type=ethernet
autoconnect-priority=-999
interface-name=enp5s0f0
timestamp=1749885276
[ethernet]
[ipv4]
address1=192.168.204.245/24,192.168.204.254
dns=168.126.63.1;
method=manual
[ipv6]
addr-gen-mode=default
method=auto
[proxy]
# nmcli connection reload
# nmcli connection up "Wired connection 1"
# nmcli device show enp5s0f0
출력 예시:
GENERAL.DEVICE: enp5s0f0
GENERAL.TYPE: ethernet
GENERAL.HWADDR: 00:25:90:E0:B6:0E
GENERAL.MTU: 1500
GENERAL.STATE: 100 (connected)
GENERAL.CONNECTION: Wired connection 1
GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/10
WIRED-PROPERTIES.CARRIER: on
IP4.ADDRESS[1]: 192.168.204.245/24
IP4.GATEWAY: 192.168.204.254
IP4.ROUTE[1]: dst = 192.168.204.0/24, nh = 0.0.0.0, mt = 100
IP4.ROUTE[2]: dst = 0.0.0.0/0, nh = 192.168.204.254, mt = 100
IP4.DNS[1]: 168.126.63.1
IP6.ADDRESS[1]: fe80::431:653a:1a13:2485/64
IP6.GATEWAY: --
IP6.ROUTE[1]: dst = fe80::/64, nh = ::, mt = 1024
https://youtu.be/qr_rwwD6RZs 1. 개요 부팅 시 네트워크 인터페이스의 이름이 자동으로 생성되며, 전통적인 eth0, eth1 대신 enp5s0f0, ens3 등의 이름이 사용됩니다. predictable naming…
https://youtu.be/H3EstgGh850 1. 개요 Rocky Linux 9.5 환경에서 임시 IP를 설정하는 다양한 방법을 정리합니다. 2. 버전 Rocky…
https://youtu.be/N1JAomvksvQ 1. 개요 Rocky Linux 9.5 환경에서 DVD ISO 파일을 활용한 로컬 저장소(Local Repository)를 구성하는 방법을…
https://youtu.be/i_5aOmXWFQU 1. 개요 Rocky Linux 9.5 환경에서 시스템의 호스트네임(hostname) 을 설정하고 확인하는 여러 가지 방법에 대해 설명합니다. 2.…
https://youtu.be/6fKeoUesSQE 1. 개요 Rocky Linux 9.5 Minimal ISO를 이용하여 불필요한 GUI 없이 최소한의 구성으로 설치하는…
1. 개요 Rocky Linux는 엔터프라이즈 환경에서 사용되는 RHEL(Red Hat Enterprise Linux)과 완전히 호환되는 오픈소스 Linux…