IPhone USB 테더링
- 본 문서는 우분투에서 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 커널 드라이버 모듈을 불러옵니다
{{#ifeq: msg|user|~|{{#ifeq: misc|user|~ sudo modprobe ipheth|{{#ifeq: root|user|ubuntu-korea|{{#ifeq: user|user|user@ubuntu-korea|(undefined)}}}} ~ {{#ifeq: root|user|#|{{#ifeq: user|user|$|$}}}} sudo modprobe ipheth}}}}
{{#ifeq: msg|user|~|{{#ifeq: misc|user|~ lsmod | grep ipheth|{{#ifeq: root|user|ubuntu-korea|{{#ifeq: user|user|user@ubuntu-korea|(undefined)}}}} ~ {{#ifeq: root|user|#|{{#ifeq: user|user|$|$}}}} lsmod | grep ipheth}}}}
정상적으로 불러왔다면 lsmod 명령 결과에 나타납니다.
dmesg 명령으로 정상적으로 불러왔는지 확인합니다
{{#ifeq: msg|user|~|{{#ifeq: misc|user|~ dmesg | grep ipheth|{{#ifeq: root|user|ubuntu-korea|{{#ifeq: user|user|user@ubuntu-korea|(undefined)}}}} ~ {{#ifeq: root|user|#|{{#ifeq: user|user|$|$}}}} dmesg | grep ipheth}}}}
{{#ifeq: msg|msg|usbcore: registered new interface driver ipheth|{{#ifeq: misc|msg|usbcore: registered new interface driver ipheth {{{2}}}|{{#ifeq: root|msg|ubuntu-korea|{{#ifeq: user|msg|user@ubuntu-korea|(undefined)}}}} usbcore: registered new interface driver ipheth {{#ifeq: root|msg|#|{{#ifeq: user|msg|$|$}}}} {{{2}}}}}}}
이제 아이폰을 USB케이블로 연결하고 제대로 연결했는지 아래 명령을 실행하여 확인합니다.
{{#ifeq: msg|user|~|{{#ifeq: misc|user|~ dmesg | grep iPhone|{{#ifeq: root|user|ubuntu-korea|{{#ifeq: user|user|user@ubuntu-korea|(undefined)}}}} ~ {{#ifeq: root|user|#|{{#ifeq: user|user|$|$}}}} dmesg | grep iPhone}}}}
{{#ifeq: msg|msg|ipheth 2-1:4.2: Apple iPhone USB Ethernet device attached|{{#ifeq: misc|msg|ipheth 2-1:4.2: Apple iPhone USB Ethernet device attached {{{2}}}|{{#ifeq: root|msg|ubuntu-korea|{{#ifeq: user|msg|user@ubuntu-korea|(undefined)}}}} ipheth 2-1:4.2: Apple iPhone USB Ethernet device attached {{#ifeq: root|msg|#|{{#ifeq: user|msg|$|$}}}} {{{2}}}}}}}
잠시 기다리면 알림 메시지로 새로운 네트워크 장치 등록을 알립니다. 네트워크 관리 프로그램에서 새로운 장치(보통 auto eth1)등록이 확인됩니다.
이제 잘 사용하시면 됩니다 :)