Android route 설정

Android : 2014. 12. 30. 11:16

출처 :

Today I needed to add a route on the android shell but was greated with "Invalid Argument" failures, there is no "-h", no man page. So we will have to use the sourcecode.

First of all the code is in /system/core/toolbox/route.c

and it supports three types of argument..

route add default dev DEVICE

route add default gw IP dev DEVICE

route add -net IP netmask NETMASK gw IP

For some reason, route.c does not allow routes to be deleted. So routes can only be added. ip route ... allows routes to be added, deleted, and has a nice show:

e.g., to add (must run as root):

ip route add via dev eth0

e.g., to delete (must run as root)

ip route del via dev eth0

e.g., to show

ip route show


'Android' 카테고리의 다른 글

Android 4.2 Stagefright  (0) 2015.01.09
Android EGL  (0) 2014.11.28
Android 4.2 Audio Sub System  (0) 2014.11.28
Posted by Real_G

댓글을 달아 주세요