7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CentOS 7.x 初期設定メモ

Last updated at Posted at 2016-01-09

一般

ユーザ/グループの作成 (if necessary)

# useradd {user name}
# passwd {user name}
# groupadd {group name}
# usermod -G {group name} {user name}
# cat /etc/group

SELinuxの無効化

# getenforce
# setenforce 0
# vi /etc/sysconfig/selinux
/etc/sysconfig/selinux
SELINUX=disabled

IPv6の無効化

# vi /etc/sysctl.conf
/etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
# sysctl -p

不要なサービスの停止

# systemctl stop NetworkManager
# systemctl disable NetworkManager

不要なサービスの削除

  • postfix
# systemctl stop postfix
# yum erase postfix

パッケージの更新 (if necessary)

# yum -y update

ネットワーク

コマンド対応

net-tools iproute2
ifconfig ip a(addr), ip l(link)
route ip r(route)
netstat ss
netstat -i ip -s l(link)
arp ip n(neighbor)

インターフェースの確認

# ethtool {nicName}

インターフェースの設定

# vi /etc/sysconfig/network-scripts/ifcfg-{NIC name}
/etc/sysconfig/network-scripts/ifcfg-*
DEVICE={NIC name}
TYPE=Ethernet
HWADDR={MAC Address}
BOOTPROTO=none
ONBOOT=yes
NM_CONTROLLED=no
IPV6INIT=no
IPADDR={IP address}
NETMASK={subnet mask}
GATEWAY={gateway IP address}
PEERDNS=no
# systemctl restart network

仮想インターフェースの設定

# vi /etc/sysconfig/network-scripts/ifcfg-{NIC name}:{id}
/etc/sysconfig/network-scripts/ifcfg-*
DEVICE={NIC name}:{id}
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
IPV6INIT=no
IPADDR={IP address}
NETMASK={subnet mask}```
# systemctl restart network

スタティックルートの設定

# vi /etc/sysconfig/network-scripts/route-{NIC name}
/etc/sysconfig/network-scripts/route-*
192.168.0.0/24 via 192.168.0.254 dev eth1
default via 10.0.0.254 dev eth0
# systemctl restart network
# ip r

[VLANの設定] (http://qiita.com/tomo_n/items/e99125ea5443a6d8449a)

DNSの設定

# vi /etc/resolv.conf
/etc/resolv.conf
nameserver {IP address}
7
7
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
7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?