Help us understand the problem. What is going on with this article?

VMのCentOSのネットワーク設定

More than 5 years have passed since last update.

メモ。

ネットワーク設定

  • 192.168.1 を環境に合わせる。
ifcfg-eth1
DEVICE=eth1
HWADDR=08:00:27:FA:A0:57
TYPE=Ethernet
UUID=31eb95fb-21ca-4b39-9977-cbf6070d991e
ONBOOT=yes
NM_CONTROLLED=yes
# BOOTPROTO=dhcp
BOOTPROTO=static

# IPv4 static
IPADDR=192.168.1.2
GATEWAY=192.168.1.1
NETWORK=192.168.1.0
NETMASK=255.255.255.0

DNS1=8.8.8.8
DNS2=8.8.4.4

ルーティング

# /etc/init.d/network restart
# route del default gw 192.168.0.1
# route add default gw 192.168.1.1

ホスト名の変更

# cp -p /etc/sysconfig/network /etc/sysconfig/network.$(date -I)
# vi /etc/sysconfig/network
/etc/sysconfig/network
NETWORKING=YES
NETWORKING_IPV6=NO
HOSTNAME=localhost.localdomain
# reboot-n now

SELINUX の無効化

# cp -p /etc/selinux/config /etc/selinux/config.$(date -I)
# vi /etc/selinux/config
/etc/selinux/config
SELINUX=disabled
SELINUXTYPE=targeted

SELINUX の無効有効化

# cp -p /etc/selinux/config /etc/selinux/config.$(date -I)
# vi /etc/selinux/config
/etc/selinux/config
SELINUX=enforcing
SELINUXTYPE=targeted

sshdの許可

# cp -p /etc/host.allow /etc/host.allow.$(date -I)
# vi /etc/host.allow
/etc/host.allow
sshd : 192.168.1.
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away