USB over SoftEther VPN~RaspberryPI의 USB를 클라우드를 넘어 PC에 연결합니다~

12456 단어 RaspberryPiSoftEther
USB over IP 기술을 사용하여 수중에 있는 랩베리 Pi를 끼워 넣은 USB를 클라우드 기기에 인식한다.
VPN 도구SoftEther VPN를 USB over IP 도구VirtualHere로 사용합니다.

VPN 구축


VPN 서버(AWS EC2)


SPEC
Region
Tokyo (ap-northest-1c)
AMI
Amazon Linux AMI 2014.09.1 (HVM) - ami-4985b048 64bit
Instance Type
m3.medium
VPC Subnet
172.30.2.0/24 (Auto-assign Public IP Enable)
Storage
8GB (General Purpose SSD)
Security Group
22/tcp, 443/tcp, 500/udp, 4500/udp

설치하다.

$ sudo yum -y update
$ sudo yum -y groupinstall "Development Tools"
$ wget http://jp.softether-download.com/files/softether/v4.12-9514-beta-2014.11.17-tree/Linux/SoftEther_VPN_Server/64bit_-_Intel_x64_or_AMD64/softether-vpnserver-v4.12-9514-beta-2014.11.17-linux-x64-64bit.tar.gz
$ tar xvfz softether-vpnserver-v4.12-9514-beta-2014.11.17-linux-x64-64bit.tar.gz
$ cd vpnserver/
$ make
 Do you want to read the License Agreement for this software ? -> 1. Yes
 Did you read and understand the License Agreement ? -> 1. Yes
 Did you agree the License Agreement ? -> 1. Agree
$ cd ~
$ vpnserver/vpncmd
 1. VPN Server または VPN Bridge の管理
 2. VPN Client の管理
 3. VPN Tools コマンドの使用 (証明書作成や通信速度測定)

 1 - 3 を選択: 3
 VPN Tools>check
 ...
 すべてのチェックに合格しました。このシステム上で SoftEther VPN Server / Bridge が正しく動作する可能性が高いと思われます。

 コマンドは正常に終了しました。
 VPN Tools>exit
$ sudo vpnserver/vpnserver start
"VPN Tools에 대한 check 명령을 실행하고""적격""을 확인한 후 VPN 서버를 시작합니다."

설정

$ vpnserver/vpncmd
 1. VPN Server または VPN Bridge の管理
 2. VPN Client の管理
 3. VPN Tools コマンドの使用 (証明書作成や通信速度測定)

 1 - 3 を選択: 1

 接続先のホスト名または IP アドレス: localhost:443
 接続先の仮想 HUB 名を入力: (何も入力せずにENTER)
 VPN Server>ServerPasswordSet

# Listenerの設定
 VPN Server>ListenerDisable 992
 VPN Server>ListenerDisable 1194
 VPN Server>ListenerDisable 5555
 VPN Server>ListenerList
 ポート番号|状態
 ----------+------
 TCP 443   |動作中
 TCP 992   |停止中
 TCP 1194  |停止中
 TCP 5555  |停止中

# DynamicDNSの設定
 VPN Server>DynamicDnsSetHostname aws-softether-server
 VPN Server>DynamicDnsGetStatus
 項目                                    |値
 ----------------------------------------+-----------------------------
 割当ダイナミック DNS ホスト名 (完全)    |aws-softether-server.softether.net
 割当ダイナミック DNS ホスト名 (ホスト名)|aws-softether-server
 DNS サフィックス                        |.softether.net
 グローバル IPv4 アドレス                |XX.XX.XX.XX

# 仮想HUBの作成
 VPN Server>HubCreate SE_VHUB
 VPN Server>Hub SE_VHUB

# 接続ユーザの作成
 VPN Server/SE_VHUB>UserCreate mac
 VPN Server/SE_VHUB>UserPasswordSet mac
 VPN Server/SE_VHUB>UserCreate raspi
 VPN Server/SE_VHUB>UserPasswordSet raspi
 VPN Server/SE_VHUB>UserCreate win
 VPN Server/SE_VHUB>UserPasswordSet win

# DHCPの設定設定
 VPN Server/SE_VHUB>SecureNatEnable
 VPN Server/SE_VHUB>DhcpEnable
 VPN Server/SE_VHUB>DhcpGet
 項目                                |値
 ------------------------------------+--------------
 仮想 DHCP 機能を使用する            |はい
 配布アドレス帯の開始                |192.168.30.10
 配布アドレス帯の終了                |192.168.30.200
 サブネットマスク                    |255.255.255.0
 リース期限 (秒)                     |7200
 デフォルトゲートウェイアドレス      |192.168.30.1
 DNS サーバー アドレス 1             |192.168.30.1
 DNS サーバー アドレス 2             |なし
 ドメイン名                          |
 NAT および DHCP の動作のログ保存    |はい
 プッシュする静的ルーティングテーブル|

