このエントリーをはてなブックマークに追加

5. ネットワーク設定

OSインストール時に後回しにしていた、OSのネットワーク設定を行います。

ネットワークに関しては、 ネットワーク構成 を参照してください。

5.1. ubuntu1210-adネットワーク設定

5.1.1. /etc/hostname

$ cat /etc/hostname
ubuntu1210-ad.example.local

5.1.2. /etc/hosts

$ head -3 /etc/hosts
127.0.0.1 localhost
10.0.0.10 ubuntu1210-ad.example.local ubuntu1210-ad

ノート

headで表示しているのは、ipv6の表示を見せたくなかったからです。

5.1.3. /etc/resolvconf/resolv.conf.d/base

$ cat /etc/resolvconf/resolv.conf.d/base
search example.local
nameserver 10.0.0.10
nameserver 10.0.0.20

ノート

旧来の/etc/resolv.confでは、上書きされてしまうためこちらのファイルを設定しております。

5.1.4. /etc/network/interfaces

$ cat /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 eth0
iface eth0 inet static
  address 10.0.0.10
  netmask 255.255.255.0
  network 10.0.0.0
  broadcast 10.0.0.255
  gateway 10.0.0.1

5.2. centos63-adネットワーク設定

5.2.1. /etc/sysconfig/network

# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=centos63-ad.example.local

5.2.2. /etc/hosts

# cat /etc/hosts
10.0.0.20   centos63-ad.example.local centos63-ad
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

5.2.3. /etc/resolv.conf

# cat /etc/resolv.conf
search example.local
nameserver 10.0.0.20
nameserver 10.0.0.10

5.2.4. /etc/sysconfig/network-scripts/ifcfg-eth0

# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="static"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"
IPADDR=10.0.0.20
NETWORK=10.0.0.0
NETMASK=255.255.255.0
BROADCAST=10.0.0.255
GATEWAY=10.0.0.1

目次

前のトピックへ

4. ネットワーク構成

次のトピックへ

6. samba初期設定

外部リンク

ブログ