본문 바로가기

LINUX

Ubuntu> network DHCP&Static 설정


1. 네트워크 설정 파일 접근

# vi /etc/network/interfaces

 

2-1. 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

 

2-2. static으로 설정

# 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 xxx.xxx.xxx.xxx

 netmask xxx.xxx.xxx.xxx

 gateway xxx.xxx.xxx.xxx

 dns-nameservers xxx.xxx.xxx.xxx

 

3. 네트워크 재시작

# sudo service networking restart