[Q] Use PC's Internet via USB at Defy (opposite of thethering) - Defy General

At home or in office, Defy is connected via USB to PC (to load). Is it possible to use the PC internet connection also for the Defy - maybe with the Motorola Software? In this case Defy gets an IP, so there must be some connection.
I miss this feature from WinMob (via ActiveSync) which can exactly do this.

The developer of "Moto Tethering USB" plans to add this feature. I don't know any other solutions, so you'll need to wait for that. Unless someone else knows something. I'd be especially happy for a solution that work on Linux (Moto Tethering USB doesn't).

Good to know. I have encouraged him in his thread.

Nice Question.....I'll wait for the Answer...

The procedure for Reverse USB Tethering with Android 2.2 given on this page might help... blog.mycila.com/2010/06/reverse-usb-tethering-with-android-22.html

it's pleasure to hear the new plan
there's already a app that can auto set the htc phone sharing the PC' net connection via usb
and defy is also badly in need of one

Is is easy on LINUX. You must use adb from android sdk tools.
Script for creating connection via USB and settings your PC to forward to LAN (Internet). Tested on FC12.
#! /bin/sh
ADB=/usr/local/bin/adb
DEVLAN=`route -n | grep "^0.0.0.0" | awk "{ print \\$8;}"`
IPLAN=`ip addr show dev ${DEVLAN} | grep "inet " | awk "{print \\$2}" | cut -f1 -d/`
echo "Setting up..."
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -F
iptables -t nat -A POSTROUTING -o ${DEVLAN} -j SNAT --to ${IPLAN}
echo "Starting PPP daemon..."
$ADB ppp "shellppd nodetach noauth defaultroute usepeerdns /dev/tty" nodetach noauth noipdefault notty 192.168.6.1:192.168.6.2
while [ "`/sbin/ifconfig | grep 192.168.6.1`" == "" ]; do
sleep 1
done
$ADB shell "setprop net.dns1 8.8.8.8"
$ADB shell "setprop net.dns2 8.8.4.4"
echo "Connected."
Click to expand...
Click to collapse
There is one problem. Downloader didn't works. It can't detect, that Android is online. It thinks that connection is closed. But browsing on market, browser, opera, all applications, that did'nt detect type of connection, work normal.
Have anybody solution?

Are there any news to reverse tethering? Best under Windows?

this will be simply awesome.........
as i dont have wifi at my home i am looking for this....

did anybody find something on this...

U can try this one..
If u hav wifi facility in ur laptop or desktop, u can use connectify software to share ur internet connection.

shall be waiting on this .... specially for windows

For windows you will find this thread helpfull
http://forum.xda-developers.com/showthread.php?t=1371345

informative

can't we.
isn't there a way to treat defy as a pc give it static ip on the network or using ics and add a route to using the pc internet? when i connect my defy it get an ip on my home router.
is there any ideas.

Related

How to get internet on your phone via USB

