본문 바로가기

Server

ubuntu 고정 IP 셋팅 방법

리눅스 우분투 고정 IP 셋팅 방법

 

1>   /etc/network/intefacesIP를 셋팅한다

명령어

 

sudo vim /etc/network/interfaces

 

interfaces 파일에 들어가서 아이피를 추가한다

# This file describes the network interfaces available on your system

# and how to activate them. For more information, see interfaces(5)

auto lo

iface lo inet loopback

##----추가한 부분------------##

# The loopback network interface

auto eth0

#iface eth0 inet static

iface eth0 inet static

address ###.###.###.###  // IP 주소

netmask ###.###.###.### // 서브넷 마스크

gateway ###.###.###.### // 게이트웨이

##----추가한 부분------------##

 

2>   /etc에 가서 resolv.conf 파일을 만들어야 한다~

명령어

sudo vim resolv.conf

 

resolv.conf 파일에 아래 내용을 입력한다..

 

nameserver 168.126.63.1 // DNS 서버

 

 

3>   마지막으로 networking restart 를 한다.

sudo /etc/init.d/networking restart

 

 

4>   ifconfig eth0  이나 ifconfig  명령어를 사용하여 변경된 아이피 주소를 확인한다.

5>   ping 명령어를 사용해서 인터넷이 되는지 확인한다.

'Server' 카테고리의 다른 글

redhat enterprise 6.2 네트워크(ip) 설정  (0) 2012.10.09
rhel 5.5 setting - 2  (0) 2012.09.19
rhel 5.5 setting - 1  (0) 2012.09.14
vim 명령어  (0) 2012.08.16
netstat 의 옵션, Status 의미, 사용 예  (0) 2011.12.04