ページ

ラベル Software の投稿を表示しています。 すべての投稿を表示
ラベル Software の投稿を表示しています。 すべての投稿を表示

2013年7月20日土曜日

最新バージョンの hostapd をインストールする。

Linux で 無線LANカード を アクセスポイント として利用するには hostapd を利用するのが手っ取り早いです。

そんなわけでサックリと入れてしましましょう。

GITから最新版を持ってきます。
# git clone git://w1.fi/srv/git/hostap.git
# cd hostap/hostapd

設定情報を変更します。
IEEE 802.11nとIEEE 802.11acは利用したいのでコメント外してyにしておく。
opensslを利用しない場合はコメント外してnoneに変更してください。
# cp defconfig .config
# vi .config

# IEEE 802.11n (High Throughput) support
CONFIG_IEEE80211N=y

# IEEE 802.11ac (Very High Throughput) support
CONFIG_IEEE80211AC=y

# Select TLS implementation
# openssl = OpenSSL (default)
# gnutls = GnuTLS
# internal = Internal TLSv1 implementation (experimental)
# none = Empty template
#CONFIG_TLS=openssl

上記設定でOpenSSLモジュールの設定をしていない場合は
OpenSSLを必要とするため、サクっといれておく。
ついでにnl80211ドライバもいれておく。
# yum install -y openssl-devel libnl-devel

あとは普通にインストールする。
# make && make install

2013年2月10日日曜日

Fedora 18 でhostapdを利用して無線LAN AP構築

ソフトウェアのインストール


今回はAtherosチップ中心で検証していくので、
Linux用ドライバを先にインストールしておく。

カーネルバージョンに応じてココからドライバを取得する。

構築時のカーネルは 3.7.2 だったので 3.7 のドライバを取得する。
# wget "http://www.kernel.org/pub/linux/kernel/projects/backports/stable/v3.7-rc1/compat-drivers-3.7-rc1-6.tar.bz2"
# tar jxf compat-drivers-3.7-rc1-6.tar.bz2
# cd compat-drivers-3.7-rc1-6
# make && make install
# make unload
FATAL: Module bluetooth is in use.
# lsmod
Module                  Size  Used by
ath9k                 145352  0 
ath9k_common           13649  1 ath9k
ath9k_hw              399423  2 ath9k_common,ath9k
ath                    23143  3 ath9k_common,ath9k,ath9k_hw
mac80211              545141  1 ath9k
cfg80211              201547  3 ath,ath9k,mac80211

hostapdをインストールする。
# yum install libnl-devel
# wget "http://hostap.epitest.fi/releases/hostapd-2.0.tar.gz"
# tar zxvf hostapd-2.0.tar.gz
# cd hostapd-2.0/hostapd/
# cp -fp defconfig .config


IEEE 802.11nは利用したいのでコメント外してyにしておく。
opensslは利用しないのでnoneに変更しておく。
# vi .config

# IEEE 802.11n (High Throughput) support
CONFIG_IEEE80211N=y

# Select TLS implementation
# openssl = OpenSSL (default)
# gnutls = GnuTLS
# internal = Internal TLSv1 implementation (experimental)
# none = Empty template
#CONFIG_TLS=openssl
CONFIG_TLS=none

あとは普通にインストールする。
# make
# make install


2012年7月24日火曜日

Fedora 16 でLIO(Linux open source iSCSI target)のiSCSIを利用する

参考公式サイト ココココ

■ インストール


# yum -y install targetcli

■ 設定用のソフトを起動する


# targetcli

■ バージョンの確認


/> version
targetcli version 2.0rc1.fb8

■ 簡単な使い方


基本的に全てコマンドベースで作成していく。

・ルートからのディレクトリ階層