You may also call this reversed USB tether.
This might come in handy if you're near a computer (Win XP/Win7) and there's no Wifi to connect to etc..
So after some research and trying I've found some information on how to do this.
Requirements:
* Android 2.2 (or an older version with a root tethering app)
* ADB from Android SDK, or a rooted Android 2.2 with terminal in root mode
STEP 1:
Install USB drivers from Android SDK.
STEP 2:
Connect USB cable and activate USB Tethering.
You should see a new network interface. (On XP you might need to install the RNDIS driver manually, see below)
If you're also missing RNDIS driver on Win7, look here.
Win XP manual driver install Android USB Ethernet/RNDIS: (You can skip this if you're on Win 7)
1. Download the following configuration file inside the *.zip attached to this post (tetherxp.inf) to your Windows XP computer.
2. Use the USB cable that came with your phone to connect your phone to your computer.
3. On the Android phone, press Home > Menu > Settings to open the Settings application.
4. Press Wireless & networks > Tethering & portable hotspot.
5. Check USB tethering.
6. When Windows XP’s New Hardware Wizard opens, select No, not at this time and click Next.
7. Select Install from a list or specific location and click Next.
8. Click Browse to browse to the directory where you installed the configuration file you downloaded in Step 1 and click Next. Windows XP uses the configuration file to configure itself to support USB tethering with the Android phone. (This might take a while)
9. When Windows XP finishes installing the software for Android USB Ethernet/RNDIS, click Finish.
STEP 3:
Bridge the 2 network interfaces.
STEP 4:
Setup usb0 interface of your phone. You have to options:
1. From your computer, execute:
./adb shell netcfg usb0 dhcp
2. Or in a root terminal on your phone, type:
su
netcfg usb0 dhcp
You should now be able to connect to Internet on your phone using your computer's Internet connection.
Try to do a ping www.google.com to be sure.
STEP 5:
To shut down the reverse-tethering, first unbridge interfaces on your computer:
sudo ifconfig eth0 down
sudo ifconfig usb0 down
sudo ifconfig br0 down
sudo brctl delbr br0
sudo ifconfig eth0 up
sudo dhclient eth0
Then on your phone, uncheck the USB Tethering option.
Quote...
It is working now. After setting up ICS type in console emulator on your phone:
ifconfig usb1 192.168.2.2 netmask 255.255.255.0 up
route add default gw 192.168.2.1 dev usb0
iptables -F
iptables -F -t nat
setprop net.dns1 8.8.8.8
setprop "net.gprs.http-proxy" ""
Click to expand...
Click to collapse
Hope this helps some one who wants this to the right direction.
And maybe we're able to create an app to do this all automated.
Known issues but does not apply to all users:
1. Internet in browser application does not work.
2. Can't ping domain name.
For a little more info check out the sources, this includes the Linux version too.
Sources: Google android, Mycila
Nice info
Going to post a link on the hero forum where someone was wanting to do this. I wonder if this will work on a froyo hero too...
it would be cool if one of the devs could write a small app to switch this on n off great find tho shoemeistah
Thank you for the guide, It worked fine. There are several things not working though:
- can't download apps from market, they stuck on "downloading"
- my google account don't sync
- other apps don't update themselves. For example my twitter app won't show any new tweets until I open it and manually press "refresh"
I searched for this long time ago, even created a thread about it awhile back, didnt have luck like you did though
I gave up on it eventually, it would be nice to make an app out of it.
mind asking how did you confirm the net to be working on browser? by pinging google.com?
since i saw the last line you put "Internet in browser application does not work."
You can do that in the terminal
[U][B] Internet connection on your Android phone via your PC [/B][/U]
I think I found the best solution. Check it out connectify.me
I wanted to use my PC wired internet & I was astonished that this wasn't available in my HTC Desire & 1st Android device!. I looked over the net, I found many options but most asked for a rooted device! I didn't want to root my brand new Desire.
Connectify is an easy to use software router for Windows 7 computers. After downloading and installing the lightweight application, Connectify utilizes your computers' built in Wi-Fi card to wirelessly share any available Internet connection: a cable modem, a cellular card, or even another Wi-Fi network. Other Wi-Fi enabled devices including laptops, smart phones, music players, and gaming systems can see and join your Connectify hotspot just like any other Wi-Fi access point and are kept safe and secure by password-protected WPA2 Encryption.
I tried it & it's working perfectly for me .. It's a free app.
-----------
Phone: HTC Desire (SIM Free)
Type: Desire
Build: HTC Desire 2.2, 2.10 (kernel: htc 2.6.32.15)
Baseband: 5.09.05.30
Network: UMTS auto (EGY)
By me it didn't work. Using OpenDesire with Froyo 2.2
So I made it work, by edititng the .inf file.
Here the file for USB\VID_0BB4&PID_0C02.
For all which still have a problem(USB TETHERING ON DEVICE MUST BE ACTIVE, ALSO THE IDs DIFFERS BETWEEN CONNECTED WITH ADB OR NOT), go into the device manager -> open the device -> goto tab details -> choose device id
look at it, you see somewhere vid_XXXX and further pid_XXXX
open my file -> goto line 31 -> change vid_YYYY and pid_YYYY with what you see in your device dialog. the same you do on line 35. be careful with 0 or o.
Regards
Ralph
I am also using connectify, easy to install, set it up, connect with Desire, anything works fine.
Thanks GhostOfTheNet.
chrismast said:
I am also using connectify, easy to install, set it up, connect with Desire, anything works fine.
Click to expand...
Click to collapse
I appreciate the recommendations for other solutions.
But as you can see this thread is for a internet solution at places where is no Wifi available.
So please keep it on topic, thanks!
browser & webviews
Any idea why browser won't work?
I'm interested in testing against internal sites (of course no WAP here.. cuz they be scared i guess).. both Browser and embedded webviews.
connectify great program.works fine
its a default feature in hd roms but that doesnt work in all programs
Connectify doesn't work correctly with my Galaxy 5. It keeps connected for a short time then disconnects and then, connects again, connect, disconnect...
Does anyone know how to fix it?
Thanks Man
plz make a video tutroial of this
its difficult to under stand
does it actualy work?? anyone tried this and actualy worked??? just a simple yes or no.
thanks
small proble plz solve it
hi
I have a small problem in it when my device is not in usb tethering mode
i can see it in my adb devices
as soon as is start usbtethering it say no device found
plz help me
thanks a lot !!!
realy nice guide! Thanks!

[Q] Prevent relock with IPTABLES on FritzBox?

Hi!
This is my first post, so I would like to say thanks for all the helpful information on this forum first...
I'm wondering if it would be possible to stop relock of WP7 by rejecting the access to developerservices.windowsphone.com and developerservices.windowsphone-int.com with IPTABLES on a modified FritzBox.
From my understanding the relock happens by either the phone or zune checking one of the domains to see if the phone is a registered developer unit.
I'm using WLAN and LAN connection at home via my FritzBox-router, on which I could install IPTABLES in a modified firmware an add rules like
iptables -A FORWARD -d developerservices.windowsphone.com -j REJECT
iptables -A FORWARD -d developerservices.windowsphone-int.com -j REJECT
I'm not sure if the phone would relock itself using a 3G connection or if the blocking of the domains would cause any side-effects.
What do you think of this "solution"?
Try reading up on this at this thread:
http://forum.xda-developers.com/showthread.php?t=922454
Thanks for the answer.
I read this post already, but it states you would have to disable WLAN prior to sync. Furthermore I had my WP7 relocked once without syncing it with zune, so I thougt IPTABLES would perhaps be a more secure and a more comfortable way regarding it wouldn't be neccessary to disable WLAN.
Well you could edit registry or use one of the xaps that does it for you, depending on witch device you use.

[Q] Reverse tether ("internet passthrough") on DHD using JellyTime ROM?

Hi.
I didn't want to start this in the JellyTime dev thread and take it off-topic, and figured a separate thread would be more useful to anyone searching for this.
Aim: Access the internet on my DHD using my Linux PC's internet connection.
Set-up: Ubuntu 12.04, Desire HD (European), JellyTime R21.
Process/progress so far:
I found a script here... I modified it a little, so it looks like this:
Code:
#!/bin/bash
adb shell 'echo 6 > /sys/devices/platform/msm_hsusb/usb_function_switch'
sleep 1
adb shell ifconfig usb0 192.168.99.5 netmask 255.255.255.0 up
sleep 1
adb shell setprop net.dns1 8.8.8.8
get_ip ()
{
ifconfig usb0 | grep inet | awk '{print $2}' | sed 's/addr://' | grep .
}
echo "waiting for IP on computer usb0"
while [[ `get_ip` < 192 ]];do sleep 2; done
ip=`get_ip`
echo "IP adress is $ip "
adb shell route add default gw $ip dev usb0
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
If I set my device to "USB tether" mode, running (as su) "ifconfig usb0 up" works fine, but running the above script generates:
Code:
/system/bin/sh: can't create /sys/devices/platform/msm_hsusb/usb_function_switch: No such file or directory
waiting for IP on computer usb0
connect.sh: 14: connect.sh: cannot open 192: No such file
connect.sh: 14: connect.sh: [[: not found
IP adress is 192.168.42.245
No such process
Is the problem that usb_function_switch is not present in Cyanogenmod? If so, I guess randomblame (the JellyTIme dev) would have to add this to his DHD port of CM10. I think it has been added for the HTC Hero.
Incidentally, I also tried using this app. I followed the instructions, and can ping my DHD from the PC, but pressing the start button throws the message "No tetherable USB interface!".
Any tips and advice (even if it's just telling me it's not possible, and that I should give up now) would be appreciated.
Thanks.
EDIT (P.S.): If we can come to the conclusion that this is something to do with the ROM (e.g. usb_function_switch) then I will create an issue for this in the ROM issue tracker... but I didn't want to do that immediately in case it is just me missing something obvious.
Well, even if you create the usb_function_switch file, the ROM still doesn't support Internet pass-through, so putting "6" in it won't do anything. You can put it on the issue tracker, but I have not yet seen a non-Sense ROM have that feature.
bananagranola said:
Well, even if you create the usb_function_switch file, the ROM still doesn't support Internet pass-through, so putting "6" in it won't do anything. You can put it on the issue tracker, but I have not yet seen a non-Sense ROM have that feature.
Click to expand...
Click to collapse
Really? It supports USB tethering... I was pretty sure that was all that was needed... See this.
lawrencew said:
Really? It supports USB tethering... I was pretty sure that was all that was needed... See this.
Click to expand...
Click to collapse
First of all, I'm not sure if that site you're quoting is for the Desire or the Desire HD. Second, USB tethering allows the computer to use the phone's internet (which is supported); internet pass-through is the other way around. Third, I could be wrong about JellyTime supporting internet pass-through; where did you see that?
bananagranola said:
First of all, I'm not sure if that site you're quoting is for the Desire or the Desire HD. Second, USB tethering allows the computer to use the phone's internet (which is supported); internet pass-through is the other way around. Third, I could be wrong about JellyTime supporting internet pass-through; where did you see that?
Click to expand...
Click to collapse
I was under the impression that passthrough uses the same connection as tether, but with slightly different config.
Could definitely use that...the reverse tether would be great in remote area's with spotty connections as well as in buildings like hospitals.
lawrencew said:
I was under the impression that passthrough uses the same connection as tether, but with slightly different config.
Click to expand...
Click to collapse
If that's true, that's really interesting.
Well, we have to find out how it works because i want to use JB but i can't because it doesn't has Reverse Tether. Sense Roms are my only Option and i hate that. If someone gets the solution it would be nice if you make a tutorial for that.
Found a solution. Search the forum for Reverse Tethering 2.30 .

[GUIDE] Making infrastructure wifi hotspot on ubuntu 12.04/12.10

As many of you know, most of our android(not only android) devices can't connect to ad hoc hotspots. There's a solution for win7/8 users to set up infrastructure hotspot on their laptop using software like connectify and so on. Ubuntu also allows to create wifi hotspot to share internet, but it will be ad hoc one.
So here's the guide how to set up infrastructure hotspot on ubuntu 12.04/12.10. Unlike some other methods described on the internet, this one will not break default network manager.
1. First of all you should make sure, that your wifi adapter supports infrastructure hotspots. If you used connectify on your windows system and it worked, skip this step.
open terminal and type: sudo lshw | less
find -network section and make sure that driver is ath5k or ath9k, this solution will only work for those drivers, but should fit the needs for the most laptop users.
2. We now need to install 2 additional tools to make out hotspot, 1st one is hostapd(hotspot server), 2nd one is dnsmasq(dns dhcp server)
in terminal type: sudo apt-get install hostapd dnsmasq
3. stop those services if started already, and prevent them from starting on system start up.
in terminal type:
sudo service hostapd stop
sudo service dnsmasq stop
sudo update-rc.d hostapd disable
sudo update-rc.d dnsmasq disable
4. Now we need to set up config files.
in terminal type: sudo gedit /etc/dnsmasq.conf
or sudo kate /etc/dnsmasq.conf if you use kde
add those lines to the config file
Code:
# Bind to only one interface
bind-interfaces
# Choose interface for binding
interface=wlan0
# Specify range of IP addresses for DHCP leasses
dhcp-range=192.168.150.2,192.168.150.10
5. hostapd config
in terminal type: sudo gedit /etc/hostapd.conf
and add those lines
Code:
# Define interface
interface=wlan0
# Select driver
driver=nl80211
# Set access point name
ssid=myhotspot
# Set access point harware mode to 802.11g
hw_mode=g
# Set WIFI channel (can be easily changed)
channel=6
# Enable WPA2 only (1 for WPA, 2 for WPA2, 3 for WPA + WPA2)
wpa=2
wpa_passphrase=mypassword
You can change ssid name and password for anything you want here. Current config will create hotspot named myhotspot with mypassword password.
6. Now create anywhere you want a file named start.sh
edit it with any text editor like this:
Code:
#!/bin/bash
# Start
# Configure IP address for WLAN
sudo ifconfig wlan0 192.168.150.1
# Start DHCP/DNS server
sudo service dnsmasq restart
# Enable routing
sudo sysctl net.ipv4.ip_forward=1
# Enable NAT
sudo iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
# Run access point daemon
sudo hostapd /etc/hostapd.conf
# Stop
# Disable NAT
sudo iptables -D POSTROUTING -t nat -o ppp0 -j MASQUERADE
# Disable routing
sudo sysctl net.ipv4.ip_forward=0
# Disable DHCP/DNS server
sudo service dnsmasq stop
sudo service hostapd stop
You will probably need to change ppp0 in this to eth0 (or any other number which refers to your wired connection.
7. Last step. Now you can start your hotspot by starting our script. just run it using sudo sh
for me it looks like this sudo sh /home/ogyct/Desktop/start.sh because I have it on my desktop
I am not sure who is the author of this guide, I only translated it to english. But anyway if this helped, hit the thanks button. Good day
Android device having issues connecting to AP
I have an eth0 connection running behind an authenticated proxy server.
I followed the steps and managed to create a hotspot which my google nexus 7 detects. However, it seems stuck at "obtaining an ip address" and is not able to connect to the internet.
I initially received the following error message when running your script in the terminal:
dnsmasq: failed to create listening socket for 127.0.0.1: Address already in use [fail]​
I figured it is because of a conflict with the network manager, I commented out the "dns=dnsmasq" line in the nm configuration file. After a network-manager restart, the first error doesn't show up but I get the following:
Configuration file: /etc/hostapd.conf
Failed to create interface mon.wlan0: -23 (Too many open files in system)
Try to remove and re-create mon.wlan0​
In both cases, however, the hotspot is created and is detected by my android device. only that it cannot "obtain an ip address" and connect to it.
Is it because my eth0 connects via a proxy server?
Or could there be something wrong with the dnsmasq config? Any help would be appreciated.
anandkarthikeyan said:
I have an eth0 connection running behind an authenticated proxy server.
I followed the steps and managed to create a hotspot which my google nexus 7 detects. However, it seems stuck at "obtaining an ip address" and is not able to connect to the internet.
I initially received the following error message when running your script in the terminal:
dnsmasq: failed to create listening socket for 127.0.0.1: Address already in use [fail]​
I figured it is because of a conflict with the network manager, I uncommented "dns=dnsmasq" line in the nm configuration file. After a network-manager restart, the first error doesn't show up but I get the following:
Configuration file: /etc/hostapd.conf
Failed to create interface mon.wlan0: -23 (Too many open files in system)
Try to remove and re-create mon.wlan0​
In both cases, however, the hotspot is created and is detected by my android device. only that it cannot "obtain an ip address" and connect to it.
Is it because my eth0 connects via a proxy server?
Or could there be something wrong with the dnsmasq config? Any help would be appreciated.
Click to expand...
Click to collapse
I've never worked with a proxy server, but from what I see, it seems like your problem has nothing to do with a proxy server. Something's wrong with configuration on wifi side. Try to disable network manager first, if it doesn't help, try to completely clean dnsmaq and hostapd configs and paste code from this thread again. Unfortunately I can not provide any further help, since I have a different configuration on my side.
My galaxy s2 is able to see the "myhotspot" network created following this guide. I set a static ip and gateway to make it obtain an ip address.
Now it seems to be connected, but I have no internet access on my phone...
Could anyone help me?
gio182 said:
My galaxy s2 is able to see the "myhotspot" network created following this guide. I set a static ip and gateway to make it obtain an ip address.
Now it seems to be connected, but I have no internet access on my phone...
Could anyone help me?
Click to expand...
Click to collapse
I am using ubuntu 12.04 and I just figured out the instructions on ".../questions/180733/how-to-setup-a-wi-fi-hotspot-access-point-mode/" (askubuntu) thread worked like a charm for me. It uses the isc-dhcp-server instead of dnsmasq and a different dhcp range I guess. I really don't know enough to tell the difference but it worked. Maybe ogyct can explain it to us.
gio182 said:
My galaxy s2 is able to see the "myhotspot" network created following this guide. I set a static ip and gateway to make it obtain an ip address.
Now it seems to be connected, but I have no internet access on my phone...
Could anyone help me?
Click to expand...
Click to collapse
If everything's made right, there'll be no need for setting static ip adress, dhcp will do it for you.
Try to check if your devices are called wlan0 and eth0, if not, change configs accordingly. Simply type in console iwconfig to see the names. Remember, you may have a different configuration of your system, so be aware of that
HI ogyct,
This is the error i received.
Code:
wlan0: ERROR while getting interface flags: No such device
* Restarting DNS forwarder and DHCP server dnsmasq
dnsmasq: unknown interface wlan0
[fail]
net.ipv4.ip_forward = 1
Configuration file: /etc/hostapd.conf
Could not read interface wlan0 flags: No such device
Could not read interface wlan0 flags: No such device
nl80211 driver initialization failed.
net.ipv4.ip_forward = 0
* Stopping DNS forwarder and DHCP server dnsmasq * (not running)
And my wifi config reads this
Code:
*-network
description: Wireless interface
product: BCM4313 802.11b/g/n Wireless LAN Controller
vendor: Broadcom Corporation
physical id: 0
bus info: [email protected]:03:00.0
logical name: eth1
version: 01
serial: cc:af:78:78:44:03
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=wl0 driverversion=5.100.82.112 latency=0 multicast=yes wireless=IEEE 802.11
resources: irq:17 memory:f1500000-f1503fff
I guess I need to update the interfaces file in /etc/network....??
Any suggestions?
BCM4313 doesn't support AP
You wireless card doesn't support the AP operation mode. You can look up on the hostapd support website and there is a list of suppored devices. The BCM 4313 is part of brcmsmac which is in the NO section for AP. You would need to get a new card or purchase an external wifi card. Hope this helps.
bad_asteroid said:
HI ogyct,
This is the error i received.
Code:
wlan0: ERROR while getting interface flags: No such device
* Restarting DNS forwarder and DHCP server dnsmasq
dnsmasq: unknown interface wlan0
[fail]
net.ipv4.ip_forward = 1
Configuration file: /etc/hostapd.conf
Could not read interface wlan0 flags: No such device
Could not read interface wlan0 flags: No such device
nl80211 driver initialization failed.
net.ipv4.ip_forward = 0
* Stopping DNS forwarder and DHCP server dnsmasq * (not running)
And my wifi config reads this
Code:
*-network
description: Wireless interface
product: BCM4313 802.11b/g/n Wireless LAN Controller
vendor: Broadcom Corporation
physical id: 0
bus info: [email protected]:03:00.0
logical name: eth1
version: 01
serial: cc:af:78:78:44:03
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=wl0 driverversion=5.100.82.112 latency=0 multicast=yes wireless=IEEE 802.11
resources: irq:17 memory:f1500000-f1503fff
I guess I need to update the interfaces file in /etc/network....??
Any suggestions?
Click to expand...
Click to collapse
a little help
I made the hotspot successfully but its not sharing the internet connection
im using linuxmint 14 and HUAWEI EC1261-2 (EVDO)
unkown interface error
it says unknown interface wlan1 [fail]
.....phone detects the network but gets stuck during authentication, and then disabled, and keeps on trying...
stuck at # what to do please help
getting an error
here's the error i'm getting
Code:
SIOCSIFFLAGS: Operation not possible due to RF-kill
* Restarting DNS forwarder and DHCP server dnsmasq
dnsmasq: failed to create listening socket for 127.0.0.1: Address already in use
[fail]
net.ipv4.ip_forward = 1
Configuration file: /etc/hostapd.conf
Could not set interface wlan0 flags: Operation not possible due to RF-kill
nl80211: Failed to set interface wlan0 into AP mode
nl80211 driver initialization failed.
ELOOP: remaining socket: sock=4 eloop_data=0x8e20908 user_data=0x8e20e88 handler=0x807c5e0
ELOOP: remaining socket: sock=6 eloop_data=0x8e22ca0 user_data=(nil) handler=0x8086770
net.ipv4.ip_forward = 0
* Stopping DNS forwarder and DHCP server dnsmasq * (not running)
It doesn't work!
It's a pity!
Thanks
THANKS BRO IT REALLY WORKED LIKE A CHRAM!!!!! :highfive:
Thanks!
ogyct said:
As many of you know, most of our android(not only android) devices can't connect to ad hoc hotspots. There's a solution for win7/8 users to set up infrastructure hotspot on their laptop using software like connectify and so on. Ubuntu also allows to create wifi hotspot to share internet, but it will be ad hoc one.
So here's the guide how to set up infrastructure hotspot on ubuntu 12.04/12.10. Unlike some other methods described on the internet, this one will not break default network manager.
1. First of all you should make sure, that your wifi adapter supports infrastructure hotspots. If you used connectify on your windows system and it worked, skip this step.
open terminal and type: sudo lshw | less
find -network section and make sure that driver is ath5k or ath9k, this solution will only work for those drivers, but should fit the needs for the most laptop users.
2. We now need to install 2 additional tools to make out hotspot, 1st one is hostapd(hotspot server), 2nd one is dnsmasq(dns dhcp server)
in terminal type: sudo apt-get install hostapd dnsmasq
3. stop those services if started already, and prevent them from starting on system start up.
in terminal type:
sudo service hostapd stop
sudo service dnsmasq stop
sudo update-rc.d hostapd disable
sudo update-rc.d dnsmasq disable
4. Now we need to set up config files.
in terminal type: sudo gedit /etc/dnsmasq.conf
or sudo kate /etc/dnsmasq.conf if you use kde
add those lines to the config file
Code:
# Bind to only one interface
bind-interfaces
# Choose interface for binding
interface=wlan0
# Specify range of IP addresses for DHCP leasses
dhcp-range=192.168.150.2,192.168.150.10
5. hostapd config
in terminal type: sudo gedit /etc/hostapd.conf
and add those lines
Code:
# Define interface
interface=wlan0
# Select driver
driver=nl80211
# Set access point name
ssid=myhotspot
# Set access point harware mode to 802.11g
hw_mode=g
# Set WIFI channel (can be easily changed)
channel=6
# Enable WPA2 only (1 for WPA, 2 for WPA2, 3 for WPA + WPA2)
wpa=2
wpa_passphrase=mypassword
You can change ssid name and password for anything you want here. Current config will create hotspot named myhotspot with mypassword password.
6. Now create anywhere you want a file named start.sh
edit it with any text editor like this:
Code:
#!/bin/bash
# Start
# Configure IP address for WLAN
sudo ifconfig wlan0 192.168.150.1
# Start DHCP/DNS server
sudo service dnsmasq restart
# Enable routing
sudo sysctl net.ipv4.ip_forward=1
# Enable NAT
sudo iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
# Run access point daemon
sudo hostapd /etc/hostapd.conf
# Stop
# Disable NAT
sudo iptables -D POSTROUTING -t nat -o ppp0 -j MASQUERADE
# Disable routing
sudo sysctl net.ipv4.ip_forward=0
# Disable DHCP/DNS server
sudo service dnsmasq stop
sudo service hostapd stop
You will probably need to change ppp0 in this to eth0 (or any other number which refers to your wired connection.
7. Last step. Now you can start your hotspot by starting our script. just run it using sudo sh
for me it looks like this sudo sh /home/ogyct/Desktop/start.sh because I have it on my desktop
I am not sure who is the author of this guide, I only translated it to english. But anyway if this helped, hit the thanks button. Good day
Click to expand...
Click to collapse
This is running awesome. Just one question. How do I stop the script?
I find disabling and enabling wifi works. But is there any other way?
Hi, this script works perfectly. I was having issues with ubuntu shared wifi not being visible with android.
Now the hard question. I have a box that is already acting as a router sharing ip with dnsmasq over eth1
i added a wifi card wlan0 and i want to share not only internet but also the services running on my box
the problem is this script uses a different ip range and i cannot access my nfs shares.
my network is 192.168.128.x and i have set up this script in other range.
Setting it up in 192.168.128.10x for instance will not work
Is it possible to make this wifi share part of my network?
regards.
worked !!!
ogyct said:
As many of you know, most of our android(not only android) devices can't connect to ad hoc hotspots. There's a solution for win7/8 users to set up infrastructure hotspot on their laptop using software like connectify and so on. Ubuntu also allows to create wifi hotspot to share internet, but it will be ad hoc one.
So here's the guide how to set up infrastructure hotspot on ubuntu 12.04/12.10. Unlike some other methods described on the internet, this one will not break default network manager.
1. First of all you should make sure, that your wifi adapter supports infrastructure hotspots. If you used connectify on your windows system and it worked, skip this step.
open terminal and type: sudo lshw | less
find -network section and make sure that driver is ath5k or ath9k, this solution will only work for those drivers, but should fit the needs for the most laptop users.
2. We now need to install 2 additional tools to make out hotspot, 1st one is hostapd(hotspot server), 2nd one is dnsmasq(dns dhcp server)
in terminal type: sudo apt-get install hostapd dnsmasq
3. stop those services if started already, and prevent them from starting on system start up.
in terminal type:
sudo service hostapd stop
sudo service dnsmasq stop
sudo update-rc.d hostapd disable
sudo update-rc.d dnsmasq disable
4. Now we need to set up config files.
in terminal type: sudo gedit /etc/dnsmasq.conf
or sudo kate /etc/dnsmasq.conf if you use kde
add those lines to the config file
Code:
# Bind to only one interface
bind-interfaces
# Choose interface for binding
interface=wlan0
# Specify range of IP addresses for DHCP leasses
dhcp-range=192.168.150.2,192.168.150.10
5. hostapd config
in terminal type: sudo gedit /etc/hostapd.conf
and add those lines
Code:
# Define interface
interface=wlan0
# Select driver
driver=nl80211
# Set access point name
ssid=myhotspot
# Set access point harware mode to 802.11g
hw_mode=g
# Set WIFI channel (can be easily changed)
channel=6
# Enable WPA2 only (1 for WPA, 2 for WPA2, 3 for WPA + WPA2)
wpa=2
wpa_passphrase=mypassword
You can change ssid name and password for anything you want here. Current config will create hotspot named myhotspot with mypassword password.
6. Now create anywhere you want a file named start.sh
edit it with any text editor like this:
Code:
#!/bin/bash
# Start
# Configure IP address for WLAN
sudo ifconfig wlan0 192.168.150.1
# Start DHCP/DNS server
sudo service dnsmasq restart
# Enable routing
sudo sysctl net.ipv4.ip_forward=1
# Enable NAT
sudo iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
# Run access point daemon
sudo hostapd /etc/hostapd.conf
# Stop
# Disable NAT
sudo iptables -D POSTROUTING -t nat -o ppp0 -j MASQUERADE
# Disable routing
sudo sysctl net.ipv4.ip_forward=0
# Disable DHCP/DNS server
sudo service dnsmasq stop
sudo service hostapd stop
You will probably need to change ppp0 in this to eth0 (or any other number which refers to your wired connection.
7. Last step. Now you can start your hotspot by starting our script. just run it using sudo sh
for me it looks like this sudo sh /home/ogyct/Desktop/start.sh because I have it on my desktop
I am not sure who is the author of this guide, I only translated it to english. But anyway if this helped, hit the thanks button. Good day
Click to expand...
Click to collapse
Thank you.
Its worked successfully in Xperia J.
Worked in Linux Mint v15 (based on Ubuntu 13.04)
johnp
A little update, I am glad if this guide helped. but in case it didn't try this one http://www.webupd8.org/2013/06/how-to-set-up-wireless-hotspot-access.html. I didn't check this myself, but that script seems to be smart.

VPN + Wifi Tethering = Extremely Slow

I have a vpn service that I connect to on a regular basis. I want to wifi tether to two other android devices with this VPN connection. However, when I have the VPN connected and wifi tether on my G4, the clients connect at a VERY slow rate (>1 kb/s). I can't even pull up a Google in Chrome because it's so slow.
I have seen on the interwebs that I need to run some iptables commands like so...
Code:
iptables -t filter -F FORWARD
iptables -t nat -F POSTROUTING
iptables -t filter -A FORWARD -j ACCEPT
iptables -t nat -A POSTROUTING -j MASQUERADE
But this has no effect. I think these procedures might be a little outdated since we are on 5.1. Does anyone know of a VPN+Tether procedure that works on our G4's?
Bump
Solved!
NOTE: This required root access
1. Install WiFi Tether Router from the Play Store ($2.80)
2. Configure WiFi Tether Router like so:
Code:
Interface wlan0
Method 2
Channel 1
Encryption wpa2-psk (Don't forget to set password)
"No Firmware Reload" <- UNCHECKED
3. Connect to your VPN (I used the stock G4 settings)
4. Enable Wifi Tether Router (Asks for Root)
5. Enjoy!
All clients that connect to your G4 via Wifi Tether Router should now be within the VPN. You can check this by going to http://whatismyipaddress.com/

Categories

Resources