일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Rocky Linux 8
- MySQL
- CentOS
- Windows 10 Home
- RHEL
- PostgreSQL
- Rocky Linux
- nextcloud
- WireGuard
- podman
- MariaDB
- RHEL 7
- 자작 NAS
- 라떼판다
- Openstack Rocky
- 라떼판다 우분투
- ubuntu
- LattePanda Ubuntu
- haproxy
- MSA
- Packstack
- CentOS 8
- RDP Wrap
- LattePanda
- centos 7
- 라떼판다 NAS
- openstack
- RHEL 8
- LattePanda NAS
- Kubernetes
Archives
- Today
- Total
간마늘작업소
[Ubuntu] 고정 IP 설정 하기 본문
0.개요
- Ubuntu는 18.04를 기준으로 고정 IP 설정 방법이 달라짐
- Ubuntu 18.04 이전 - networking 서비스로 제어
- Ubuntu 18.04 이후 - netplan으로 제어
1.Ubuntu 18.04 이전
cd /etc/network/
sudo vi interfaces
(전략)
# The primary network interface
auto eth0
# iface eth0 inet dhcp
iface eth0 inet static
address 192.168.0.40
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 8.8.8.8
- 파일 수정.
- eth0 : 네트워크 장치 이름
- dhcp : 자동 할당
- static : 수동 설정
- static 설정한 이후에 사용할 IP, Netmask, 게이트웨이, DNS 서버 설정 진행.
sudo service networking restart
(혹은)
sudo systemctl restart networking
- networking 서비스 재시작.
2.Ubuntu 18.04 이후
cd /etc/netplan/
sudo vi 01-network-manager-all.yaml
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
dhcp6: no
addresses: [192.168.0.40/24]
gateway4: 192.168.0.1
nameservers:
addresses: [8.8.8.8,8.8.4.4]
- 파일 수정.
- eth0 : 네트워크 장치 이름
- dhcp : 자동 할당
- yes로 설정했으면 그 아래 설정들은 기입하지 않아도 됨.
- no로 설정했으면 사용할 IP, Netmask, 게이트웨이, DNS 서버 설정 진행.
sudo netplan apply
- Netplan 적용.
'Linux > 02.Ubuntu' 카테고리의 다른 글
[Ubuntu] Ubuntu Server에 한국어 지원 & 한글 입력 & 기본 시간대 변경 (0) | 2022.10.12 |
---|---|
[Ubuntu] root 계정으로 SSH 접속하기 (0) | 2022.10.12 |
[Ubuntu] 리포지토리 미러 사이트 변경 (0) | 2022.08.30 |
Comments