인터페이스 이름변경 문서 원본 보기
←
인터페이스 이름변경
둘러보기로 이동
검색으로 이동
문서 편집 작업을 수행할 권한이 없습니다. 다음 이유를 확인해주세요:
요청한 작업은 다음 중 하나의 권한을 가진 사용자에게 제한됩니다:
관리자
, 문서 편집자.
문서의 원본을 보거나 복사할 수 있습니다.
= Rocky Linux 9 네트워크 인터페이스 이름을 eth0, eth1 형식으로 변경하는 가이드 = == 문서 개요 == Rocky Linux 9 / RHEL 9는 기본적으로 예측 가능한 네트워크 인터페이스 이름을 사용한다. 예시: <syntaxhighlight lang="text" line> ens160 ens192 ens224 eno1 enp3s0 </syntaxhighlight> 일부 구형 콜서버, PBX, CTI, 미들웨어 또는 제조사 애플리케이션은 네트워크 인터페이스 이름을 다음과 같은 구형 형식으로 고정하여 검사하는 경우가 있다. <syntaxhighlight lang="text" line> eth0 eth1 eth2 </syntaxhighlight> 본 문서는 Rocky Linux 9에서 다음 두 가지 방법으로 인터페이스 이름을 변경하는 절차를 설명한다. # 커널의 예측 가능한 인터페이스 이름 기능을 전체 비활성화 # MAC 주소를 기준으로 특정 인터페이스 이름을 eth0, eth1로 고정 일반적인 서버에서는 예측 가능한 인터페이스 이름을 유지하는 것이 권장된다. 구형 애플리케이션 호환 목적으로 eth0, eth1 형식이 반드시 필요한 경우에만 적용한다. == 1. 변경 전 주요 주의사항 == 인터페이스 이름을 변경하면 다음 문제가 발생할 수 있다. * SSH 원격 접속 중단 * NetworkManager 연결 프로파일 미적용 * 기존 고정 IP 설정 누락 * 방화벽 존과 인터페이스 연결 해제 * 본딩, 브리지, VLAN 구성 실패 * 애플리케이션 라이선스 또는 NIC 검사 실패 * 인터페이스 순서가 예상과 다르게 배정 * 재부팅 후 네트워크 미동작 반드시 다음 관리 수단 중 하나를 확보한 상태에서 작업한다. * 물리 콘솔 * VMware 콘솔 * KVM 또는 Proxmox 콘솔 * iLO * iDRAC * IPMI * 별도 관리 인터페이스 운영 중인 원격 서버에서 콘솔 접속 수단 없이 바로 적용하지 않는다. == 2. 현재 환경 확인 == === 2.1 운영체제 및 커널 확인 === <syntaxhighlight lang="bash" line> # 운영체제 버전 확인 cat /etc/os-release # 현재 커널 버전 확인 uname -r # 커널 명령행 확인 cat /proc/cmdline </syntaxhighlight> === 2.2 현재 인터페이스 이름 확인 === <syntaxhighlight lang="bash" line> # 네트워크 인터페이스와 IP 주소를 간단히 확인 ip -br address # NetworkManager 장치 상태 확인 nmcli device status # 연결 프로파일과 장치 이름 확인 nmcli -f NAME,UUID,TYPE,DEVICE,FILENAME connection show </syntaxhighlight> 출력 예시: <syntaxhighlight lang="text" line> NAME UUID TYPE DEVICE FILENAME ens192 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx ethernet ens192 /etc/NetworkManager/system-connections/ens192.nmconnection ens224 yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy ethernet ens224 /etc/NetworkManager/system-connections/ens224.nmconnection </syntaxhighlight> === 2.3 인터페이스 MAC 주소 확인 === <syntaxhighlight lang="bash" line> # 모든 인터페이스의 MAC 주소 확인 ip -br link # ens192의 MAC 주소 확인 cat /sys/class/net/ens192/address # ens224의 MAC 주소 확인 cat /sys/class/net/ens224/address # NetworkManager에서 MAC 주소 확인 nmcli -f GENERAL.DEVICE,GENERAL.HWADDR device show </syntaxhighlight> 예시: <syntaxhighlight lang="text" line> ens192 MAC 주소: 00:50:56:aa:bb:01 ens224 MAC 주소: 00:50:56:aa:bb:02 </syntaxhighlight> MAC 주소는 이후 eth0과 eth1을 정확히 매핑할 때 사용한다. === 2.4 현재 IP 및 라우팅 확인 === <syntaxhighlight lang="bash" line> # 현재 IP 주소 확인 ip address # 현재 라우팅 테이블 확인 ip route # DNS 설정 확인 cat /etc/resolv.conf # 활성 연결 상세 확인 nmcli connection show --active </syntaxhighlight> == 3. 기존 설정 백업 == === 3.1 네트워크 및 GRUB 설정 백업 === <syntaxhighlight lang="bash" line> # 백업 디렉터리 생성 BACKUP_DIR="/root/interface-rename-backup-$(date +%Y%m%d_%H%M%S)" mkdir -p "$BACKUP_DIR" # NetworkManager 연결 프로파일 백업 cp -a /etc/NetworkManager/system-connections "$BACKUP_DIR/" 2>/dev/null # 구형 ifcfg 파일이 있으면 백업 cp -a /etc/sysconfig/network-scripts "$BACKUP_DIR/" 2>/dev/null # GRUB 기본 설정 백업 cp -a /etc/default/grub "$BACKUP_DIR/" 2>/dev/null # systemd link 파일 백업 cp -a /etc/systemd/network "$BACKUP_DIR/" 2>/dev/null # udev 네트워크 규칙 백업 cp -a /etc/udev/rules.d "$BACKUP_DIR/" 2>/dev/null </syntaxhighlight> === 3.2 현재 상태를 텍스트로 저장 === <syntaxhighlight lang="bash" line> # 인터페이스와 IP 주소 저장 ip address > "$BACKUP_DIR/ip-address.txt" # 링크 및 MAC 주소 저장 ip link > "$BACKUP_DIR/ip-link.txt" # 라우팅 정보 저장 ip route > "$BACKUP_DIR/ip-route.txt" # NetworkManager 프로파일 저장 nmcli -f NAME,UUID,TYPE,DEVICE,FILENAME connection show \ > "$BACKUP_DIR/nmcli-connections.txt" # 현재 커널 명령행 저장 cat /proc/cmdline > "$BACKUP_DIR/proc-cmdline.txt" # 현재 GRUB 커널 인수 저장 grubby --info=ALL > "$BACKUP_DIR/grubby-info.txt" </syntaxhighlight> == 4. 변경 방법 선택 == {| class="wikitable" |- ! 방법 ! 장점 ! 단점 ! 권장 상황 |- | net.ifnames=0 방식 | 설정이 단순하고 모든 NIC가 eth 형식으로 변경됨 | eth0, eth1 순서가 하드웨어 변경에 따라 달라질 수 있음 | NIC 수가 적고 단순한 고정형 서버 |- | MAC 주소 고정 매핑 | 특정 NIC를 eth0, eth1로 명확히 지정 가능 | 설정 파일 관리가 추가로 필요함 | 콜서버 등 인터페이스 이름과 물리 NIC 매핑이 중요할 때 |} 콜서버 또는 PBX 소프트웨어가 eth0과 eth1을 역할별로 구분하는 경우에는 MAC 주소 고정 매핑 방법을 권장한다. == 5. 방법 1: 예측 가능한 인터페이스 이름 전체 비활성화 == 이 방법은 커널 부팅 옵션에 다음 값을 추가한다. <syntaxhighlight lang="text" line> net.ifnames=0 biosdevname=0 </syntaxhighlight> 적용 후 일반적으로 다음과 같이 이름이 변경된다. <syntaxhighlight lang="text" line> ens192 → eth0 ens224 → eth1 </syntaxhighlight> 단, eth0과 eth1의 실제 순서는 NIC 검색 순서에 따라 달라질 수 있다. === 5.1 현재 연결 프로파일 확인 === <syntaxhighlight lang="bash" line> # 현재 연결 프로파일과 인터페이스 확인 nmcli -f NAME,UUID,TYPE,DEVICE,FILENAME connection show # 활성 프로파일 확인 nmcli connection show --active </syntaxhighlight> 예시에서는 다음과 같이 가정한다. <syntaxhighlight lang="text" line> 연결 프로파일 이름: ens192 현재 장치 이름: ens192 변경할 장치 이름: eth0 </syntaxhighlight> === 5.2 연결 프로파일을 기존 이름과 새 이름에 임시 대응 === 재부팅 후 장치 이름이 바뀌어도 기존 프로파일을 찾을 수 있도록 인터페이스 이름 고정을 해제하고 이전 이름과 새 이름을 모두 매칭한다. <syntaxhighlight lang="bash" line> # ens192 연결 프로파일이 특정 인터페이스에 고정되어 있으면 해제 nmcli connection modify ens192 connection.interface-name "" # 재부팅 전 ens192와 재부팅 후 eth0을 모두 허용 nmcli connection modify ens192 match.interface-name "ens192 eth0" # 자동 연결 활성화 nmcli connection modify ens192 connection.autoconnect yes </syntaxhighlight> 두 번째 인터페이스도 사용하는 경우: <syntaxhighlight lang="bash" line> # ens224 프로파일의 인터페이스 이름 고정 해제 nmcli connection modify ens224 connection.interface-name "" # ens224와 eth1을 모두 허용 nmcli connection modify ens224 match.interface-name "ens224 eth1" # 자동 연결 활성화 nmcli connection modify ens224 connection.autoconnect yes </syntaxhighlight> 현재 NetworkManager 버전에서 match.interface-name 속성을 지원하는지 확인한다. <syntaxhighlight lang="bash" line> # 연결 프로파일의 매칭 속성 확인 nmcli connection show ens192 | grep -E 'interface-name|match.interface-name' </syntaxhighlight> === 5.3 커널 부팅 인수 추가 === Rocky Linux 9에서는 grubby 명령을 사용하여 현재 설치된 모든 커널에 인수를 추가할 수 있다. <syntaxhighlight lang="bash" line> # 모든 설치 커널에 예측 가능한 이름 비활성화 옵션 추가 grubby --update-kernel=ALL \ --args="net.ifnames=0 biosdevname=0" # 모든 커널의 적용 상태 확인 grubby --info=ALL | grep -E '^kernel=|^args=' </syntaxhighlight> 확인할 항목: <syntaxhighlight lang="text" line> net.ifnames=0 biosdevname=0 </syntaxhighlight> === 5.4 GRUB 기본 설정에도 반영 확인 === <syntaxhighlight lang="bash" line> # GRUB 기본 커널 인수 확인 grep '^GRUB_CMDLINE_LINUX=' /etc/default/grub </syntaxhighlight> grubby로 적용한 값은 부트로더 항목에 반영된다. 환경에 따라 /etc/default/grub에도 동일한 값을 관리하려면 다음과 같이 편집한다. <syntaxhighlight lang="bash" line> # GRUB 기본 설정 백업 cp -a /etc/default/grub \ /etc/default/grub.bak.$(date +%Y%m%d_%H%M%S) # GRUB 기본 설정 편집 vi /etc/default/grub </syntaxhighlight> 예시: <syntaxhighlight lang="text" line> GRUB_CMDLINE_LINUX="기존옵션 net.ifnames=0 biosdevname=0" </syntaxhighlight> 기존 옵션을 삭제하지 않고 뒤에 추가한다. === 5.5 GRUB 설정 파일 재생성 여부 === grubby 명령으로 현재 커널 항목을 수정한 경우 일반적으로 별도 재생성이 필요하지 않다. 그러나 /etc/default/grub를 직접 수정했다면 시스템의 부팅 방식에 맞게 GRUB 설정을 재생성한다. BIOS 방식: <syntaxhighlight lang="bash" line> # BIOS 방식 GRUB 설정 재생성 grub2-mkconfig -o /boot/grub2/grub.cfg </syntaxhighlight> UEFI 방식: <syntaxhighlight lang="bash" line> # Rocky Linux 9에서 실제 GRUB 설정 경로 확인 readlink -f /etc/grub2-efi.cfg # UEFI용 GRUB 설정 재생성 grub2-mkconfig -o /etc/grub2-efi.cfg </syntaxhighlight> Rocky Linux 9에서는 UEFI 환경에서도 배포판과 설치 상태에 따라 실제 설정 파일이 /boot/grub2/grub.cfg를 가리킬 수 있으므로 readlink 결과를 먼저 확인한다. === 5.6 재부팅 전 설정 확인 === <syntaxhighlight lang="bash" line> # 커널 인수 확인 grubby --info=DEFAULT | grep '^args=' # 연결 프로파일의 기존 이름과 새 이름 매칭 확인 nmcli connection show ens192 | grep -E 'interface-name|match.interface-name' # 현재 IP 설정 확인 nmcli -f ipv4 connection show ens192 # 부팅 시 자동 연결 여부 확인 nmcli -f connection.autoconnect connection show ens192 </syntaxhighlight> === 5.7 시스템 재부팅 === <syntaxhighlight lang="bash" line> # 설정 적용을 위해 재부팅 reboot </syntaxhighlight> === 5.8 재부팅 후 인터페이스 이름 확인 === 콘솔에서 로그인하여 확인한다. <syntaxhighlight lang="bash" line> # 인터페이스 이름 확인 ip -br link # IP 주소 확인 ip -br address # NetworkManager 장치 상태 확인 nmcli device status # 적용된 커널 인수 확인 cat /proc/cmdline </syntaxhighlight> 예상 결과: <syntaxhighlight lang="text" line> eth0 UP 192.168.10.20/24 eth1 UP </syntaxhighlight> === 5.9 연결 프로파일 이름 정리 === 장치는 eth0으로 변경되었지만 연결 프로파일 이름은 ens192로 남아 있을 수 있다. 기능상 문제는 없지만 구형 프로그램이 프로파일명이나 ifcfg 파일명까지 검사한다면 이름을 변경한다. <syntaxhighlight lang="bash" line> # 연결 프로파일 이름을 ens192에서 eth0으로 변경 nmcli connection modify ens192 connection.id eth0 # eth0 장치에 프로파일 고정 nmcli connection modify eth0 connection.interface-name eth0 # 임시 다중 매칭 조건 제거 nmcli connection modify eth0 match.interface-name "" # 자동 연결 확인 nmcli connection modify eth0 connection.autoconnect yes </syntaxhighlight> 두 번째 인터페이스: <syntaxhighlight lang="bash" line> # 연결 프로파일 이름을 ens224에서 eth1로 변경 nmcli connection modify ens224 connection.id eth1 # eth1 장치에 프로파일 고정 nmcli connection modify eth1 connection.interface-name eth1 # 임시 매칭 조건 제거 nmcli connection modify eth1 match.interface-name "" # 자동 연결 확인 nmcli connection modify eth1 connection.autoconnect yes </syntaxhighlight> 최종 확인: <syntaxhighlight lang="bash" line> # 프로파일과 장치 연결 확인 nmcli -f NAME,UUID,TYPE,DEVICE,FILENAME connection show # 활성 연결 확인 nmcli connection show --active </syntaxhighlight> == 6. 방법 2: MAC 주소 기준으로 eth0, eth1 고정 == 여러 NIC를 사용하는 서버에서는 단순히 net.ifnames=0만 적용하면 NIC 검색 순서에 따라 eth0과 eth1의 대응 관계가 달라질 가능성이 있다. 콜서버에서 다음과 같이 역할이 정해져 있다면 MAC 주소 기준 고정이 안전하다. <syntaxhighlight lang="text" line> eth0: 관리 및 서비스망 eth1: 음성망 또는 시그널링망 </syntaxhighlight> 이 절에서는 systemd link 파일을 사용하여 MAC 주소와 인터페이스 이름을 매핑한다. === 6.1 MAC 주소 기록 === <syntaxhighlight lang="bash" line> # ens192의 MAC 주소 확인 cat /sys/class/net/ens192/address # ens224의 MAC 주소 확인 cat /sys/class/net/ens224/address </syntaxhighlight> 예시: <syntaxhighlight lang="text" line> ens192: 00:50:56:aa:bb:01 ens224: 00:50:56:aa:bb:02 </syntaxhighlight> MAC 주소를 잘못 입력하면 원하는 인터페이스에 이름이 적용되지 않는다. === 6.2 systemd network 디렉터리 생성 === <syntaxhighlight lang="bash" line> # systemd link 설정 디렉터리 생성 mkdir -p /etc/systemd/network </syntaxhighlight> === 6.3 eth0용 link 파일 작성 === <syntaxhighlight lang="bash" line> # eth0으로 사용할 NIC의 link 설정 작성 vi /etc/systemd/network/10-eth0.link </syntaxhighlight> 설정 예시: <syntaxhighlight lang="ini" line> [Match] MACAddress=00:50:56:aa:bb:01 [Link] Name=eth0 </syntaxhighlight> === 6.4 eth1용 link 파일 작성 === <syntaxhighlight lang="bash" line> # eth1으로 사용할 NIC의 link 설정 작성 vi /etc/systemd/network/11-eth1.link </syntaxhighlight> 설정 예시: <syntaxhighlight lang="ini" line> [Match] MACAddress=00:50:56:aa:bb:02 [Link] Name=eth1 </syntaxhighlight> === 6.5 link 파일 권한 확인 === <syntaxhighlight lang="bash" line> # link 파일 소유권과 권한 설정 chown root:root /etc/systemd/network/10-eth0.link chown root:root /etc/systemd/network/11-eth1.link chmod 644 /etc/systemd/network/10-eth0.link chmod 644 /etc/systemd/network/11-eth1.link # 파일 확인 ls -l /etc/systemd/network/*.link </syntaxhighlight> === 6.6 systemd link 설정 검사 === <syntaxhighlight lang="bash" line> # ens192에 적용될 link 설정 확인 udevadm test-builtin net_setup_link /sys/class/net/ens192 2>&1 | \ grep -E 'ID_NET_LINK_FILE|ID_NET_NAME|eth0' # ens224에 적용될 link 설정 확인 udevadm test-builtin net_setup_link /sys/class/net/ens224 2>&1 | \ grep -E 'ID_NET_LINK_FILE|ID_NET_NAME|eth1' </syntaxhighlight> 출력에서 다음 파일이 선택되는지 확인한다. <syntaxhighlight lang="text" line> /etc/systemd/network/10-eth0.link /etc/systemd/network/11-eth1.link </syntaxhighlight> === 6.7 NetworkManager 프로파일 임시 매칭 설정 === <syntaxhighlight lang="bash" line> # ens192 프로파일의 인터페이스 고정 해제 nmcli connection modify ens192 connection.interface-name "" # ens192와 eth0 모두 매칭 nmcli connection modify ens192 match.interface-name "ens192 eth0" # MAC 주소도 함께 고정 nmcli connection modify ens192 802-3-ethernet.mac-address \ 00:50:56:aa:bb:01 # 자동 연결 활성화 nmcli connection modify ens192 connection.autoconnect yes </syntaxhighlight> 두 번째 인터페이스: <syntaxhighlight lang="bash" line> # ens224 프로파일의 인터페이스 고정 해제 nmcli connection modify ens224 connection.interface-name "" # ens224와 eth1 모두 매칭 nmcli connection modify ens224 match.interface-name "ens224 eth1" # MAC 주소도 함께 고정 nmcli connection modify ens224 802-3-ethernet.mac-address \ 00:50:56:aa:bb:02 # 자동 연결 활성화 nmcli connection modify ens224 connection.autoconnect yes </syntaxhighlight> === 6.8 initramfs에 네트워크 설정이 필요한 환경 === 일반적인 로컬 디스크 부팅 서버는 보통 initramfs 재생성이 필요하지 않다. 다음 환경에서는 initramfs에 네트워크 설정이 포함될 수 있으므로 재생성을 검토한다. * iSCSI root * NFS root * 네트워크 기반 루트 파일시스템 * 초기 부팅 단계에서 네트워크가 필요한 특수 서버 * dracut에 네트워크 설정을 포함한 환경 필요한 경우: <syntaxhighlight lang="bash" line> # 현재 initramfs 백업 cp -a "/boot/initramfs-$(uname -r).img" \ "/boot/initramfs-$(uname -r).img.bak.$(date +%Y%m%d_%H%M%S)" # 현재 커널의 initramfs 재생성 dracut -f </syntaxhighlight> === 6.9 재부팅 === <syntaxhighlight lang="bash" line> # 인터페이스 이름 변경 적용 reboot </syntaxhighlight> === 6.10 재부팅 후 확인 === <syntaxhighlight lang="bash" line> # 변경된 인터페이스 이름 확인 ip -br link # 각 인터페이스 MAC 주소 확인 ip -br link show eth0 ip -br link show eth1 # IP 주소 확인 ip -br address # NetworkManager 연결 확인 nmcli device status nmcli connection show --active </syntaxhighlight> MAC 주소별 매핑 확인: <syntaxhighlight lang="bash" line> # eth0 MAC 주소 확인 cat /sys/class/net/eth0/address # eth1 MAC 주소 확인 cat /sys/class/net/eth1/address </syntaxhighlight> === 6.11 프로파일 이름 최종 변경 === <syntaxhighlight lang="bash" line> # ens192 프로파일을 eth0으로 변경 nmcli connection modify ens192 connection.id eth0 nmcli connection modify eth0 connection.interface-name eth0 nmcli connection modify eth0 match.interface-name "" # ens224 프로파일을 eth1으로 변경 nmcli connection modify ens224 connection.id eth1 nmcli connection modify eth1 connection.interface-name eth1 nmcli connection modify eth1 match.interface-name "" </syntaxhighlight> 확인: <syntaxhighlight lang="bash" line> # 연결 프로파일과 실제 장치 매핑 확인 nmcli -f NAME,UUID,TYPE,DEVICE,FILENAME connection show </syntaxhighlight> == 7. 본딩 구성 서버의 인터페이스 이름 변경 == 기존 구성이 다음과 같다고 가정한다. <syntaxhighlight lang="text" line> ens192 + ens224 → bond0 </syntaxhighlight> 변경 후: <syntaxhighlight lang="text" line> eth0 + eth1 → bond0 </syntaxhighlight> 본딩 포트 프로파일에서 기존 장치 이름을 변경해야 한다. === 7.1 현재 본딩 설정 확인 === <syntaxhighlight lang="bash" line> # 본딩 상태 확인 cat /proc/net/bonding/bond0 # 연결 프로파일 확인 nmcli -f NAME,TYPE,DEVICE,FILENAME connection show # bond0 프로파일 상세 확인 nmcli connection show bond0 </syntaxhighlight> === 7.2 본딩 포트 프로파일 변경 준비 === 예시 프로파일: <syntaxhighlight lang="text" line> bond0-port1 → ens192 bond0-port2 → ens224 </syntaxhighlight> 재부팅 전에 기존 이름과 새 이름을 모두 허용한다. <syntaxhighlight lang="bash" line> # 첫 번째 본딩 포트의 장치 이름 고정 해제 nmcli connection modify bond0-port1 connection.interface-name "" # ens192와 eth0 모두 매칭 nmcli connection modify bond0-port1 match.interface-name "ens192 eth0" # 첫 번째 NIC MAC 주소 고정 nmcli connection modify bond0-port1 802-3-ethernet.mac-address \ 00:50:56:aa:bb:01 </syntaxhighlight> 두 번째 포트: <syntaxhighlight lang="bash" line> # 두 번째 본딩 포트의 장치 이름 고정 해제 nmcli connection modify bond0-port2 connection.interface-name "" # ens224와 eth1 모두 매칭 nmcli connection modify bond0-port2 match.interface-name "ens224 eth1" # 두 번째 NIC MAC 주소 고정 nmcli connection modify bond0-port2 802-3-ethernet.mac-address \ 00:50:56:aa:bb:02 </syntaxhighlight> === 7.3 재부팅 후 본딩 포트 이름 정리 === <syntaxhighlight lang="bash" line> # 첫 번째 포트 프로파일 이름 변경 nmcli connection modify bond0-port1 connection.id eth0 nmcli connection modify eth0 connection.interface-name eth0 nmcli connection modify eth0 match.interface-name "" # 두 번째 포트 프로파일 이름 변경 nmcli connection modify bond0-port2 connection.id eth1 nmcli connection modify eth1 connection.interface-name eth1 nmcli connection modify eth1 match.interface-name "" </syntaxhighlight> 본딩 옵션에 primary=ens192가 들어 있다면 eth0으로 변경한다. <syntaxhighlight lang="bash" line> # 기존 본딩 옵션 확인 nmcli -f bond.options connection show bond0 # active-backup 본딩의 우선 포트를 eth0으로 변경 nmcli connection modify bond0 \ bond.options "mode=active-backup,miimon=100,primary=eth0" </syntaxhighlight> 본딩 재활성화는 네트워크 중단을 발생시킬 수 있으므로 콘솔에서 진행한다. <syntaxhighlight lang="bash" line> # bond0 연결 재적용 nmcli connection down bond0 nmcli connection up bond0 </syntaxhighlight> 본딩 확인: <syntaxhighlight lang="bash" line> # 본딩 상세 상태 확인 cat /proc/net/bonding/bond0 # 현재 활성 포트 확인 grep "Currently Active Slave" /proc/net/bonding/bond0 # bond0 IP 주소 확인 ip -br address show bond0 </syntaxhighlight> == 8. 구형 ifcfg 파일 이름 변경 == 구형 애플리케이션이 다음 파일을 검사하는 경우: <syntaxhighlight lang="text" line> /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth1 </syntaxhighlight> NetworkManager 프로파일이 ifcfg-rh 형식으로 저장되어 있다면 파일명과 내부 설정을 함께 변경한다. === 8.1 현재 프로파일 저장 형식 확인 === <syntaxhighlight lang="bash" line> # NetworkManager 프로파일 파일 경로 확인 nmcli -f NAME,DEVICE,TYPE,FILENAME connection show </syntaxhighlight> === 8.2 ifcfg-eth0 예시 === <syntaxhighlight lang="ini" line> TYPE=Ethernet NAME=eth0 DEVICE=eth0 ONBOOT=yes BOOTPROTO=none IPADDR=192.168.10.20 PREFIX=24 GATEWAY=192.168.10.1 DNS1=192.168.10.1 DNS2=8.8.8.8 HWADDR=00:50:56:AA:BB:01 </syntaxhighlight> === 8.3 ifcfg-eth1 예시 === <syntaxhighlight lang="ini" line> TYPE=Ethernet NAME=eth1 DEVICE=eth1 ONBOOT=yes BOOTPROTO=none HWADDR=00:50:56:AA:BB:02 </syntaxhighlight> === 8.4 본딩 포트용 ifcfg-eth0 예시 === <syntaxhighlight lang="ini" line> TYPE=Ethernet NAME=eth0 DEVICE=eth0 ONBOOT=yes BOOTPROTO=none HWADDR=00:50:56:AA:BB:01 MASTER=bond0 SLAVE=yes </syntaxhighlight> === 8.5 본딩 포트용 ifcfg-eth1 예시 === <syntaxhighlight lang="ini" line> TYPE=Ethernet NAME=eth1 DEVICE=eth1 ONBOOT=yes BOOTPROTO=none HWADDR=00:50:56:AA:BB:02 MASTER=bond0 SLAVE=yes </syntaxhighlight> 파일 생성 후: <syntaxhighlight lang="bash" line> # 파일 권한 설정 chmod 600 /etc/sysconfig/network-scripts/ifcfg-eth0 chmod 600 /etc/sysconfig/network-scripts/ifcfg-eth1 # NetworkManager에 프로파일 다시 읽기 nmcli connection reload # 중복 프로파일 확인 nmcli -f NAME,UUID,DEVICE,TYPE,FILENAME connection show </syntaxhighlight> 같은 NIC를 대상으로 하는 keyfile과 ifcfg 파일이 동시에 있으면 중복 프로파일이 생성될 수 있으므로 사용하지 않는 프로파일을 정리한다. == 9. firewalld 존 연결 확인 == 인터페이스 이름 변경 후 firewalld 존에 연결된 장치가 달라질 수 있다. <syntaxhighlight lang="bash" line> # 활성 존과 연결 인터페이스 확인 firewall-cmd --get-active-zones # 전체 존 설정 확인 firewall-cmd --list-all-zones </syntaxhighlight> eth0을 public 존에 연결: <syntaxhighlight lang="bash" line> # eth0을 public 존에 영구 연결 firewall-cmd --permanent --zone=public --change-interface=eth0 # 설정 적용 firewall-cmd --reload # 활성 존 확인 firewall-cmd --get-active-zones </syntaxhighlight> NetworkManager 프로파일에 존을 지정하는 방법: <syntaxhighlight lang="bash" line> # eth0 연결 프로파일을 public 존에 지정 nmcli connection modify eth0 connection.zone public # 설정 확인 nmcli -f connection.zone connection show eth0 </syntaxhighlight> == 10. 애플리케이션 설정 확인 == 인터페이스 이름을 직접 참조하는 설정 파일을 검색한다. <syntaxhighlight lang="bash" line> # /etc 아래에서 기존 인터페이스 이름 검색 grep -R --line-number --fixed-string "ens192" /etc 2>/dev/null # ens224 참조 검색 grep -R --line-number --fixed-string "ens224" /etc 2>/dev/null </syntaxhighlight> 주요 확인 대상: * 콜서버 환경 설정 파일 * PBX 인터페이스 설정 * SIP 또는 RTP 바인딩 설정 * 방화벽 규칙 * iptables 스크립트 * rsyslog 입력 바인딩 * Samba interfaces 설정 * nginx listen 주소 * MariaDB bind-address * keepalived 설정 * pacemaker 또는 corosync 설정 * 모니터링 에이전트 * 라이선스 검사 스크립트 * 백업 및 운영 자동화 스크립트 == 11. 변경 후 전체 검증 == === 11.1 인터페이스 및 MAC 주소 확인 === <syntaxhighlight lang="bash" line> # 인터페이스 이름 확인 ip -br link # IP 주소 확인 ip -br address # eth0 MAC 주소 확인 cat /sys/class/net/eth0/address # eth1 MAC 주소 확인 cat /sys/class/net/eth1/address </syntaxhighlight> === 11.2 NetworkManager 확인 === <syntaxhighlight lang="bash" line> # 장치 상태 확인 nmcli device status # 연결 프로파일 확인 nmcli -f NAME,UUID,TYPE,DEVICE,FILENAME connection show # 활성 연결 확인 nmcli connection show --active </syntaxhighlight> === 11.3 통신 확인 === <syntaxhighlight lang="bash" line> # 라우팅 확인 ip route # 기본 게이트웨이 통신 확인 ping -c 4 192.168.10.1 # 외부 IP 통신 확인 ping -c 4 8.8.8.8 # DNS 확인 ping -c 4 google.com </syntaxhighlight> === 11.4 서비스 및 포트 확인 === <syntaxhighlight lang="bash" line> # 실패한 서비스 확인 systemctl --failed # 리스닝 포트 확인 ss -lntup # SSH 상태 확인 systemctl status sshd # SSH 로그 확인 journalctl -u sshd -n 50 --no-pager </syntaxhighlight> === 11.5 부팅 로그 확인 === <syntaxhighlight lang="bash" line> # 현재 부팅의 네트워크 관련 로그 확인 journalctl -b | grep -i -E 'eth0|eth1|ens192|ens224|NetworkManager' # 커널의 인터페이스 이름 변경 로그 확인 journalctl -k -b | grep -i -E 'renamed from|eth0|eth1' # NetworkManager 최근 로그 확인 journalctl -u NetworkManager -b --no-pager </syntaxhighlight> == 12. 문제 발생 시 복구 방법 == === 12.1 GRUB 메뉴에서 임시 복구 === 재부팅 후 네트워크가 올라오지 않으면 GRUB 부팅 메뉴에서 해당 커널 항목을 선택하고 e 키를 눌러 임시 편집 화면으로 진입한다. linux 또는 linuxefi로 시작하는 줄에서 다음 옵션을 삭제한다. <syntaxhighlight lang="text" line> net.ifnames=0 biosdevname=0 </syntaxhighlight> Ctrl+x 또는 F10으로 임시 부팅한다. 이 변경은 해당 1회 부팅에만 적용된다. === 12.2 커널 인수 영구 제거 === 시스템에 로그인한 후: <syntaxhighlight lang="bash" line> # 모든 커널에서 이름 변경 옵션 제거 grubby --update-kernel=ALL \ --remove-args="net.ifnames=0 biosdevname=0" # 제거 결과 확인 grubby --info=ALL | grep -E '^kernel=|^args=' </syntaxhighlight> === 12.3 systemd link 파일 제거 === <syntaxhighlight lang="bash" line> # 사용자 정의 인터페이스 이름 설정 백업 mkdir -p /root/disabled-link-files mv /etc/systemd/network/10-eth0.link \ /root/disabled-link-files/ 2>/dev/null mv /etc/systemd/network/11-eth1.link \ /root/disabled-link-files/ 2>/dev/null </syntaxhighlight> === 12.4 NetworkManager 프로파일 복원 === 백업 디렉터리를 확인한다. <syntaxhighlight lang="bash" line> # 생성된 백업 디렉터리 확인 ls -ld /root/interface-rename-backup-* </syntaxhighlight> 기존 프로파일 복원 예시: <syntaxhighlight lang="bash" line> # 현재 프로파일 별도 백업 mv /etc/NetworkManager/system-connections \ /etc/NetworkManager/system-connections.failed.$(date +%Y%m%d_%H%M%S) # 백업 프로파일 복원 cp -a \ /root/interface-rename-backup-YYYYMMDD_HHMMSS/system-connections \ /etc/NetworkManager/ # 보안 권한 복구 chown -R root:root /etc/NetworkManager/system-connections chmod 600 /etc/NetworkManager/system-connections/* # 프로파일 다시 읽기 nmcli connection reload </syntaxhighlight> === 12.5 NetworkManager 재시작 === NetworkManager 재시작은 네트워크 연결을 끊을 수 있으므로 콘솔에서 실행한다. <syntaxhighlight lang="bash" line> # NetworkManager 재시작 systemctl restart NetworkManager # 상태 확인 systemctl status NetworkManager </syntaxhighlight> === 12.6 재부팅 후 원래 이름 확인 === <syntaxhighlight lang="bash" line> # 시스템 재부팅 reboot </syntaxhighlight> 재부팅 후: <syntaxhighlight lang="bash" line> # 원래 인터페이스 이름 복원 여부 확인 ip -br link # NetworkManager 장치 상태 확인 nmcli device status </syntaxhighlight> == 13. 주요 장애 증상별 확인 항목 == {| class="wikitable" |- ! 증상 ! 우선 확인할 항목 |- | 재부팅 후 eth0이 없음 | 커널 인수, systemd link 파일, MAC 주소 오타 |- | eth0과 eth1 순서가 반대로 됨 | 단순 net.ifnames=0 방식의 검색 순서, MAC 고정 매핑 적용 여부 |- | 인터페이스는 있지만 IP가 없음 | NetworkManager 프로파일의 interface-name, match.interface-name, MAC 주소 |- | NetworkManager에 disconnected 표시 | 프로파일이 이전 ens 이름에만 고정되어 있는지 확인 |- | 기본 게이트웨이가 없음 | eth0 프로파일의 ipv4.gateway와 ipv4.never-default 확인 |- | DNS가 동작하지 않음 | ipv4.dns 및 /etc/resolv.conf 확인 |- | SSH 접속이 안 됨 | IP 주소, 라우팅, firewalld 존, sshd 리스닝 상태 |- | 본딩 포트가 올라오지 않음 | 본딩 포트 프로파일의 interface-name과 bond.options primary 값 |- | firewalld 규칙이 적용되지 않음 | 변경된 인터페이스가 올바른 존에 연결되었는지 확인 |- | 콜서버가 NIC를 찾지 못함 | eth0 이름, ifcfg-eth0 파일, DEVICE, NAME, HWADDR 값 |- | 재부팅할 때마다 이름이 달라짐 | MAC 주소 기반 systemd link 설정 적용 |} == 14. 권장 최종 구성 예시 == 구형 콜서버에서 eth0과 eth1을 반드시 요구하는 경우 다음 구성을 권장한다. <syntaxhighlight lang="text" line> eth0 MAC 주소: 00:50:56:aa:bb:01 용도: 관리 및 서비스망 NetworkManager 프로파일: eth0 구형 설정 파일: ifcfg-eth0 eth1 MAC 주소: 00:50:56:aa:bb:02 용도: 음성망 또는 내부망 NetworkManager 프로파일: eth1 구형 설정 파일: ifcfg-eth1 </syntaxhighlight> 단순히 net.ifnames=0만 사용하는 것보다 MAC 주소와 이름을 명확하게 매핑하고 NetworkManager 프로파일에도 MAC 주소를 지정하는 편이 안전하다. == 15. 빠른 점검 명령어 == <syntaxhighlight lang="bash" line> # 운영체제 확인 cat /etc/os-release # 현재 커널 인수 확인 cat /proc/cmdline # 설치된 커널의 부팅 인수 확인 grubby --info=ALL | grep -E '^kernel=|^args=' # 인터페이스 이름과 MAC 주소 확인 ip -br link # IP 주소 확인 ip -br address # 라우팅 확인 ip route # NetworkManager 장치 상태 확인 nmcli device status # 프로파일과 장치 매핑 확인 nmcli -f NAME,UUID,TYPE,DEVICE,FILENAME connection show # systemd link 파일 확인 ls -l /etc/systemd/network/*.link # eth0 MAC 주소 확인 cat /sys/class/net/eth0/address # eth1 MAC 주소 확인 cat /sys/class/net/eth1/address # firewalld 존 확인 firewall-cmd --get-active-zones # 실패한 서비스 확인 systemctl --failed # NetworkManager 로그 확인 journalctl -u NetworkManager -b --no-pager # 인터페이스 이름 변경 로그 확인 journalctl -k -b | grep -i -E 'renamed from|eth0|eth1' </syntaxhighlight> == 16. 작업 순서 요약 == <syntaxhighlight lang="text" line> 1. 콘솔 접속 수단 확보 2. 현재 인터페이스와 MAC 주소 확인 3. NetworkManager 및 GRUB 설정 백업 4. 변경 방법 선택 5. 기존 프로파일을 이전 이름과 새 이름에 임시 매칭 6. net.ifnames=0 방식 또는 MAC 기반 link 파일 적용 7. 필요 시 initramfs 재생성 8. 시스템 재부팅 9. eth0, eth1 이름과 MAC 주소 확인 10. NetworkManager 프로파일 이름 정리 11. 본딩, 방화벽, 애플리케이션 설정 수정 12. 구형 프로그램 사용 시 ifcfg-eth0, ifcfg-eth1 확인 13. IP, 라우팅, DNS, SSH 및 서비스 정상 여부 검증 14. 변경 후 설정 다시 백업 </syntaxhighlight> == 관련 문서 == * Rocky Linux 9 초기 설치 및 기본 서버 설정 * Rocky Linux 9 네트워크 인터페이스 본딩 설정 * Rocky Linux 9 구형 ifcfg 파일 형식 적용 * Rocky Linux 9 NetworkManager 관리 * Rocky Linux 9 GRUB2 및 커널 부팅 옵션 관리 * Rocky Linux 9 네트워크 장애 분석
인터페이스 이름변경
문서로 돌아갑니다.
둘러보기 메뉴
개인 도구
로그인
associated-pages
문서
토론
한국어
보기
읽기
원본 보기
역사 보기
더 보기
검색
둘러보기
대문
최근 바뀜
임의 문서로
미디어위키 도움말
특수 문서 목록
도구
여기를 가리키는 문서
가리키는 글의 최근 바뀜
문서 정보