IPhone USB 테더링

Ubuntu Korea Community Wiki
imported>Darkcircle님의 2015년 7월 28일 (화) 15:16 판 (→‎우분투에서 사전작업)
둘러보기로 이동 검색으로 이동
  • 본 문서는 우분투에서 iPhone USB 테더링을 사용하는 방법을 서술 하고 있습니다.
  • 기존의 탈옥폰에서 SSH 터널링을 이용하는 방법은 아닙니다
  • Ubuntu 10.04 버전에 관련 라이브러리가 기본으로 포함된 기념으로 작성했습니다.

준비물

  • iPhone (설정→네트워크→테더링을 활성화 해둔 상태)
  • 커널 드라이버 컴파일 환경 (linux-headers-현재커널버전 패키지 및 build-essential 설치된 상태)
  • git 관련
  • libimobiledevice
  • ipheth 프로젝트 파일

우분투에서 사전작업

먼저 git 관련 패키지가 있는지 확인하고 없으면 아래의 명령으로 설치합니다.

{{#ifeq: msg|user|~|{{#ifeq: misc|user|~  sudo apt-get install git-core|{{#ifeq: root|user|ubuntu-korea|{{#ifeq: user|user|user@ubuntu-korea|(undefined)}}}} ~ {{#ifeq: root|user|#|{{#ifeq: user|user|$|$}}}}  sudo apt-get install git-core}}}}

libimobiledevice 관련 라이브러리와 개발패키지를 설치합니다. (10.04에는 리포지토리에 기본으로 있습니다)

{{#ifeq: msg|user|~|{{#ifeq: misc|user|~  sudo apt-get install libimobiledevice0 libimobiledevice-dev|{{#ifeq: root|user|ubuntu-korea|{{#ifeq: user|user|user@ubuntu-korea|(undefined)}}}} ~ {{#ifeq: root|user|#|{{#ifeq: user|user|$|$}}}}  sudo apt-get install libimobiledevice0 libimobiledevice-dev}}}}

ipheth 프로젝트 패키지를 다운로드 합니다.

{{#ifeq: msg|user|~|{{#ifeq: misc|user|~  git clone git://github.com/dgiagio/ipheth.git|{{#ifeq: root|user|ubuntu-korea|{{#ifeq: user|user|user@ubuntu-korea|(undefined)}}}} ~ {{#ifeq: root|user|#|{{#ifeq: user|user|$|$}}}}  git clone git://github.com/dgiagio/ipheth.git}}}}

ipheth 디렉토리에 ipheth-driver와 ipheth-pair 디렉토리가 존재하는지 확인합니다

ipheth-pair 디렉토리에서 컴파일 후 설치합니다

{{#ifeq: msg|user|~|{{#ifeq: misc|user|~  cd ipheth-pair|{{#ifeq: root|user|ubuntu-korea|{{#ifeq: user|user|user@ubuntu-korea|(undefined)}}}} ~ {{#ifeq: root|user|#|{{#ifeq: user|user|$|$}}}}  cd ipheth-pair}}}}
{{#ifeq: msg|user|ipheth-pair|{{#ifeq: misc|user|ipheth-pair  make|{{#ifeq: root|user|ubuntu-korea|{{#ifeq: user|user|user@ubuntu-korea|(undefined)}}}} ipheth-pair {{#ifeq: root|user|#|{{#ifeq: user|user|$|$}}}}  make}}}}
{{#ifeq: msg|user|ipheth-pair|{{#ifeq: misc|user|ipheth-pair  sudo make install|{{#ifeq: root|user|ubuntu-korea|{{#ifeq: user|user|user@ubuntu-korea|(undefined)}}}} ipheth-pair {{#ifeq: root|user|#|{{#ifeq: user|user|$|$}}}}  sudo make install}}}}

ipheth-driver 디렉토리에서 커널 드라이버 모듈을 빌드하고 설치합니다.

{{#ifeq: msg|user|~|{{#ifeq: misc|user|~  cd ipheth-driver|{{#ifeq: root|user|ubuntu-korea|{{#ifeq: user|user|user@ubuntu-korea|(undefined)}}}} ~ {{#ifeq: root|user|#|{{#ifeq: user|user|$|$}}}}  cd ipheth-driver}}}}
{{#ifeq: msg|user|ipheth-driver|{{#ifeq: misc|user|ipheth-driver  make|{{#ifeq: root|user|ubuntu-korea|{{#ifeq: user|user|user@ubuntu-korea|(undefined)}}}} ipheth-driver {{#ifeq: root|user|#|{{#ifeq: user|user|$|$}}}}  make}}}}
{{#ifeq: msg|user|ipheth-driver|{{#ifeq: misc|user|ipheth-driver  sudo make install|{{#ifeq: root|user|ubuntu-korea|{{#ifeq: user|user|user@ubuntu-korea|(undefined)}}}} ipheth-driver {{#ifeq: root|user|#|{{#ifeq: user|user|$|$}}}}  sudo make install}}}}
{{#ifeq: msg|user|ipheth-driver|{{#ifeq: misc|user|ipheth-driver  depmod -a|{{#ifeq: root|user|ubuntu-korea|{{#ifeq: user|user|user@ubuntu-korea|(undefined)}}}} ipheth-driver {{#ifeq: root|user|#|{{#ifeq: user|user|$|$}}}}  depmod -a}}}}

위 과정을 거치면 테더링용 USB 드라이버가 설치됩니다.

테더링 사용

  • 먼저 ipheth 커널 드라이버 모듈을 로드합니다

<SyntaxHighlight lang="bash"> $ sudo modprobe ipheth $ lsmod | grep ipheth (정상적으로 로드되었다면 이 명령을 통해 확인할 수 있습니다) </SyntaxHighlight>

  • 정상적으로 로드되었는지 확인합니다

<SyntaxHighlight lang="bash"> $ dmesg | grep ipheth usbcore: registered new interface driver ipheth (이러한 메시지가 보이게됩니다) </SyntaxHighlight>

  • 이제 아이폰을 USB케이블로 연결하고 아래 명령을 통해서 제대로 연결되었는지 확인합니다.

<SyntaxHighlight lang="bash"> $ dmesg | grep iPhone ipheth 2-1:4.2: Apple iPhone USB Ethernet device attached </SyntaxHighlight>

  • 잠시 기다리면 알림 메시지로 새로운 네트워크 장치 등록을 알립니다.
  • 네트워크 관리 애플릿이나 매니저 프로그램에서 새로운 장치(보통 auto eth1)등록이 확인됩니다
  • 이제 잘 사용하시면 됩니다 :)