前提条件
uPnP SDKとLinux-IGDを用いて、LinuxルータをuPnP対応ルータに仕立て上げる。
Windowsメッセンジャーのファイル転送にはuPnPが使用されていないらしい。MSNメッセンジャーを使用すればuPnPでいいっぽい。
uPnP SDK
sourceforgeからlibupnp-1.2.1a.tar.gzをダウンロード
こんなパッチをあてるとDirectPlay対応になるらしい
--- backup/libupnp-1.2.1a/upnp/src/soap/soap_device.c 2003-02-14 01:19:20.000000000 +0900
+++ libupnp-1.2.1a/upnp/src/soap/soap_device.c 2006-01-28 12:23:13.000000000 +0900
@@ -524,7 +524,12 @@
return ret_code;
}
- snprintf( ns_compare, tempSize, "\"%s", urn );
+ //snprintf(ns_compare, tempSize, "\"%s", urn);
+ if ( temp_header_value[0] == '\"' ) {
+ snprintf(ns_compare, tempSize, "\"%s", urn);
+ } else {
+ snprintf(ns_compare, tempSize, "%s", urn);
+ }
if( strcmp( temp_header_value, ns_compare ) ) {
ret_code = UPNP_E_INVALID_ACTION;
Linux-IGD
CVS版を取得
$ cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/linux-igd login
Logging in to :pserver:anonymous@cvs.sourceforge.net:2401/cvsroot/linux-igd
CVS password: ←Passwordは空
$ cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/linux-igd co linux-igd
cvs checkout: Updating linux-igd
cvs checkout: Updating linux-igd/doc
cvs checkout: Updating linux-igd/etc
$
/etc/upnpd.confを修正
#
# The full path and name of the iptables executable
#
iptables_location = /sbin/iptables ←環境に合わせて修正
#
# Daemon debug mode
# 0 - no debug messages
# 1 - debug via syslog to debug
# default = 0
#debug_mode = 1 ←ログが大量に出るので出ないように
#
# Should the daemon insert rules in the forward chain
# This is necessary if your firewall has a drop or reject
# policy in your forward chain.
# allowed values: yes,no
# default = no
#insert_forward_rules = yes ←うちではfilterテーブルのFORWARDチェーンはACCEPTで他にルールを設定していないのでコメントアウト
#
# The name of the chain to put the forward rules in.
# This directive is only activ if "insert_forward_rules = yes"
# above.
# allowed values: a-z, A-Z, _, -
# default = FORWARD
#
forward_chain_name = FORWARD
#
# The name of the chain to put prerouting rules in.
# allowed values: a-z, A-Z, _, -
# default = PREROUTING
prerouting_chain_name = PREROUTING
#
# The internet line upstream bit rate reported from
# the daemon. Value in bits per second
# default = 0
upstream_bitrate = 1024000
#
# The internet line downstream bit rate reported from
# the daemon. Value in bits per second
# default = 0
downstream_bitrate = 20480000
# The name of the igd device xml description document
# default = gatedesc.xml
description_document_name = gatedesc.xml
# The path to the xml documents
# Do not include the trailing "/"
# default = /etc/linuxigd
# WARNING! The make install does put the xml files
# in /etc/linuxigd, if you change this variable
# you have to make sure the xml docs are in the
# right place
xml_document_path = /etc/linuxigd
残課題
MSNメッセンジャーの[ツール]→[オプション]の[接続]で[接続の状況]には「UPnPポート制限付きNAT(restricted)を経由してインターネットに接続しています。(Administrator)」と出る。
・ポート制限付きNATと対称NATの差はなんだろう。
・対称NATにするにはどうしたらいいんだろう。
偏ったトラブルシュート
・ログに以下のエラーが出てupnpdが起動できない
Dec 28 21:16:57 cinnamon upnpd: Initializing UPnP SDK ...
Dec 28 21:16:57 cinnamon upnpd: Error Initializing UPnP SDK on IP XXX.XXX.XXX.XXX ←LAN側のIPアドレス
Dec 28 21:16:57 cinnamon upnpd: UpnpInit returned -203
ポートが使用中なのでバインドできませ~ん うちでは、Link-Playerのためにwizdを使用していて、サーバの自動認識のためにポート1900が使用されていたためにupnpdでListenできずに異常終了していた。 wizd側で自動認識(SSDP)を使わないようにしたところ、起動できるようになった。

コメントする