2013年3月20日水曜日

Parallels De CentOS Part.2 CentOSのネットワーク設定

前回の続き

Parallels Desktopのネットワーク確認

メニューから[Parallels Desktop]-[環境設定] をクリックします
ネットワーク:「設定の変更」ボタンをクリックします


開始アドレスと終了アドレスを確認し、ゲストOSで使用するIPアドレスを決定する。
※ゲストOSのIPアドレスを「10.211.55.101」とします。


Parallels Desktopのネットワーク確認

ゲストOSにrootでログインします
hadoop login:root
Password:
Last login: ...
[root@hadoop ~]#

ネットワーク設定のため、ifcfg-eth0をviで開きます
[root@hadoop ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0

ほとんど何も書かれていないので、[i](insert mode)して、以下の設定を記載し、[Esc]+[:wq]で書き込み終了します(ボールドが変更する箇所)
DEVICE="eth0"
BOOTPROTO=static
HWADDR="xx:xx:xx:xx:xx:xx"
IPADDR=10.211.55.101
NETMASK=255.255.255.0
NETWORK=10.211.55.0
GATEWAY=10.211.55.1
BROADCAST=10.211.55.255
NM_CONTROLLED="no"
ONBOOT="yes"
PEERDNS="no"

DNSを設定します。/etc/resolv.confをviで開きます
[root@hadoop ~]# vi /etc/resolv.conf

何も書かれていないので、[i](insert mode)で設定を記載して、[Esc]+[:wq]で書き込み終了します
nameserver 10.211.55.1

ネットワークを再起動します
[root@hadoop ~]# /etc/rc.d/init.d/network start

ifconfigでネットワーク確認します
[root@hadoop ~]# ifconfig
eth0  Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx  
          inet addr:10.211.55.101  Bcast:10.211.55.255  Mask:255.255.255.0
          inet6 addr: fec0::fea9:21c:42ff:fee4:998f/64 Scope:Site
          inet6 addr: fe80::21c:42ff:fee4:998f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:67 errors:0 dropped:0 overruns:0 frame:0
          TX packets:51 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:8494 (8.2 KiB)  TX bytes:5893 (5.7 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

MacOSのターミナルからpingします
macBook-Air:~ hogehoge$ ping 10.211.55.101
PING 10.211.55.101 (10.211.55.101): 56 data bytes
64 bytes from 10.211.55.101: icmp_seq=0 ttl=64 time=0.319 ms
64 bytes from 10.211.55.101: icmp_seq=1 ttl=64 time=0.397 ms
64 bytes from 10.211.55.101: icmp_seq=2 ttl=64 time=0.400 ms
64 bytes from 10.211.55.101: icmp_seq=3 ttl=64 time=0.682 ms

sshでログインします
macBook-Air:~ hogehoge$ ssh -l root 10.211.55.101

警告が表示されますがひるまずにパスワードを設定します
The authenticity of host '10.211.55.101 (10.211.55.101)' can't be established.
RSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.211.55.101' (RSA) to the list of known hosts.
root@10.211.55.101's password: 

yum update & wget install

yum updateを実行します
[root@hadoop ~]# yum update

yes
Is this ok [y/N]: y

さらにyes
警告: rpmts_HdrFromFdno: ヘッダ V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
 Userid : CentOS-6 Key (CentOS 6 Official Signing Key) 
 Package: centos-release-6-2.el6.centos.7.x86_64 (@anaconda-CentOS-201112091719.x86_64/6.2)
 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Is this ok [y/N]: y

終わるまでしばらく待ちます
  udev.x86_64 0:147-2.46.el6
  upstart.x86_64 0:0.6.5-12.el6
  util-linux-ng.x86_64 0:2.17.2-12.9.el6
  vim-minimal.x86_64 2:7.2.411-1.8.el6
  xfsprogs.x86_64 0:3.1.1-10.el6
  yum.noarch 0:3.2.29-40.el6.centos
  yum-plugin-fastestmirror.noarch 0:1.1.30-14.el6
  zlib.x86_64 0:1.2.3-29.el6

Complete!

wgetをインストールします
[root@hadoop ~]# yum -y install wget

次回に続く

0 件のコメント: