当前位置: 首页 > >

Android手机在4G网络环境下IP的识别

发布时间:

4G网卡的识别:

各个厂商对4G网卡命名都不相同,但有共同的特点是包含字符串 rmnet
三星:rmnet_data4
华为:rmnet0
vivo:rmnet_data2
oppo:rmnet_data0


局域网IP的识别:

局域网,解决了ipv4地址不够用的问题。同时方便维护管理。
局域网地址范围分三类,以下IP段为内网IP段:
C类:192.168.0.0 - 192.168.255.255
B类:172.16.0.0 - 172.31.255.255
A类:10.0.0.0 - 10.255.255.255


Java中判断是否为局域网IP,只需调用 InetAddress.isSiteLocalAddress()
测试的Case:

三星:rmnet_data4


2020-08-10 14:51:28.689 9504-10476/x I/x.getCellularIpNew: 网卡不符:dummy0
2020-08-10 14:51:28.693 9504-10476/x I/x.getCellularIpNew: 网卡不符:epdg1
2020-08-10 14:51:28.693 9504-10476/x I/x.getCellularIpNew: 网卡不符:epdg0
2020-08-10 14:51:28.694 9504-10476/x I/x.getCellularIpNew: 网卡不符:ip_vti0
2020-08-10 14:51:28.695 9504-10476/x I/x.getCellularIpNew: 网卡不符:lo
2020-08-10 14:51:28.695 9504-10476/x I/x.getCellularIpNew: 网卡不符:epdg5
2020-08-10 14:51:28.695 9504-10476/x I/x.getCellularIpNew: 网卡不符:epdg4
2020-08-10 14:51:28.695 9504-10476/x I/x.getCellularIpNew: 网卡不符:epdg3
2020-08-10 14:51:28.696 9504-10476/x I/x.getCellularIpNew: 网卡不符:epdg2
2020-08-10 14:51:28.696 9504-10476/x I/x.getCellularIpNew: 网卡不符:epdg7
2020-08-10 14:51:28.696 9504-10476/x I/x.getCellularIpNew: 网卡不符:epdg6
2020-08-10 14:51:28.696 9504-10476/x I/x.getCellularIpNew: 网卡不符:wlan0
2020-08-10 14:51:28.696 9504-10476/x I/x.getCellularIpNew: 网卡不符:ip6tnl0
2020-08-10 14:51:28.696 9504-10476/x I/x.getCellularIpNew: 网卡不符:bond0
2020-08-10 14:51:28.696 9504-10476/x I/x.getCellularIpNew: 网卡不符:ip6_vti0
2020-08-10 14:51:28.697 9504-10476/x I/x.getCellularIpNew: 网卡不符:swlan0
2020-08-10 14:51:28.697 9504-10476/x I/x.getCellularIpNew: 网卡不符:sit0
2020-08-10 14:51:28.697 9504-10476/x I/x.getCellularIpNew: 网卡可疑:rmnet_data7
2020-08-10 14:51:28.698 9504-10476/x I/x.getCellularIpNew: 网卡可疑:rmnet_data0
2020-08-10 14:51:28.721 9504-10476/x I/x.getCellularIpNew: 网卡不符:p2p0
2020-08-10 14:51:28.722 9504-10476/x I/x.getCellularIpNew: 网卡可疑:rmnet_data2
2020-08-10 14:51:28.722 9504-10476/x I/x.getCellularIpNew: 网卡可疑:rmnet_data1
2020-08-10 14:51:28.722 9504-10476/x I/x.getCellularIpNew: 网卡可疑:rmnet_data4
2020-08-10 14:51:28.723 9504-10476/x I/x.getCellularIpNew: Inet6Address:fe80::6c7e:242d:7322:83e%rmnet_data4
2020-08-10 14:51:28.724 9504-10476/x I/x.getCellularIpNew: Inet6Address:2408:84e1:103:c377:5584:ffeb:8f72:17cd
2020-08-10 14:51:28.725 9504-10476/x I/x.getCellularIpNew: isSiteLocalAddress:10.223.30.167

华为:rmnet0


2020-08-10 14:53:43.624 19239-19853/x I/x.getCellularIpNew: 网卡不符:dummy0
2020-08-10 14:53:43.624 19239-19853/x I/x.getCellularIpNew: 网卡不符:ip_vti0
2020-08-10 14:53:43.624 19239-19853/x I/x.getCellularIpNew: 网卡不符:lo
2020-08-10 14:53:43.624 19239-19853/x I/x.getCellularIpNew: 网卡可疑:rmnet6
2020-08-10 14:53:43.624 19239-19853/x I/x.getCellularIpNew: 网卡可疑:rmnet_tun10
2020-08-10 14:53:43.624 19239-19853/x I/x.getCellularIpNew: 网卡可疑:rmnet2
2020-08-10 14:53:43.624 19239-19853/x I/x.getCellularIpNew: 网卡可疑:rmnet3
2020-08-10 14:53:43.624 19239-19853/x I/x.getCellularIpNew: 网卡可疑:rmnet_r_ims10
2020-08-10 14:53:43.624 19239-19853/x I/x.getCellularIpNew: 网卡可疑:rmnet4
2020-08-10 14:53:43.624 19239-19853/x I/x.getCellularIpNew: 网卡可疑:rmnet_r_ims11
2020-08-10 14:53:43.625 19239-19853/x I/x.getCellularIpNew: 网卡可疑:rmnet5
2020-08-10 14:53:43.625 19239-19853/x I/x.getCellularIpNew: 网卡可疑:rmnet_tun14
2020-08-10 14:53:43.625 19239-19853/x I/x.getCellularIpNew: 网卡不符:wlan0
2020-08-10 14:53:43.625 19239-19853/x I/x.getCellularIpNew: 网卡可疑:rmnet_tun13
2020-08-10 14:53:43.625 19239-19853/x I/x.getCellularIpNew: 网卡不符:ip6tnl0
2020-08-10 14:53:43.625 19239-19853/x I/x.getCellularIpNew: 网卡可疑:rmnet0
2020-08-10 14:53:43.625 19239-19853/x I/x.getCellularIpNew: Inet6Address:fe80::211:9ff:fe64:401%rmnet0
2020-08-10 14:53:43.625 19239-19853/x I/x.getCellularIpNew: Inet6Address:2408:84e1:61:ea08:6596:1575:84db:4edd
2020-08-10 14:53:43.625 19239-19853/x I/x.getCellularIpNew: isSiteLocalAddress:10.26.147.137