# L2TP/IPSecの有効化
 VPN Server>IPsecEnable
  L2TP over IPsec サーバー機能を有効 (yes / no): yes
  Raw L2TP サーバー機能を有効 (yes / no): no
  EtherIP / L2TPv3 over IPsec サーバー機能を有効 (yes / no): no
  IPsec 事前共有鍵の文字列 (9 文字以下を推奨): awssevpn
  VPN 接続時に仮想 HUB 名が省略された場合のデフォルト仮想 HUB 名: SE_VHUB

 VPN Server>IPsecGet
 項目                                          |値
 ----------------------------------------------+--------
 L2TP over IPsec サーバー機能は有効            |はい
 Raw L2TP サーバー機能は有効                   |いいえ
 EtherIP / L2TPv3 over IPsec サーバー機能は有効|いいえ
 IPsec 事前共有鍵の文字列                      |awssevpn
 デフォルト仮想 HUB 名                         |SE_VHUB

VPN 클라이언트(Raspberry Pi)


SPEC
Device
Raspberry Pi model B+
OS
7.6 (3.12.28+ #709)
hostname
raspi

설치하다.

$ wget http://jp.softether-download.com/files/softether/v4.12-9514-beta-2014.11.17-tree/Linux/SoftEther_VPN_Client/32bit_-_ARM_EABI/softether-vpnclient-v4.12-9514-beta-2014.11.17-linux-arm_eabi-32bit.tar.gz
$ tar xvfz softether-vpnclient-v4.12-9514-beta-2014.11.17-linux-arm_eabi-32bit.tar.gz 
$ cd vpnclient/
$ make
 Do you want to read the License Agreement for this software ? -> 1. Yes
 Did you read and understand the License Agreement ? -> 1. Yes
 Did you agree the License Agreement ? -> 1. Agree
$ cd ~
$ sudo ./vpnclient/vpnclient start

설정

$ vpnclient/vpncmd
 1. Management of VPN Server or VPN Bridge 
 2. Management of VPN Client
 3. Use of VPN Tools (certificate creation and Network Traffic Speed Test Tool)

 Select 1, 2 or 3: 2

 Hostname of IP Address of Destination: localhost
 VPN Client>PasswordSet 

# 仮想NICの作成
 VPN Client>NicCreate SE_VNIC
 VPN Client>exit
 $ sudo sh -c "echo 'allow-hotplug vpn_se_vnic' >> /etc/network/interfaces"
 $ sudo sh -c "echo 'iface vpn_se_vnic inet dhcp' >> /etc/network/interfaces"
# VPN接続アカウントの作成
$ vpnclient/vpncmd
 1. Management of VPN Server or VPN Bridge 
 2. Management of VPN Client
 3. Use of VPN Tools (certificate creation and Network Traffic Speed Test Tool)

 Select 1, 2 or 3: 2

 Password: 
 VPN Client>AccountCreate raspi
  Destination VPN Server Host Name and Port Number: aws-softether-server.softether.net:443
  Destination Virtual Hub Name: SE_VHUB
  Connecting User Name: raspi
  Used Virtual Network Adapter Name: SE_VNIC
 VPN Client>AccountPasswordSet raspi
  Password: ****************
  Confirm input: ****************
  Specify standard or radius: standard
 VPN Client>AccountStartupSet raspi
 VPN Client>KeepEnable raspi
 VPN Client>AccountStatusShow raspi
 VPN Client>exit
$sudo shutdown -r now

잇닿다

$ sudo ./vpnclient/vpnclient start
$ ifconfig
vpn_se_vnic Link encap:Ethernet  HWaddr 00:ac:ce:27:7b:ae  
          inet addr:192.168.30.10  Bcast:192.168.30.255  Mask:255.255.255.0
$ vpnclient/vpncmd
 1. Management of VPN Server or VPN Bridge 
 2. Management of VPN Client
 3. Use of VPN Tools (certificate creation and Network Traffic Speed Test Tool)

 Select 1, 2 or 3: 2

 Hostname of IP Address of Destination: localhost

 Password:

 VPN Client>AccountList
 Item                        |Value
 ----------------------------+------------------------------------------------
 VPN Connection Setting Name |raspi
 Status                      |Connected
 VPN Server Hostname         |aws-softether-server.softether.net:443 (Direct TCP/IP Connection)
 Virtual Hub                 |SE_VHUB
 Virtual Network Adapter Name|SE_VNIC

VPN 클라이언트(Mac)


SPEC
Device
MacBook Air 11-inch Mid 2011
OS
Mac OS X Lion 10.7.5(11G63)
hostname
Air.local

설정


L2 TP over IPSec을 사용한 연결 설정

서버 주소에서 DynamicDNS로 지정한 도메인 이름을 지정하고 계정 이름에서 만든 연결 사용자 중 하나를 지정합니다.

[세부 정보] 버튼을 눌러 지정된 사용자의 암호와 IPSec 사전 공유 키를 입력합니다.

잇닿다


L2 TP over IPSec을 통해 연결합니다.
$ ifconfig
ppp0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1280
    inet 192.168.30.10 --> 1.0.0.1 netmask 0xffffff00 

VPN 클라이언트(Win)


SPEC
Device
Surface Pro 3
OS
Windows 8.1 Pro
hostname
surface-pro3

설치하다.


다음 파일을 다운로드하고 실행합니다.
http://jp.softether-download.com/files/softether/v4.12-9514-beta-2014.11.17-tree/Windows/SoftEther_VPN_Client/softether-vpnclient-v4.12-9514-beta-2014.11.17-windows-x86_x64-intel.exe




해당 네트워크에서 PC, 장치, 컨텐츠를 찾아 프린터, TV 등에 자동으로 연결하는 대화 상자가 나타나면 예를 선택합니다.이렇게 하면 VPN이 Windows FireWall에 의해 차단되지 않는 "사용 네트워크"로 생성됩니다.
공용 네트워크로 만들면 PC 설정 네트워크 > 이더넷에서 만든 VPN을 선택하여 장치 및 컨텐츠 검색을 시작할 수 있습니다.

잇닿다


SoftEther VPN Client에서 연결

USB over IP 구축


USB over IP 서버(Raspberry Pi)


VirtualHere용 USB 서버 프로그램 Raspberry Pi 구성
(다운로드한 파일에만 실행권 부여)
$ wget --no-check-certificate https://www.virtualhere.com/sites/default/files/usbserver/vhusbdarmhf
$ chmod 755 vhusbdarmhf

USB over IP 클라이언트(Win)


USB 클라이언트 Windows용 VirtualHere 구성
(다운로드한 실행 파일만 해당 폴더에 저장)

USB over SoftEthernet VPN 인증


USB over IP 서버 시작


클라우드 PC에서 공유하려는 USB 장치를 Raspberry Pi에 연결한 후 다음 명령을 사용하여 VirtualHere의 USB over IP 서버를 시작합니다
$ sudo ./vhusbdarmhf 
VirtualHere USB Server is running...press ^C to stop

클라우드 PC에 로그인


SoftEther VPN으로 연결되어 있기 때문에 클라우드 기기의Firewall이나 인터넷 인터페이스 공유기에 아무런 설정이 없어도 RDP를 안전하게 진행할 수 있습니다
(RDP가 연결되지 않을 경우 클라우드 PC에 구축된 SoftEther VPN이'사용 네트워크'로 만들어졌는지 확인)

클라우드 PC에 USB 장치 설정


PC에서 VirtualHere 클라이언트를 실행합니다.

USB Hubs] Specify Hubs에서 SoftEther VPN에 있는 Raspberry Pi의 IP 주소를 입력합니다.

