Tech/Linux

ubuntu 20.04 ip address setting

항상초보 2022. 3. 7. 08:16
반응형
  • ubuntu 20.04에서 IP 설정

 

1) 설정 파일 접근

sudo vim /etc/netplan/00-installer-config.yaml

 

 

2) 처음 설치할때 별도로 설정하지 않으면 아래와 같은 상태입니다.

 

아래와 같은 상황이고 고정아이피를 사용하지 않을경우 그냥 사용해도 괜찮습니다.

# This is the network config written by 'subiquity'
network:
  ethernets:
    eno1:
      dhcp4: true
    enp2s0:
      dhcp4: true
  version: 2

 

3) 고정 IP를 사용하는 경우 

 

# This is the network config written by 'subiquity'
network:
  ethernets:
    eno1:
      dhcp4: true
    enp2s0:
      dhcp4: no
      addresses: [192.168.0.164/24]
      gateway4: 192.168.0.1
      nameservers:
        addresses: [8.8.8.8]
  version: 2

4) 위와 같이 설정후 적용해주면 됩니다.

 

sudo netplan --debug apply
반응형

'Tech > Linux' 카테고리의 다른 글

ubuntu 20.04 한영변환  (0) 2022.03.08
Install Chrome on Ubuntu 20.04  (0) 2022.03.04
Ubuntu network 이름 수정  (0) 2021.03.11
Linux Filesystem resize  (0) 2021.03.02