/> ls
o- / ........................................................... [...]
  o- backstores ................................................ [...]
  | o- block ...................................... [0 Storage Object]
  | o- fileio ..................................... [0 Storage Object]
  | o- pscsi ...................................... [0 Storage Object]
  | o- ramdisk .................................... [0 Storage Object]
  o- ib_srpt ............................................. [Not found]
  o- iscsi ................................................ [0 Target]
  o- loopback ............................................. [0 Target]
  o- qla2xxx ............................................. [Not found]
  o- tcm_fc .............................................. [Not found]


ヘルプは使用出来るコマンドの一覧が表示されるが、ディレクトリ階層で異なる。

・ルートディレクトリからのヘルプ

/> help

GENERALITIES
============
This is a shell in which you can create, delete and configure
configuration objects.

The available commands depend on the current path or target
path you want to run a command in: different path have
different sets of available commands, i.e. a path pointing at
an iscsi target will not have the same availaible commands as,
say, a path pointing at a storage object.

The prompt that starts each command line indicates your
current path. Alternatively (useful if the prompt displays
an abbreviated path to save space), you can run the
pwd command to display the complete current path.

Navigating the tree is done using the cd command. Without
any argument, cd will present you wil the full objects
tree. Just use arrows to select the destination path, and
enter will get you there. Please try help cd for navigation
tips.

COMMAND SYNTAX
==============
Commands are built using the following syntax:

[TARGET_PATH] COMMAND_NAME [OPTIONS]

The TARGET_PATH indicates the path to run the command from.
If ommited, the command will be run from your current path.

The OPTIONS depend on the command. Please use help
COMMAND to get more information.


AVAILABLE COMMANDS
==================
The following commands are available in the
current path:

  - bookmarks action [bookmark] 
  - cd [path] 
  - clearconfig [confirm] 
  - exit 
  - get [group] [parameter...] 
  - help [topic] 
  - ls [path] [depth] 
  - pwd 
  - refresh 
  - restoreconfig [savefile] [clear_existing] 
  - saveconfig [savefile] 
  - sessions [action] [sid] 
  - set [group] [parameter=value...] 
  - status 
  - version 
/> 


・backstoresへ移動

/> cd backstores
/backstores> ls
o- backstores .................................................. [...]
  o- block ........................................ [0 Storage Object]
  o- fileio ....................................... [0 Storage Object]
  o- pscsi ........................................ [0 Storage Object]
  o- ramdisk ...................................... [0 Storage Object]
/backstores>

・backstoresディレクトリからのヘルプ(一部抜粋)

/backstores> help

・・・ 抜粋 ・・・

AVAILABLE COMMANDS
==================
The following commands are available in the
current path:

  - bookmarks action [bookmark] 
  - cd [path] 
  - exit 
  - get [group] [parameter...] 
  - help [topic] 
  - ls [path] [depth] 
  - pwd 
  - refresh 
  - set [group] [parameter=value...] 
  - status 
/backstores> 


■ iSCSIを作成する


公式に書いてあるけれど、よくわからない。
作成後の自動移動?もしかしたらそのままの意味かも。とりあえず変更しておく。
/> set global auto_cd_after_create=false

作成出来るデバイスとして、投稿時点では4種類あります。

  • block   … 主に物理デバイス(HDD)を使用する
  • fileio   … ファイルを仮想ディスクとして使用する
  • pscsi   … 恐らくSCSIデバイスを使用する(未確認)
  • ramdisk … 自身のメモリを消費してRAM Diskとして利用する


・block作成の場合のサンプル例

/backstores> cd /backstores/block
/backstores/block> create name=myblock dev=/dev/disk/by-id/scsi-xxxx-part-1


・fileio作成の場合のサンプル例

/backstores> cd /backstores/fileio
/backstores/fileio> create name=myscsi file_or_dev=/root/myscsi.img buffered=true

/backstores/fileio> help
create name file_or_dev [size] [buffered] [sparse] 

[size] [sparse] に関してはよく分からない。
使用するファイルは事前にddなどで作成しておく。
サンプル例は150GBのファイルを作成
# dd if=/dev/zero of=/root/myscsi.img bs=1G count=150


・pscsi作成の場合のサンプル例