설정이 올바르면 Raspberry Pi에 연결된 USB 장치가 표시됩니다.

원하는 USB 장치를 두 번 클릭하면 SoftEther VPN을 통해 Raspberry Pi와 연결된 USB 장치가 PC에서 인식됩니다.

네트워크 속도


실행속도 ※ 1
RTT※2
LAN
9.53MB/s
<1ms
Wifi AP
1.06MB/s
50ms
SoftEther VPN over LTE
0.071MB/s
179ms
※ 1: 윈도PC에서 랩베리피에 6000byte ping을 치면, 600000*2/RTT 평균치보다 개산
※ 2: 윈도PC에서 랩버리피까지의 32 byte ping RTT 평균치

USB2.0 디바이스의 입출력 속도


Sequential Read
Sequential Write
Random Read
Random Write
직접 연결
18.85MB/s
5.076MB/s
18.77MB/s
1.175MB/s
LAN
3.140MB/s
2.058MB/s
3.155MB/s
1.170MB/s
Wifi AP
1.301MB/s
1.114MB/s
1.328MB/s
0.711MB/s
SoftEther VPN over LTE
측정할 수 없음
측정할 수 없음
측정할 수 없음
측정할 수 없음

총결산

  • USB over SoftEther over LTE가 움직이는 건 맞지만 안타깝게도 현재 시점에서 속도의 폐물이 될 수 없다
  • USB over LAN 또는 USB over Wifi가 USB 카메라(320x240) 정도면 충분합니다
  • 좋은 웹페이지 즐겨찾기