반응형
CentOS를 주로 사용하다가 Ubuntu를 사용하게되니 Network 설정 방법에 차이가 있어 Ubuntu에서 IP Address Setting 하는 방법을 정리해 보았다.
0. Interface 확인
~$ ip addr
위 명령어를 통해 Network Interface 목록을 확인하고, 셋팅하려는 Interface 이름을 획득한다.
아래 예제에서는 interface를 "eno1" 이라고 가정한다.
1-1. STATIC
~$ sudo vim /etc/netplan/99-config.yaml
위 명령어를 통해 아래와 같이 작성 후, 저장한다.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# STATIC | |
network: | |
version: 2 | |
renderer: networkd | |
ethernets: | |
eno1: | |
addresses: | |
- 11.22.33.44/24 | |
gateway4: 11.22.33.1 | |
nameservers: | |
addresses: [1.1.1.1, 8.8.8.8] |
아래의 명령어로 적용한다.
~$ sudo netplan apply
1-2. DHCP (Auto)
~$ sudo vim /etc/netplan/99-config.yaml
위 명령어를 통해 아래와 같이 작성 후, 저장한다.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DHCP | |
network: | |
version: 2 | |
renderer: networkd | |
ethernets: | |
eno1: | |
dhcp4: true |
아래의 명령어로 적용한다.
~$ sudo netplan apply
반응형
'Engineering > OS -Linux, Windows, EXSi' 카테고리의 다른 글
curl : 자주 활용하는 options (0) | 2022.02.18 |
---|---|
linux + docker 환경에서 netstat 로 ESTABLISHED socket 조회하기 (2) | 2022.01.24 |
자주 사용하는 docker 명령어(command) (0) | 2021.12.19 |
Redis : 기본 설치(docker-compose) 및 redis-cli 기본 사용 (1) | 2021.10.08 |
CentOS에서 NFS로 폴더 공유하기 & reboot 후에도 mount 유지하기 (0) | 2021.08.24 |
댓글