LoginSignup
16
16

More than 5 years have passed since last update.

CentOSのネットワーク関係の設定

Posted at

NICへのIPアドレス割り当て

vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
DHCPCLASS=
HWADDR=00:AC:D9:B2:C0:EE
IPADDR=192.168.0.1
NETMASK=255.255.255.0
ONBOOT=yes

GateWayの設定

vi /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=CENTOS
GATEWAY=192.168.0.254

DNSサーバの設定

vi /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4

設定の反映

設定を反映させるためには、ネットワークサービスを再起動する。
DNSサーバの設定は、再起動なしでも反映される。

service network restart
16
16
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
16
16