android ip route

ip rule show

ip rule show                                                                                                                                                  
0:	from all lookup local 
10000:	from all fwmark 0xc0000/0xd0000 lookup legacy_system 
10500:	from all oif dummy0 uidrange 0-0 lookup dummy0 
10500:	from all oif rmnet_data0 uidrange 0-0 lookup rmnet_data0 
13000:	from all fwmark 0x10063/0x1ffff lookup local_network 
13000:	from all fwmark 0x1000b/0x1ffff lookup rmnet_data0 
14000:	from all oif dummy0 lookup dummy0 
14000:	from all oif rmnet_data0 lookup rmnet_data0 
15000:	from all fwmark 0x0/0x10000 lookup legacy_system 
16000:	from all fwmark 0x0/0x10000 lookup legacy_network 
17000:	from all fwmark 0x0/0x10000 lookup local_network 
19000:	from all fwmark 0xb/0x1ffff lookup rmnet_data0 
23000:	from all fwmark 0x0/0xffff uidrange 0-0 lookup main 
32000:	from all unreachable

ip route show table 0

                                                                                                                                    
default dev dummy0  table dummy0  proto static  scope link 
broadcast 127.0.0.0 dev lo  table local  proto kernel  scope link  src 127.0.0.1 
local 127.0.0.0/8 dev lo  table local  proto kernel  scope host  src 127.0.0.1 
local 127.0.0.1 dev lo  table local  proto kernel  scope host  src 127.0.0.1 
broadcast 127.255.255.255 dev lo  table local  proto kernel  scope link  src 127.0.0.1 
fe80::/64 dev dummy0  table dummy0  proto kernel  metric 256  pref medium
default dev dummy0  table dummy0  proto static  metric 1024  pref medium
fe80::/64 dev rmnet_data0  table rmnet_data0  proto kernel  metric 256  mtu 2000 pref medium
default via fe80::5d6:b137:94a8:7216 dev rmnet_data0  table rmnet_data0  proto ra  metric 1024  expires 31452sec hoplimit 255 pref medium
local ::1 dev lo  table local  proto none  metric 0  pref medium
local fe80::96a:dd37:62a0:97 dev lo  table local  proto none  metric 0  pref medium
local fe80::1497:ebff:fed9:ea6d dev lo  table local  proto none  metric 0  pref medium
ff00::/8 dev dummy0  table local  metric 256  pref medium
ff00::/8 dev rmnet_data0  table local  metric 256  mtu 2000 pref medium

ip route show table dummy0

                                                                                                                 
default dev dummy0  proto static  scope link 

开启 wifi

0:	from all lookup local 
10000:	from all fwmark 0xc0000/0xd0000 lookup legacy_system 
10500:	from all oif dummy0 uidrange 0-0 lookup dummy0 
10500:	from all oif rmnet_data0 uidrange 0-0 lookup rmnet_data0 

10500:	from all oif wlan0 uidrange 0-0 lookup wlan0 

13000:	from all fwmark 0x10063/0x1ffff lookup local_network 
13000:	from all fwmark 0x1000b/0x1ffff lookup rmnet_data0 

13000:	from all fwmark 0x10074/0x1ffff lookup wlan0 

14000:	from all oif dummy0 lookup dummy0 
14000:	from all oif rmnet_data0 lookup rmnet_data0 

14000:	from all oif wlan0 lookup wlan0 

15000:	from all fwmark 0x0/0x10000 lookup legacy_system 
16000:	from all fwmark 0x0/0x10000 lookup legacy_network 
17000:	from all fwmark 0x0/0x10000 lookup local_network 
19000:	from all fwmark 0xb/0x1ffff lookup rmnet_data0 

19000:	from all fwmark 0x74/0x1ffff lookup wlan0 
22000:	from all fwmark 0x0/0xffff lookup wlan0 

23000:	from all fwmark 0x0/0xffff uidrange 0-0 lookup main 
32000:	from all unreachable

ip route show table wlan0

                                                                                                                                    
default via 192.168.1.1 dev wlan0  proto static 
192.168.1.0/24 dev wlan0  proto static  scope link 

ip route show table main

                                                                                                                                 
192.168.1.0/24 dev wlan0  proto kernel  scope link  src 192.168.1.155 

