• Register
Welcome to Ubuntu-MM Q&A, Ubuntu Linux ႏွင့္ ပတ္သက္သမွ် သိခ်င္တာ ေမးပါ။ မေမးခင္ ေမးၿပီးသား ရွိမရွိ ရွာပါ။ အေမးရွိၿပီး အေျဖမရွိေသးပါက ေမးခြန္းကို Vote ေပးခဲ့ပါ။


1 like 0 dislike
in Beginner by (170 points)

1 Answer

0 like 0 dislike
  • connect the smartphone to the PC with the USB cable
  • on the smartphone, activate USB tethering, using the Settings application
  • on the PC, enter the dmesg command. A message similar to this one should be displayed:
rndis_host 2-1.2:1.0: >usb0: register 'rndis_host' at usb-0000:00:1d.0-1.2, RNDIS device, 96:53:6d:9b:5e:a5
  • still on the PC, enter the following command (adapt usb0 if required) 
udevadm info -a -p /sys/class/net/usb0
  • you will get udev information for usb0 device, and then for its parents. Look for the device with ATTRS{serial}information. 
  • create the file /etc/udev/rules.d/90-local.rules with the following content (on the same line, xxxx being the value displayed for ATTRS{serial}), setting ownership to root:root:
ACTION=="add", DRIVERS=="usb", ATTRS{serial}=="xxxx", RUN+="/etc/udev/scripts/android"
  • create the file /etc/udev/scripts/android with the following content (you can choose any MAC address, provided that it is a locally administered address, i.e. the second least significant bit of the most significant byte is set to 1):
ifconfig usb0 down
ifconfig usb0 hw ether 02:11:22:33:44:55
ifconfig usb0
ifconfig usb0 up
  • make this file executable, and set its ownership to root:root
  • reload udev rules:
sudo udevadm control --reload-rules
  • prevent Network Manager from managing usb0, adding into /etc/NetworkManager/NetworkManager.conf file the MAC address you specified in the script:
  • restart Network Manager:
sudo service network-manager restart

That's it! 

If the smartphone is replaced by another one, modify the serial attribute in the udev rule.


copy from : http://www.monblocnotes.com/node/1895

by (210 points)
ကိုပြောင်းပြီးလုပ် လို့ရလားမသိဘူး bro