USB reverse tethering - netcfg not found (marshmallow CM13)


Question

I have been attempting to get reverse tethering working on my phone. I have a Galaxy S5 (g900t), running cyanogenmod 13 (marshmallow)...rooted, and with busybox.



*Edit: I've made some progress. I ran this on my ubuntu machine:



sudo ip addr flush dev eth0
sudo ip addr flush dev usb0
sudo brctl addbr br0
sudo brctl addif br0 eth0 usb0
sudo ip link set dev br0 up
sudo dhclient br0


And then I ran this in the adb shell:



dhcptool rndis0


After doing this, I seem to have internet.



I can do wget -s google.com. However, it only works as su.



root@klte:/ # wget -s google.com
Connecting to google.com (4.59.40.99:80)
Connecting to www.google.com (4.59.40.99:80)

2000@klte:/ $ wget -s google.com
wget: bad address 'google.com'


I verified that I can do wget as a regular user when I am connected through cell network or wifi.



So my question is:



Why would I be able to apparently access the internet as su, but not as a regular user? I've checked my ifconfig and route settings, and they all look the same either as su or regular user. Does anyone see what I'm doing wrong?






Config setting printouts



These settings are all the same, whether I run them as su or not.
Here is my ifconfig:



1|root@klte:/ # ifconfig rndis0
rndis0 Link encap:Ethernet HWaddr 62:91:0C:85:FD:6B
inet addr:192.168.22.6 Bcast:192.168.22.255 Mask:255.255.255.0
inet6 addr: fe80::6091:cff:fe85:fd6b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:582 errors:0 dropped:0 overruns:0 frame:0
TX packets:126 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:62495 (61.0 KiB) TX bytes:15839 (15.4 KiB)


And here is my route table:



root@klte:/ # route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.22.1 0.0.0.0 UG 0 0 0 rndis0
192.168.22.0 * 255.255.255.0 U 0 0 0 rndis0


And it appears that my DNS servers are set correctly:



root@klte:/ # cat /etc/resolv.conf  
nameserver 8.8.4.4
nameserver 8.8.8.8

Answer

I just recently stumbled across what seems to me to be a much better (or at least easier) solution for reverse tethering: gnirehtet



It sets up a VPN on the android which redirects all traffic across an adb reverse port connection. Doesn't even require root at all.


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes