0

I am trying to setup reverse tethering between Sony Xperia 4.0.4(rooted) and Linux 12.04. I'm following steps from Matthew Read's answer on this post, How to set up reverse tethering over USB?

All steps work but when I execute "su netcfg usb0 dhcp" in root shell of phone then I get message "Unknown id: netcfg".

130|root@android:/ # su netcfg usb0 dhcp
Unknown id: netcfg

I'm not sure what this message means and how to fix it. I could not find anything related in Google search. Can anyone please guide me about it.

  • 2
    Matthew's answer is from 2011, so it's definitely pre-ICS. My guess is that the netcfg command was renamed/removed meanwhile. Try replacing it by ifconfig (i.e. su ifconfig usb0 dhcp and see if that works (pointer taken from here). In the worst case, that might throw another error message. You could also check whether there's a similarly named executable (e.g. by typing net followed by a "<tab>", if your terminal/keyboard supports that – or by walking through the /system/bin, /system/xbin etc. directories). – Izzy May 19 '15 at 13:41
  • I tried ifconfig but same result. – blackfyre May 26 '15 at 10:40
  • 1
    Urgs. My bad. You've got an error in your command, try su -c "netcfg usb0 dhcp" (first non-option parameter to su is the user to switch to; with -c you rather advice it to execute the command). – Izzy May 26 '15 at 10:46
  • @Izzy, thanks! It fixed the error. You can add it as answer. – blackfyre May 28 '15 at 6:41
  • 1
    Thanks for your feedback! Answer posted. I will now also update Matthew's answer accordingly. – Izzy May 28 '15 at 8:25
1

There's a slight syntax error in your statement: the first non-option parameter to su (which stands for "Switch User") is the user to switch to (if omitted, root is assumed). So your su netcfg usb0 dhcp basically advises su to "switch to the user netcfg – but there is no such user.

To fix it up, just use su -c "netcfg usb0 dhcp" – which would, due to the non-existent "first non-option argument", would advise su to switch to root and then, by the -c parameter, execute the Command netcfg usb0 dhcp. Further note the command is quoted: this is required as it contains (white) spaces.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.