/
우분투 서버 네트워크 설정(ubuntu server network config)

우분투 서버 네트워크 설정(ubuntu server network config)

Ubuntu 18 LTS 부터는 netplan 이 적용되어 설정이 변경되었습니다. "ubuntu 18 LTS 고정 ip 설정"을 참고하세요


설정

  1. vi

     vi /etc/network/interfaces

dhcp

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet dhcp


static

# The primary network interface
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.153.131
netmask 255.255.255.0
gateway 192.168.153.2
dns-nameservers 192.168.153.2


반영

network 재시작

sudo service networking restart


service networking restart

service networking restart 실패시

$ sudo service networking restart
stop: Job failed while stopping
start: Job is already running: networking

다음 명령어 실행

sudo ifdown eth0 && sudo ifup eth0


같이 보기

Ref


Related content

Linux Network Manager 를 제어하는 nmcli 명령어
Linux Network Manager 를 제어하는 nmcli 명령어
More like this
ubuntu netplan 으로 고정 ip 설정하기(static ip config)
ubuntu netplan 으로 고정 ip 설정하기(static ip config)
More like this
CentOS nmcli 명령어로 정적 ip (Static IP) 설정하기
CentOS nmcli 명령어로 정적 ip (Static IP) 설정하기
More like this
NetBSD
More like this
firewalld 방화벽 사용
firewalld 방화벽 사용
More like this
systemd를 관리하는 systemctl 주요 사용법
systemd를 관리하는 systemctl 주요 사용법
More like this