Skip to content

Instantly share code, notes, and snippets.

@ziozzang
Last active February 11, 2019 01:44
Show Gist options
  • Select an option

  • Save ziozzang/102ec0dd6f01ed28d51f752babcaa1fc to your computer and use it in GitHub Desktop.

Select an option

Save ziozzang/102ec0dd6f01ed28d51f752babcaa1fc to your computer and use it in GitHub Desktop.
안드로이드 테더링에 대한 리서치
 Below are commands that Android talking to netd to start/stop tethering.

1. Start tethering
"softap fwreload wlan0 AP"
"softap start wlan0"
"softap set wlan0 wl0.1 hotspot456 open null 6 0 8"
"softap startap"
"interface getcfg wlan0"
"interface setcfg wlan0 192.168.43.1 24 [up]"
"tether interface add wlan0"
"ipfwd enable"
"tether start 192.168.43.2 192.168.43.254"
"tether dns set 10.177.0.34 10.180.12.172"
"nat enable wlan0 rmnet0 2 fe80::/64 192.168.43.0/24"

2. Stop tethering
"interface getcfg wlan0"
"interface setcfg wlan0 0.0.0.0 0 [up broadcast running multicast]"
"softap stopap"
"softap stop wlan0"
"softap fwreload wlan0 STA"
"nat disable wlan0 rmnet0 0" 
"tether interface remove wlan0"
"tether stop"
"ipfwd disable"

Oreo +

# services/core/java/com/android/server/connectivity/Tethering.java
enableTetheringInternal
INetworkManagementService
mNMService.startTethering


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment