IT/Linux

Ubuntu 22.04 LTS Terminal에서 아이피 주소 변경하기

어디갈까 2022. 8. 18. 07:44
반응형

1. Ubuntu 22.04 LTS Terminal에서 아이피 주소 변경하기

1) 인터페이스 정보 확인

"ifconfig"명령어로 인터페이스 이름 확인

 

2) netplan 설정 파일 변경

"vim /etc/netplan/00-installer-config.yaml" 명령 실행하여 netplan 설정 파일을 vi편집기로 열어서 앞에서 확인한 네트워크 인터페이스 이름 아래에 있는 IP설정 정보를 변경합니다.

# This is the network config written by 'subiquity'
network:
  ethernets:
    ens33:
      addresses:
      - 192.168.35.81/24
      gateway4: 192.168.35.1
      nameservers:
        addresses:
        - 8.8.8.8
        search: []
  version: 2

3) "sudo netplan apply" 명령을 통해 설정파일 변경 내용 적용 및 "ifconfig"명령을 통한 IP주소 변경 내용 확인과 "ping 8.8.8.8"을 통해 네트워크 정상 작동 여부 점검 (8.8.8.8은 구글 DNS주소)

 

 

2. 참고사항

ifconfig명령 실행시 아래 에러가 발생할 경우 "sudo apt install net-tools" 명령 실행

command 'ifconfig' not found, but can be installed with:
sudo apt install net-tools

 

 

반응형