#navi(../)
本記事は「[[仮想化関連ソフト/andLinuxのインストールと日本語化]]」の続編になります。
* andLinuxのIPアドレスの変更方法 [#q3256411]
andLinuxのIPアドレスはインストール時192.168.11.150になっています。~
実は、BUFFALOの無線LANルータが192.168.11.*を各マシンに割り当てており、192.168.11.1がゲートウェイになっています。~
したがって、andLinuxを起動するとIPアドレスが原因でインターネットに接続できない状態になってしまいました。~
早速IPアドレスを直してみます。
#contents
#htmlinsertpcsp(win-top.html,win-sp.html)
* andLinuxのIPアドレス変更 [#a84263b8]
以下の例は、192.168.11.150から192.168.200.150に変更した時の作業手順です。
* andLinux側の作業 [#abb0057b]
** /etc/network/interfaces ファイルの編集 [#a9eed910]
/etc/network/interfacesの編集をします。~
sudo vi /etc/network/interfacesなどとしてファイル編集を行ってください。~
尚、編集した箇所は&color(red){赤字};になっています。~
*** /etc/network/interfaces [#s8fc2d20]
# 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~
&color(red){#}; address 192.168.11.150~
&color(red){ address 192.168.200.150};~
netmask 255.255.255.0~
# gateway 192.168.11.1~
&color(red){ gateway 192.168.200.1};~
** /etc/rc.localの編集 [#o14984a9]
/etc/rc.localの編集をします。~
sudo vi /etc/rc.localなどとしてファイル編集を行ってください。~
尚、編集した箇所は&color(red){赤字};になっています。~
既存の行をコピー&コメントアウトしIPアドレスを変更しています。
*** /etc/rc.local [#y06cdbe5]
#!/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.~
&color(red){#};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~
&color(red){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の変更 [#r144298d]
/etc/hostsの編集をします。~
sudo vi /etc/hostsなどとしてファイル編集を行ってください。~
尚、編集した箇所は&color(red){赤字};になっています。~
*** /etc/hosts [#t6fabd26]
127.0.0.1 localhost~
&color(red){#};192.168.11.150 andLinux~
&color(red){#};192.168.11.1 windows-host~
&color(red){192.168.200.150 andLinux};~
&color(red){192.168.200.1}; &color(red){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の変更 [#t088d81b]
/etc/profileの編集をします。~
sudo vi /etc/profileなどとしてファイル編集を行ってください。~
尚、編集した箇所は&color(red){赤字};になっています。~
*** /etc/profile [#k0957b8e]
#!/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~
&color(red){#};export DISPLAY=192.168.11.1:0.0~
&color(red){#};export ESPEAKER=192.168.11.1:16001~
&color(red){#};export PULSE_SERVER=192.168.11.1~
&color(red){export DISPLAY=192.168.200.1:0.0};~
&color(red){export ESPEAKER=192.168.200.1:16001};~
&color(red){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側の作業 [#zfb0f60c]
本記事で利用しているWindowsはXPです。
** TAP-ColinuxのIPアドレスを変更 [#y2d79661]
+ネットワーク接続でTAP-Colinuxを選択しプロパティをクリックします。
#ref(andlinux-ip-01.png)
#br
+インターネットプロトコル(TCP/IP)を選択しプロパティ(R)を押します。
#ref(andlinux-ip-02.png)
#br
+IPアドレスを192.168.200.1に変更します
#ref(andlinux-ip-03.png)
#br
+OKボタンを押していき設定を反映させます。
**Xmingの設定 [#wd9ef35a]
本資料ではandLinuxをC:\Program Files\andLinuxにインストールしました。以下このディレクトリで説明していきます。
**X0.hostsの修正 [#h8f6150a]
X0.hostsファイルはC:\Program Files\andLinux\Xmingにあります。
#ref(andlinux-ip-04.png)
***X0.hosts [#sc2faed2]
X0.hostsの編集をします。~
尚、編集した箇所は&color(red){赤字};になっています。~
localhost~
192.168.&color(red){200};.1~
192.168.&color(red){200};.150~
以上でWindows側の修正は完了です。
andLinuxを停止しWindowsを再起動すれば設定が反映されandLinux側のIPアドレスが変わった状態で使用できます。
#br
#htmlinsertpcsp(win-btm.html,win-sp.html)
#br