ip route show table 0

                                                                                                                                     
default via 192.168.1.1 dev wlan0  table wlan0  proto static 
192.168.1.0/24 dev wlan0  table wlan0  proto static  scope link 
default dev dummy0  table dummy0  proto static  scope link 
192.168.1.0/24 dev wlan0  proto kernel  scope link  src 192.168.1.155 
broadcast 127.0.0.0 dev lo  table local  proto kernel  scope link  src 127.0.0.1 
local 127.0.0.0/8 dev lo  table local  proto kernel  scope host  src 127.0.0.1 
local 127.0.0.1 dev lo  table local  proto kernel  scope host  src 127.0.0.1 
broadcast 127.255.255.255 dev lo  table local  proto kernel  scope link  src 127.0.0.1 
broadcast 192.168.1.0 dev wlan0  table local  proto kernel  scope link  src 192.168.1.155 
local 192.168.1.155 dev wlan0  table local  proto kernel  scope host  src 192.168.1.155 
broadcast 192.168.1.255 dev wlan0  table local  proto kernel  scope link  src 192.168.1.155 
fd3b:fbcb:a1a::/64 dev wlan0  table wlan0  proto kernel  metric 256  pref medium
fd3b:fbcb:a1a::/64 dev wlan0  table wlan0  proto static  metric 1024  pref medium
fd3b:fbcb:a1a::/48 via fe80::7aa3:51ff:fe35:9796 dev wlan0  table wlan0  proto ra  metric 1024  pref medium
fe80::/64 dev wlan0  table wlan0  proto kernel  metric 256  pref medium
fe80::/64 dev wlan0  table wlan0  proto static  metric 1024  pref medium
fe80::/64 dev dummy0  table dummy0  proto kernel  metric 256  pref medium
default dev dummy0  table dummy0  proto static  metric 1024  pref medium
fe80::/64 dev rmnet_data0  table rmnet_data0  proto kernel  metric 256  mtu 2000 pref medium
default via fe80::5d6:b137:94a8:7216 dev rmnet_data0  table rmnet_data0  proto ra  metric 1024  expires 31174sec hoplimit 255 pref medium
local ::1 dev lo  table local  proto none  metric 0  pref medium
local fd3b:fbcb:a1a:0:5d79:cfb8:a788:dea4 dev lo  table local  proto none  metric 0  pref medium
local fd3b:fbcb:a1a:0:80d5:910b:2d8f:1d86 dev lo  table local  proto none  metric 0  pref medium
local fe80::96a:dd37:62a0:97 dev lo  table local  proto none  metric 0  pref medium
local fe80::1497:ebff:fed9:ea6d dev lo  table local  proto none  metric 0  pref medium
local fe80::35a4:2e6c:d297:6c0a dev lo  table local  proto none  metric 0  pref medium
ff00::/8 dev dummy0  table local  metric 256  pref medium
ff00::/8 dev rmnet_data0  table local  metric 256  mtu 2000 pref medium
ff00::/8 dev wlan0  table local  metric 256  pref medium

开启VPN后
ip rule show


0:	from all lookup local 
10000:	from all fwmark 0xc0000/0xd0000 lookup legacy_system 
10500:	from all oif dummy0 uidrange 0-0 lookup dummy0 
10500:	from all oif rmnet_data0 uidrange 0-0 lookup rmnet_data0 
10500:	from all oif wlan0 uidrange 0-0 lookup wlan0 
11000:	from all iif tun0 lookup local_network 

12000:	from all fwmark 0x0/0x20000 iif lo uidrange 0-99999 lookup tun0 
12000:	from all fwmark 0xc0077/0xcffff lookup tun0 

13000:	from all fwmark 0x10063/0x1ffff lookup local_network 
13000:	from all fwmark 0x1000b/0x1ffff lookup rmnet_data0 
13000:	from all fwmark 0x10076/0x1ffff lookup wlan0 

13000:	from all fwmark 0x10077/0x1ffff uidrange 0-99999 lookup tun0 
13000:	from all fwmark 0x10077/0x1ffff uidrange 0-0 lookup tun0 

14000:	from all oif dummy0 lookup dummy0 
14000:	from all oif rmnet_data0 lookup rmnet_data0 
14000:	from all oif wlan0 lookup wlan0 

14000:	from all oif tun0 uidrange 0-99999 lookup tun0 

15000:	from all fwmark 0x0/0x10000 lookup legacy_system 
16000:	from all fwmark 0x0/0x10000 lookup legacy_network 
17000:	from all fwmark 0x0/0x10000 lookup local_network 
19000:	from all fwmark 0xb/0x1ffff lookup rmnet_data0 
19000:	from all fwmark 0x76/0x1ffff lookup wlan0 
21000:	from all fwmark 0x77/0x1ffff lookup wlan0 
22000:	from all fwmark 0x0/0xffff lookup wlan0 
23000:	from all fwmark 0x0/0xffff uidrange 0-0 lookup main 
32000:	from all unreachable

