LoginSignup
0
0

More than 5 years have passed since last update.

[CentOS6.x]yumできないときは、ネットワーク設定です。

Last updated at Posted at 2019-02-28

CentOSをインストールした後に、yumをたたいても動かない…
こんなときは、ネットワークを設定しましょう。

+ネットワーク設定

- 手順 -
1.suでユーザーを切替える
2.ネットワーク設定ファイルを編集する
3.ネットワーク再起動する
4.ネットワーク確認してみる


1.suでユーザーを切替える

# su
パスワード:*********

[root@localhost]   ← 切替わった状態

2.ネットワーク設定ファイルを編集する

vimを使用してファイルを開きます。
ONBOOT="no"となっていたら、ONBOOT="yes"に修正して上書きしてください。

# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="dhcp"
HWADDR="00:00:00:00:00:00"
IPV6INIT="yes"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"

3.ネットワーク再起動する

# /etc/rc.d/init.d/network restart

4.ネットワーク確認してみる

# ping -c 4 google.co.jp

PING google.co.jp (172.217.161.35) 56(84) bytes of data.
64 bytes from nrt12s23-in-f3.1e100.net (172.217.161.35): icmp_seq=1 ttl=128 time=368 ms
64 bytes from nrt12s23-in-f3.1e100.net (172.217.161.35): icmp_seq=2 ttl=128 time=125 ms
64 bytes from nrt12s23-in-f3.1e100.net (172.217.161.35): icmp_seq=3 ttl=128 time=256 ms
64 bytes from nrt12s23-in-f3.1e100.net (172.217.161.35): icmp_seq=4 ttl=128 time=72.3 ms

--- google.co.jp ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3076ms
rtt min/avg/max/mdev = 72.392/205.771/368.531/115.311 ms

疎通確認ができれば設定完了となります。

0
0
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
0
0