[Rocky Linux] nmcli 명령어

2026. 2. 10. 15:55·OS/Install & Modify

Intro

Rocky 8 부터는 ifcfg 말고 nmcli 로 네트워크 관리할 수 있도록 변경됐습니다.

cat /etc/sysconfig/network-scripts/readme-ifcfg-rh.txt 로 확인 가능

 

cisco cli 처럼 명령어 단축이 가능합니다. (connection -> con, modify -> mo)

 

값 예시 설명
connection.id eth0 별칭, 별명
connection.interface-name eth0 물리 이더넷 이름(ens, eth,enp...)
ipv4.address 192.168.0.1/24 IPv4 주소 / Prefix
ipv4.gateway 192.168.0.254 IPv4 게이트웨이
ipv4.method manual manual(static), auto(dhcp) 로 보면 편합니다.

 

명령어

nmcli connection edit

  • set : 값 설정 (예 : set ipv4.address 192.168.0.1/24
  • remove : 값 제거 (예 : remove ipv4.address 192.168.0.1/24)
  • print : 설정 상태 보기 (예 : print ipv4)
  • save : 설정 저장
  • activate : 설정 반영 (nmcli connection up 과 비슷합니다. 바로 설정 값이 올라 옵니다)

nmcli connection up

 

 

예제

bond 이중화 구축

2개 이상의 포트를 묶을 때 사용하며 옵션은 다음과 같습니다.

옵션 기본값 내용
mode - active-backup
primary - 메인 인터페이스 지정
(DEVICE 이름으로 넣어야 함)
num_grat_arp 1 장애 발생 시 Gratuitous ARP 전송 횟수
primary_reselect 0 0 : 즉각 복구
1 : 속도나 듀플렉스 보고 복구
2 : 수동 복구. 인터페이스가 복구돼도 Currently Active Slave 가 바뀌진 않음.

 

2개 포트 active-standby 만들기

bond0 인터페이스 생성하기

nmcli con add type bond con-name bond0 ifname bond0 bond.options "mode=active-backup,miimon=100,primary_reselect=2"

 

eth0, eth1 를 bond0-active, bond0-backup 이름으로 bond0 에 추가하기

nmcli con add type ethernet slave-type bond con-name bond0-active ifname eth0 master bond0
nmcli con add type ethernet slave-type bond con-name bond0-backup ifname eth1 master bond0

 

bond0 에 대해 IP 설정 진행

nmcli con mo bond0 connection.autoconnect yes
nmcli con mo bond0 ipv4.address 192.168.0.11/24
nmcli con mo bond0 ipv4.gateway 192.168.0.1
nmcli con mo bond0 ipv4.method manual

 

설정 반영하기

nmcli con up bond0-active
nmcli con up bond0-backup
nmcli con up bond0

 

eth0 이름으로 된 컨넥션은 비활성화되고 bond0-active 로 올라온다. (eth0 device 가 쓰는 컨넥션이 eth0 -> bond0-active 로 바뀜)
bond0-active 컨넥션이 지워진다면 비활성화 된 eth0 컨넥션이 다시 올라온다. (/etc/NetworkManager/system-connections 확인)

 

messages 로그

test01 kernel: bond0: (slave enp1s0): link status definitely up, 0 Mbps full duplex
test01 kernel: bond0: (slave enp1s0): making interface the new active one
test01 kernel: bond0: (slave enp7s0): link status definitely down, disabling slave

 

트러블슈팅

(Rocky8) nmcli connection up 시 No suitable device found for this connection

에러내용

'eth1'(UUID) 연결 활성화 실패: No suitable device found for this connection (device eth0 not available because profile is not compatible with device (mismatching interface name)).

 

원인 및 해결

eth1 에 물리적인 연결이 없을 경우 eth1 connection up 이 되지 않습니다.

물리적인 연결 후 재시도

저작자표시 비영리 변경금지 (새창열림)

'OS > Install & Modify' 카테고리의 다른 글

[Rocky Linux] LVM 정리  (0) 2026.03.16
[Windows 11] 선택적 기능 WMIC, .NET Framework 3.5 수동 설치하기  (0) 2026.03.10
잡다한 명령어 모음  (0) 2026.01.15
[Rocky Linux] opendkim 설치하기  (0) 2025.12.15
[Linux] MariaDB 10.6 수동 설치  (2) 2025.09.15
'OS/Install & Modify' 카테고리의 다른 글
  • [Rocky Linux] LVM 정리
  • [Windows 11] 선택적 기능 WMIC, .NET Framework 3.5 수동 설치하기
  • 잡다한 명령어 모음
  • [Rocky Linux] opendkim 설치하기
PeamS
PeamS
본 블로그의 글들은 제 주관적인 생각이 반영되어 있으니, 항상 절대적인 정답이 아닐 수 있음을 유의해 주세요. 모든 글은 수시로 바뀝니다. 미완성에 주의하세요. 위키 처럼 사용중
  • PeamS
    각박딱딱
    PeamS
  • 전체
    오늘
    어제
    • 분류 전체보기 (41)
      • MAIN (1)
      • SERVER (10)
        • HPE (9)
        • DELL (1)
      • OS (13)
        • Install & Modify (7)
        • Troubleshooting (4)
        • Command (1)
      • Network (3)
        • OmniSwitch (3)
      • 백업 (4)
        • Veeam (1)
        • ETC (0)
      • 가상화 (2)
        • proxmox (2)
      • ETC (0)
        • 기록 (0)
  • 블로그 메뉴

    • 홈
    • 태그
    • 미디어로그
    • 위치로그
    • 방명록
  • 링크

  • 공지사항

    • 위키처럼 쓰는 블로그
  • 인기 글

  • 태그

    MariaDB 10.6
    .NET Framework 3.5 수동설치
    수동설치
    root 접속하기
    proxmox
    wmic 수동설치
    선택적기능 수동설치
    opendkim
    Veeam Backup Replication
    v13
    언어팩 수동설치
    윈도우 서버 설치 시 드라이브 안 보임
    source install
    Linux
    mariadb
    opendkim 설치
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.5
PeamS
[Rocky Linux] nmcli 명령어
상단으로

티스토리툴바