ip route show table main

                                                                                                                                 
172.16.8.0/24 dev tun0  proto kernel  scope link  src 172.16.8.9 
192.168.1.0/24 dev wlan0  proto kernel  scope link  src 192.168.1.155 

ip route show table tun0

                                                                                                                                    
default dev tun0  proto static  scope link 
8.8.0.0/16 dev tun0  proto static  scope link 
172.16.8.0/24 dev tun0  proto static  scope link 

ip route show table wlan0

                                                                                                                                  
default via 192.168.1.1 dev wlan0  proto static 
192.168.1.0/24 dev wlan0  proto static  scope link

ip route show table 0

default via 192.168.1.1 dev wlan0  table wlan0  proto static 
192.168.1.0/24 dev wlan0  table wlan0  proto static  scope link 

default dev tun0  table tun0  proto static  scope link 
8.8.0.0/16 dev tun0  table tun0  proto static  scope link 
172.16.8.0/24 dev tun0  table tun0  proto static  scope link 

default dev dummy0  table dummy0  proto static  scope link 
172.16.8.0/24 dev tun0  proto kernel  scope link  src 172.16.8.9 
192.168.1.0/24 dev wlan0  proto kernel  scope link  src 192.168.1.155 
broadcast 127.0.0.0 dev lo  table local  proto kernel  scope link  src 127.0.0.1 
local 127.0.0.0/8 dev lo  table local  proto kernel  scope host  src 127.0.0.1 
local 127.0.0.1 dev lo  table local  proto kernel  scope host  src 127.0.0.1 
broadcast 127.255.255.255 dev lo  table local  proto kernel  scope link  src 127.0.0.1 
broadcast 172.16.8.0 dev tun0  table local  proto kernel  scope link  src 172.16.8.9 
local 172.16.8.9 dev tun0  table local  proto kernel  scope host  src 172.16.8.9 
broadcast 172.16.8.255 dev tun0  table local  proto kernel  scope link  src 172.16.8.9 
broadcast 192.168.1.0 dev wlan0  table local  proto kernel  scope link  src 192.168.1.155 
local 192.168.1.155 dev wlan0  table local  proto kernel  scope host  src 192.168.1.155 
broadcast 192.168.1.255 dev wlan0  table local  proto kernel  scope link  src 192.168.1.155 
fd3b:fbcb:a1a::/64 dev wlan0  table wlan0  proto kernel  metric 256  pref medium
fd3b:fbcb:a1a::/64 dev wlan0  table wlan0  proto static  metric 1024  pref medium
fd3b:fbcb:a1a::/48 via fe80::7aa3:51ff:fe35:9796 dev wlan0  table wlan0  proto ra  metric 1024  pref medium
fe80::/64 dev wlan0  table wlan0  proto kernel  metric 256  pref medium
fe80::/64 dev wlan0  table wlan0  proto static  metric 1024  pref medium
unreachable default dev lo  table tun0  proto static  metric 1024  error -113 pref medium
fe80::/64 dev dummy0  table dummy0  proto kernel  metric 256  pref medium
default dev dummy0  table dummy0  proto static  metric 1024  pref medium
fe80::/64 dev rmnet_data0  table rmnet_data0  proto kernel  metric 256  mtu 2000 pref medium
default via fe80::5d6:b137:94a8:7216 dev rmnet_data0  table rmnet_data0  proto ra  metric 1024  expires 30405sec hoplimit 255 pref medium
local ::1 dev lo  table local  proto none  metric 0  pref medium
local fd3b:fbcb:a1a:0:5d79:cfb8:a788:dea4 dev lo  table local  proto none  metric 0  pref medium
local fd3b:fbcb:a1a:0:80d5:910b:2d8f:1d86 dev lo  table local  proto none  metric 0  pref medium
local fe80::96a:dd37:62a0:97 dev lo  table local  proto none  metric 0  pref medium
local fe80::1497:ebff:fed9:ea6d dev lo  table local  proto none  metric 0  pref medium
local fe80::35a4:2e6c:d297:6c0a dev lo  table local  proto none  metric 0  pref medium
ff00::/8 dev dummy0  table local  metric 256  pref medium
ff00::/8 dev rmnet_data0  table local  metric 256  mtu 2000 pref medium
ff00::/8 dev wlan0  table local  metric 256  pref medium