手持ちにSCSIデバイスが無いので未確認です。
使い方は他と変わらないのでSCSIデバイスを指定してあげれば行けるかも知れない。
/backstores> cd /backstores/pscsi
/backstores/pscsi> create name=xxxx dev=/dev/xxxx


・ramdisk作成の場合のサンプル例

RAM Diskとして自身のメモリをiSCSIデバイスとして提供出来ます。
物理メモリが沢山搭載されている場合に有効なデバイスだと思います。
RAM Diskとしての特性があると思うので、
データバックアップ・リストアを自分で行う必要有りです。
/backstores> cd /backstores/ramdisk
/backstores/ramdisk> create name=myram size=2G


・iSCSI Target情報の作成

デバイス作成した後はiSCSI Targetとしての設定を行う。
デバイス作成でname指定した名称へ移動する。
※以降、fileioとして記載します。
/backstores/fileio/myscsi> /iscsi create
Created target iqn.2003-01.org.linux-iscsi.hoge.x8664:sn.d2f860cab8b1.
Created TPG 1.
Entering new node /iscsi/iqn.2003-01.org.linux-iscsi.hoge.x8664:sn.d2f860cab8b1/tpg1


・LUNを設定する

/iscsi/iqn.20...60cab8b1/tpg1> cd /
/> cd /iscsi/iqn.2003-01.org.linux-iscsi.hoge.x8664:sn.d2f860cab8b1/tpg1
/iscsi/iqn.20...60cab8b1/tpg1> luns/ create /backstores/fileio/myscsi
Created LUN 0.
Entering new node /iscsi/iqn.2003-01.org.linux-iscsi.hoge.x8664:sn.d2f860cab8b1/tpg1/luns/lun0


・iSCSI TargetのIPアドレスを設定する

/iscsi/iqn.20...60cab8b1/tpg1> portals/ create 192.168.2.109
Using default IP port 3260
Created network portal 192.168.2.109:3260.


・ACLを設定する

iSCSI Initiator側のイニシエータ名を指定します。
/iscsi/iqn.20...60cab8b1/tpg1> acls/ create iqn.1991-05.com.microsoft:zzz-pc
Created Node ACL for iqn.1991-05.com.microsoft:zzz-pc
Created mapped LUN 0.


・ターゲットシークレットを設定する

Windows7 のiSCSIイニシエーターだと認証無しだと
通過出来なかったのでユーザーとパスワードを設定します。
/iscsi/iqn.20...60cab8b1/tpg1> cd acls/iqn.1991-05.com.microsoft:zzz-pc
/iscsi/iqn.20...icrosoft:zzz-pc> set auth userid=hogeuser
Parameter userid is now 'hogeuser'.
/iscsi/iqn.20...icrosoft:zzz-pc> set auth password=mytargetsecret
Parameter password is now 'mytargetsecret'.


・設定情報を保存する

/iscsi/iqn.20...icrosoft:zzz-pc> cd /
/> saveconfig
Existing file /etc/target/saveconfig.json backed up to saveconfig.json.backup
Configuration saved to /etc/target/saveconfig.json
/> exit


・LIOを起動させる

# systemctl start targetcli.service
# systemctl enable targetcli.service


・再設定する場合

再度targetcliを行ってlsコマンドを打つと初期化状態に戻る時があります。
そんな時は下記のコマンドで設定状態を戻す。
/> restoreconfig /etc/target/saveconfig.json

2012年7月21日土曜日

Fedora16でのVNC Server

■ インストール

# yum -y install tigervnc-server
# su - fedora 
$ vncpasswd
$ vncserver :1
$ vncserver -kill :1



■  1環境のみの場合

# cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@1.service
# vi /etc/systemd/system/vncserver@1.service

ExecStart=/sbin/runuser -l fedora -c "/usr/bin/vncserver %i"
ExecStop=/sbin/runuser -l fedora -c "/usr/bin/vncserver -kill %i"

# systemctl start vncserver@1.service
# systemctl enable vncserver@1.service