vivo:rmnet_data2


2020-08-10 15:15:00.025 13407-17879/x I/x.getCellularIpNew: 网卡不符:dummy0
2020-08-10 15:15:00.025 13407-17879/x I/x.getCellularIpNew: 网卡可疑:r_rmnet_data2
2020-08-10 15:15:00.025 13407-17879/x I/x.getCellularIpNew: 网卡可疑:r_rmnet_data3
2020-08-10 15:15:00.025 13407-17879/x I/x.getCellularIpNew: 网卡可疑:r_rmnet_data0
2020-08-10 15:15:00.025 13407-17879/x I/x.getCellularIpNew: 网卡不符:ip_vti0
2020-08-10 15:15:00.025 13407-17879/x I/x.getCellularIpNew: 网卡不符:lo
2020-08-10 15:15:00.025 13407-17879/x I/x.getCellularIpNew: 网卡可疑:r_rmnet_data1
2020-08-10 15:15:00.025 13407-17879/x I/x.getCellularIpNew: 网卡不符:wlan1
2020-08-10 15:15:00.025 13407-17879/x I/x.getCellularIpNew: 网卡不符:wlan0
2020-08-10 15:15:00.025 13407-17879/x I/x.getCellularIpNew: 网卡不符:ip6tnl0
2020-08-10 15:15:00.025 13407-17879/x I/x.getCellularIpNew: 网卡可疑:rmnet_data10
2020-08-10 15:15:00.025 13407-17879/x I/x.getCellularIpNew: 网卡不符:bond0
2020-08-10 15:15:00.025 13407-17879/x I/x.getCellularIpNew: 网卡不符:ip6_vti0
2020-08-10 15:15:00.026 13407-17879/x I/x.getCellularIpNew: 网卡不符:sit0
2020-08-10 15:15:00.026 13407-17879/x I/x.getCellularIpNew: 网卡可疑:rmnet_data8
2020-08-10 15:15:00.026 13407-17879/x I/x.getCellularIpNew: 网卡可疑:rmnet_data7
2020-08-10 15:15:00.026 13407-17879/x I/x.getCellularIpNew: 网卡可疑:rmnet_data9
2020-08-10 15:15:00.026 13407-17879/x I/x.getCellularIpNew: 网卡可疑:rmnet_data0
2020-08-10 15:15:00.026 13407-17879/x I/x.getCellularIpNew: Inet6Address:fe80::bc6e:c73c:7921:95a4%rmnet_data0
2020-08-10 15:15:00.026 13407-17879/x I/x.getCellularIpNew: 网卡不符:p2p0
2020-08-10 15:15:00.026 13407-17879/x I/x.getCellularIpNew: 网卡可疑:rmnet_data2
2020-08-10 15:15:00.027 13407-17879/x I/x.getCellularIpNew: Inet6Address:fe80::cf9b:d568:2db3:f188%rmnet_data2
2020-08-10 15:15:00.027 13407-17879/x I/x.getCellularIpNew: Inet6Address:2408:84e1:e0:3d79:cf9b:d568:2db3:f188
2020-08-10 15:15:00.027 13407-17879/x I/x.getCellularIpNew: isSiteLocalAddress:10.110.112.100

oppo:rmnet_data0


08-10 15:33:26.321 6270-6962/x I/x.getCellularIpNew: 网卡不符:dummy0
08-10 15:33:26.321 6270-6962/x I/x.getCellularIpNew: 网卡不符:sit0
08-10 15:33:26.321 6270-6962/x I/x.getCellularIpNew: 网卡不符:p2p0
08-10 15:33:26.321 6270-6962/x I/x.getCellularIpNew: 网卡不符:lo
08-10 15:33:26.321 6270-6962/x I/x.getCellularIpNew: 网卡不符:wlan0
08-10 15:33:26.321 6270-6962/x I/x.getCellularIpNew: 网卡可疑:rmnet_data7
08-10 15:33:26.321 6270-6962/x I/x.getCellularIpNew: 网卡可疑:rmnet_data6
08-10 15:33:26.321 6270-6962/x I/x.getCellularIpNew: 网卡可疑:rmnet_data5
08-10 15:33:26.321 6270-6962/x I/x.getCellularIpNew: 网卡可疑:rmnet_data1
08-10 15:33:26.331 6270-6962/x I/x.getCellularIpNew: 网卡可疑:rmnet_data0
08-10 15:33:26.331 6270-6962/x I/x.getCellularIpNew: Inet6Address:2409:8900:2510:776f:b2b4:3d0f:2091:2ab5%12
08-10 15:33:26.331 6270-6962/x I/x.getCellularIpNew: Inet6Address:fe80::b2b4:3d0f:2091:2ab5%rmnet_data0
08-10 15:33:26.331 6270-6962/x I/x.getCellularIpNew: isSiteLocalAddress:10.154.147.120



友情链接: hackchn文档网 营销文档网 爱linux网 爱行业网 时尚网