|
IPアドレス及びネットワーク設定変更方法
Copyright by Zou Liangzhi
現環境を以下の環境に変更する(もとのserverがsotec6に変更)
| ホスト名 |
: server.ish.net.it-chiba.ac.jp |
→
|
: sotec6.dreamwork.ish.net.it-chiba.ac.jp |
| IPアドレス |
: 202.17.19.130 |
: 192.168.0.6 |
| ネットワークアドレス |
: 202.17.19.128 |
: 192.168.0.0 |
| BroadCast |
: 202.17.19.143 |
: 192.168.0.255 |
| Gateway |
: 202.17.19.142 |
: 192.168.0.1 |
| Name Server |
: 202.17.19.129 |
: 192.168.0.1 |
1、linuxconf を使用しない場合
1-1、/etc/hosts の編集
# vi /etc/hosts
|
202.17.19.130
|
→
|
192.168.0.6 |
|
server.ish.net.it-chiba.ac.jp
server
|
sotec6.dreamwork.ish.net.it-chiba.ac.jp
sotec6 |
1-2、/etc/sysconfig/network の編集
#vi /etc/sysconfig/network
| HOSTNAME=server.ish.net.it-chiba.ac.jp |
→
|
HOSTNAME=sotec6.dreamwork.ish.net.it-chiba.ac.jp |
| GATEWAY=202.17.19.142 |
GATEWAY=192.168.0.1 |
1-3、/etc/sysconfig/network-scripts/ifcfg-eth0
の編集
#cd /etc/sysconfig/network-scripts/
#vi ifcfg-eth0
| IPADDR=202.17.19.130 |
→
|
IPADDR=192.168.0.6 |
| NETWORK=202.17.19.128 |
NETWORK=192.168.0.0 |
| BROADCAST=202.17.19.143 |
BROADCAST=192.168.0.255 |
1-4、ネットワークの確認
#cd /etc/rc.d/init.d/
#./network stop
#./network start
#ps ax | grep net (inetdが存在することを確認)
#ping 192.168.0.1
ping コマンド(Gatewayマシンへ)によりネットワークが接続されていることを確認(replyがあればOK)
2、linuxconf を使用した場合(linuxconf を使用するとネットワーク設定ファイルに、設定を行った以外の初期値が表示されるが支障なし)
# linuxconf
(linuxconf が起動し、ネットワークなど諸々の設定可能。)
2-1、
+ Config
+ Networking
+ Client tasks
+ Basic host information → 押下(以下のように変更後、「Accept」押下)
| Host name |
: server.ish.net.it-chiba.ac.jp |
→
|
: sotec6.dreamwork.ish.net.it-chiba.ac.jp |
| Primary name + domain |
: server.ish.net.it-chiba.ac.jp |
: sotec6.dreamwork.ish.net.it-chiba.ac.jp |
| Aliases(opt) |
: server |
: sotec6 |
| IP address |
: 202.17.19.130 |
: 192.168.0.6 |
2-2、
+ Config
+ Networking
+ Client tasks
+ Name server specification(DNS) → 押下(以下のように変更後、「Accept」押下)
| nameserver 1 |
: 202.17.19.129 |
→
|
: 192.168.0.1 |
| serach domain 1(opt) |
: ish.net.it-chiba.ac.jp |
: dreamwork.ish.net.it-chiba.ac.jp |
2-3、
+ Config
+ Networking
+ Client tasks
+ Routing and gateways
+ Defaults → 押下(以下のように変更後、「Accept」押下)
| Default gateway |
: 202.17.19.142 |
→
|
: 192.168.0.1 |
2-4、
+ Config
+ Networking
+ Misc
+ Information about other hosts → 押下
| IP number : 202.17.19.130
の行を「del」により削除 |
2-5、linuxconf を終了させる
linuxconf のトップ画面で「Quit」押下。
システム変更の確認画面が表示されるので、「Activate the change」を選択したまま「Quit」押下で、linuxconf
が終了する。
2-6、ネットワークの確認
#cd /etc/rc.d/init.d/
#./network stop
#./network start
#ps ax | grep net (inetdが存在することを確認)
#ping 192.168.0.1
ping コマンド(Gatewayマシンへ)によりネットワークが接続されていることを確認(replyがあればOK)
|