기술 정보
home
채널 소개
home

ifcfg 형식의 프로필을 key file 형태로 변경하는 방법 (linux network interface)

문서 유형
기술 정보
분야
관리/환경설정
키워드
ifcfg
migrate
NetworkManager
적용 제품 버전
6FS07
7FS02PS

개요

linux network interface는 ifcfg-[인터페이스 이름] 형식의 파일으로 config를 관리합니다. ( ip, netmask, gateway 등)
linux 9버전부터 ifcfg 대신 key file 형태로 connection의 config를 관리하도록 변경되었습니다.
이에 따라 기존 ifcfg 형식의 프로필을 key file 형태로 변경하는 방법을 안내합니다.

방법

fcfg 파일을 읽는 connection은 migrate 명령어로 connection key 파일로 포맷을 변경할 수 있습니다.

file migrate

#. 기존 ifcfg file을 읽어서 connection 생성됨 [root]# nmcli -f NAME,UUID,TYPE,AUTOCONNECT,DEVICE,STATE,FILENAME connection NAME UUID TYPE AUTOCONNECT DEVICE STATE FILENAME ens160 [interface uuid] ethernet yes ens160 activated /etc/sysconfig/network-scripts/ifcfg-ens160 ens192 [interface uuid] ethernet yes ens192 activated /etc/sysconfig/network-scripts/ifcfg-ens192 #. file migrate [root]# nmcli connection migrate Connection 'ens160' ([interface uuid]) successfully migrated. Connection 'ens192' ([interface uuid] ) successfully migrated. #. key file 생성 확인 [root]# ls /etc/NetworkManager/system-connections/ ens160.nmconnection ens192.nmconnection [root@tac1 ~]# ls /etc/sysconfig/network-scripts/ -> 조회되는 파일 없음
SQL
복사

profile 확인

[root]# nmcli -f NAME,UUID,TYPE,AUTOCONNECT,DEVICE,STATE,FILENAME connection NAME UUID TYPE AUTOCONNECT DEVICE STATE FILENAME ens160 ([interface uuid]) ethernet yes ens160 activated /etc/NetworkManager/system-connections/ens160.nmconnection ens192 ([interface uuid]) ethernet yes ens192 activated /etc/NetworkManager/system-connections/ens192.nmconnection
SQL
복사
참고
Linux 8/9버전을 지원하는 DB 버전 확인이 필요합니다.