ここまでやって来た環境を有効にするための環境設定方法.
ネットワーク関連.
/etc/networks.opts を書き換えて,無線LAN時の設定を有効にする.
# Host's IP address, netmask, network address, broadcast address IPADDR=''192.168.96.70'' NETMASK=''255.255.0.0'' NETWORK=''192.168.0.0'' BROADCAST=''192.168.255.255'' # Gateway address for static routing GATEWAY=''192.168.96.253'' # Things to add to /etc/resolv.conf for this interface DOMAIN=''jsk.t.u-tokyo.ac.jp'' SEARCH='''' DNS_1=''192.168.96.164'' DNS_2='''' DNS_3=''''
以下は設定できなかった.無視をする.
/etc/wirelss.opts を書き換えて,無線LAN時のESSID設定つくる. ファイルの先頭の方を書き換える.一番最後を書き換えても有効にならない.
case "$ADDRESS" in # NOTE : Remove the following four lines to activate the samples below... # --------- START SECTION TO REMOVE ----------- *,*,*,*) ESSID="4DA07AJSK" RATE="11M" ;; # ---------- END SECTION TO REMOVE ------------/etc/rc.d/rc.local を書き換えて,普通のLAN(eth0)の設定を無効にする.
if [ `ifconfig | grep eth0 | wc -l` == 1 ]; then echo eth0 is already up # /sbin/ifconfig eth0 else # echo eth0 is not up, bringing it up \(IP=192.168.1.100\) # /sbin/ifconfig eth0 192.168.1.100 netmask 255.255.255.0 # /sbin/route add -net default netmask 0.0.0.0 gw 192.168.1.1 echo do not up eth0, use wireless sleep 4 # ←これはとても重要 iwconfig eth1 essid 4DA07AJSK # /usr/sbin/dhcpcd # /sbin/ifconfig eth0 fi
一度リブートした後に,/etc/resolv.confを書き換えて,
# eth1 begin domain jsk.t.u-tokyo.ac.jp nameserver 192.168.96.164 # eth1 end #domain localnet #nameserver 192.168.1.1 #search localnet #nameserver 192.168.1.1とする.
ローカルユーザ作成.
$ addusr leusとしてローカルユーザを作る.
hostnameの変更.
/etc/HOSTNAMEを書き換える.
外からloginできるようにする.
rootになって,
$ chmod a+x /usr/bin/loginとする.
動作確認
[root@dnestr /root]$ iwconfig lo no wireless extensions. Warning : Device eth1 has been compiled with version 11 of Wireless Extension, while we are using version 13. Some things may be broken... eth1 IEEE 802.11-DS ESSID:"4DA07AJSK" Nickname:"Prism I" Mode:Managed Frequency:2.457GHz Access Point:00:60:1D:F6:3D:10 Bit Rate:2Mb/s Tx-Power=15 dBm Sensitivity:1/3 Retry min limit:8 RTS thr:off Fragment thr:off Encryption key:off Power Management:off