고정 ip를 사용하게 될 경우..
/etc/network/interfaces 라는 파일을 수정함으로 바꿀 수 있다.
nextcrom@coms:~$ sudo vi /etc/network/interfaces
# 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 eth1
# iface eth1 inet dhcp # dhcp로 세팅 시 사용
iface eth1 inet static # 고정 ip로 세팅할 시 사용
address xxx.xxx.xxx.xxx
netmask 255.255.255.xxx
network xxx.xxx.xxx.xxx
broadcast xxx.xxx.xxx.xxx
gateway xxx.xxx.xxx.xxx
# 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 eth1
# iface eth1 inet dhcp # dhcp로 세팅 시 사용
iface eth1 inet static # 고정 ip로 세팅할 시 사용
address xxx.xxx.xxx.xxx
netmask 255.255.255.xxx
network xxx.xxx.xxx.xxx
broadcast xxx.xxx.xxx.xxx
gateway xxx.xxx.xxx.xxx
세팅이 완료되면 데몬을 재시작 함으로 적용시킬 수 있다.
nextcrom@coms:~$ sudo /etc/init.d/networking restart
적용된 세팅을 확인하기 위해서는 ifconfig 명령을 사용하면 확인할 수 있다.
nextcrom@coms:~$ ifconfig eth1
eth1 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:xxx.xxx.xxx.xxx Bcast:xxx.xxx.xxx.xxx Mask:255.255.255.xxx
inet6 addr:xxxx::xxxx:xxxx:xxxx:xxxx/xx Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1540 Metric:1
RX packets:62092 errors:0 dropped:0 overruns:0 frame:0
TX packets:39519 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:8652169 (8.2 MiB) TX bytes:44541558 (42.4 MiB)
nextcrom@coms:~$
eth1 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:xxx.xxx.xxx.xxx Bcast:xxx.xxx.xxx.xxx Mask:255.255.255.xxx
inet6 addr:xxxx::xxxx:xxxx:xxxx:xxxx/xx Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1540 Metric:1
RX packets:62092 errors:0 dropped:0 overruns:0 frame:0
TX packets:39519 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:8652169 (8.2 MiB) TX bytes:44541558 (42.4 MiB)
nextcrom@coms:~$
'Programming > LINUX' 카테고리의 다른 글
리눅스 커널 bit 확인 (0) | 2013.06.07 |
---|---|
우분투 + Wordpress 설치 준비 작업 (0) | 2012.03.26 |
Ubuntu Server Graphic 환경 설정 (0) | 2011.12.01 |
[스크랩] 우분투에 아파치+톰캣 설치하기 (0) | 2011.11.23 |
[Linux]그룹 및 사용자 계정 생성, 디렉토리 생성 및 설정 (0) | 2011.11.10 |