IPの変更
インストール時にDHCPになっていたので、それをスタティックなIPに変更します。
当然、root権限で変更を行います。
# 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なIPに変更するには、下記のように変更します。
# 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 # <- 環境に応じてIP等は変更してください。
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
変更が終了したら、interfaceを再起動します。
# ifdown eth0
# ifup eth0
eth0の状態を確認して、変わっていたらOKです。
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:04:5F:82:1E:A8
inet addr:192.168.1.100 Bcast:10.255.255.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:58952 errors:0 dropped:0 overruns:0 frame:0
TX packets:21586 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:84793809 (80.8 MiB) TX bytes:1392902 (1.3 MiB)
Interrupt:10 Base address:0xe800
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:18 errors:0 dropped:0 overruns:0 frame:0
TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1252 (1.2 KiB) TX bytes:1252 (1.2 KiB)