우분투 서버 네트워크 어댑터 DHCP/고정 IP설정


file


vim /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

 *인터페이스 이름 eth0 은 어댑터에 따라 다를 수 있다.

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 실패시

$ sudo service networking restart
stop: Job failed while stopping
start: Job is already running: networking
sudo ifdown eth0 && sudo ifup eth0

다음 글 이전 글
댓글 쓰기
comment url