chibi style
    

Home > Debian > 基本設定 > IPアドレスの固定化

IPアドレスの固定化

サーバ用途で使うのなら、IPアドレスはDHCPで取得するよりも固定にしてしまったほうがいい。
ここでは例として、IPアドレスを192.168.1.11としてみる。なお、192.168.1.0/24に所属しているものとする。

# vi /etc/network/interfaces

# The primary network interface
auto eth0
iface eth0 inet dhcp
↓
# The primary network interface
auto eth0
iface eth0 inet static
        address  192.168.1.11
        network 192.168.1.0
        netmask 255.255.255.0
        broadcast  192.168.1.255
        gateway 192.168.1.1


編集が終わったら、ネットワークを再起動する

# /etc/init.d/networking restart
Setting up IP spoofing protection: rp_filter.
Reconfiguring network interfaces...ifup: interface lo already configured
done.


また、このままでは名前解決ができないので、/etc/resolv.confを編集する

# vi /etc/resolv.conf
search router
nameserver 192.168.1.1	←ルータのIPアドレスを指定


>>このページのTOPへ

最終更新 : 09/26/2005


Copyright © 2004-2007 chibi ,All Rights Reserved