このエントリーをはてなブックマークに追加


本記事は「仮想化関連ソフト/andLinuxのインストールと日本語化」の続編になります。

andLinuxのIPアドレスの変更方法

andLinuxのIPアドレスはインストール時192.168.11.150になっています。
実は、BUFFALOの無線LANルータが192.168.11.*を各マシンに割り当てており、192.168.11.1がゲートウェイになっています。
したがって、andLinuxを起動するとIPアドレスが原因でインターネットに接続できない状態になってしまいました。
早速IPアドレスを直してみます。


andLinuxのIPアドレス変更

以下の例は、192.168.11.150から192.168.200.150に変更した時の作業手順です。

andLinux側の作業

/etc/network/interfaces ファイルの編集

/etc/network/interfacesの編集をします。
sudo vi /etc/network/interfacesなどとしてファイル編集を行ってください。
尚、編集した箇所は赤字になっています。

/etc/network/interfaces

# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
# /usr/share/doc/ifupdown/examples for more information.

auto lo eth0 eth1

iface lo inet loopback

#iface eth0 inet dhcp

iface eth0 inet static
    address 10.0.2.15
    gateway 10.0.2.2
    netmask 255.255.255.0

iface eth1 inet static
#    address 192.168.11.150
    address 192.168.200.150
    netmask 255.255.255.0
#    gateway 192.168.11.1
    gateway 192.168.200.1

/etc/rc.localの編集

/etc/rc.localの編集をします。
sudo vi /etc/rc.localなどとしてファイル編集を行ってください。
尚、編集した箇所は赤字になっています。
既存の行をコピー&コメントアウトしIPアドレスを変更しています。

/etc/rc.local

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

#mount -t cifs -o credentials=/etc/smbpasswd,iocharset=utf8,codepage=cp932,uid=ユーザID,gid=グループID,dir_mode=0755,file_mode=0755 //192.168.11.1/シェアフォルダ名 /mnt/win
mount -t cifs -o credentials=/etc/smbpasswd,iocharset=utf8,codepage=cp932,uid=ユーザID,gid=グループID,dir_mode=0755,file_mode=0755 //192.168.200.1/シェアフォルダ名 /mnt/win

exit 0

/etc/hostsの変更

/etc/hostsの編集をします。
sudo vi /etc/hostsなどとしてファイル編集を行ってください。
尚、編集した箇所は赤字になっています。

/etc/hosts

127.0.0.1       localhost
#192.168.11.150 andLinux
#192.168.11.1   windows-host
192.168.200.150 andLinux
192.168.200.1   windows-host

# The following lines are desirable for IPv6 capable hosts
# (added automatically by netbase upgrade)

::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

/etc/profileの変更

/etc/profileの編集をします。
sudo vi /etc/profileなどとしてファイル編集を行ってください。
尚、編集した箇所は赤字になっています。

/etc/profile

#!/bin/bash
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games"

if [ "$BASH" ]; then
  PS1='[\u@\h \W]\$ '
else
  if [ "`id -u`" -eq 0 ]; then
    PS1='# '
  else
    PS1='$ '
  fi
fi

export PATH PS1

# set DISPLAY env variable
#export DISPLAY=192.168.11.1:0.0
#export ESPEAKER=192.168.11.1:16001
#export PULSE_SERVER=192.168.11.1
export DISPLAY=192.168.200.1:0.0
export ESPEAKER=192.168.200.1:16001
export PULSE_SERVER=192.168.200.1
umask 022

# Japanese Input Settings
export GTK_IM_MODULE=scim-bridge
export QT_IM_MODULE=scim-bridge
if [ -f /etc/X11/Xsession.d/80im-switch ]; then
  . /etc/X11/Xsession.d/80im-switch > /dev/null 2>&1
fi

以上でandLinux側の設定は終了です。

Windows側の作業

本記事で利用しているWindowsはXPです。

TAP-ColinuxのIPアドレスを変更

  1. ネットワーク接続でTAP-Colinuxを選択しプロパティをクリックします。
    andlinux-ip-01.png
     
  2. インターネットプロトコル(TCP/IP)を選択しプロパティ(R)を押します。
    andlinux-ip-02.png
     
  3. IPアドレスを192.168.200.1に変更します
    andlinux-ip-03.png
     
  4. OKボタンを押していき設定を反映させます。

Xmingの設定

本資料ではandLinuxをC:\Program Files\andLinuxにインストールしました。以下このディレクトリで説明していきます。

X0.hostsの修正

X0.hostsファイルはC:\Program Files\andLinux\Xmingにあります。

andlinux-ip-04.png

X0.hosts

X0.hostsの編集をします。
尚、編集した箇所は赤字になっています。
localhost
192.168.200.1
192.168.200.150

以上でWindows側の修正は完了です。

andLinuxを停止しWindowsを再起動すれば設定が反映されandLinux側のIPアドレスが変わった状態で使用できます。

 

 

添付ファイル: fileandlinux-ip-03.png 448件 [詳細] fileandlinux-ip-01.png 490件 [詳細] fileandlinux-ip-02.png 480件 [詳細] fileandlinux-ip-04.png 466件 [詳細]

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2015-03-20 (金) 22:49:06