Related
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.
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.
Short Version:
Got an OpenVPN server on my NAS. GN connects & works fine; remote resources are reachable. I now want to know how I can route all traffic through the tunnel. (Is this possible?)
Long Version:
For those times when I'm traveling (domestically and internationally) and/or using a questionable Internet connection, I'd like to secure the connection.
I've got a [stock] rooted GN running Jelly Bean with BusyBox installed. My NAS has two built-in VPN solutions one of which being OpenVPN so I got that setup which created an .ovpn file containing the following configuration:
Code:
dev tun
tls-client
remote YOUR_SERVER_IP 1194
# The "float" tells OpenVPN to accept authenticated packets from any address,
# not only the address which was specified in the --remote option.
# This is useful when you are connecting to a peer which holds a dynamic address
# such as a dial-in user or DHCP client.
# (Please refer to the manual of OpenVPN for more information.)
#float
# If redirect-gateway is enabled, the client will redirect it's
# default network gateway through the VPN.
# It means the VPN connection will firstly connect to the VPN Server
# and then to the internet.
# (Please refer to the manual of OpenVPN for more information.)
#redirect-gateway
# dhcp-option DNS: To set primary domain name server address.
# Repeat this option to set secondary DNS server addresses.
#dhcp-option DNS DNS_IP_ADDRESS
pull
proto udp
script-security 2
ca ca.crt
comp-lzo
reneg-sec 0
auth-user-pass
After installing OpenVPN Installer & OpenVPN Settings, I had to manually symlink busybox, ifconfig, and route from /system/bin to /system/xbin in order for OpenVPN to run properly.
Code:
#Note: In an attempt to be thorough, and for any Googlers or forum searchers (+1)...
#First I had to mount /system as read/write via:
mount -o -rw,remount /system
#Then create the symlinks via:
ln -s /system/bin/busybox /system/xbin/busybox
ln -s /system/bin/ifconfig /system/xbin/ifconfig
ln -s /system/bin/route /system/xbin/route
#Then remount /system as read-only via:
mount -o ro,remount /system
Once all of the above was setup, I initiated the connection, successfully authenticated, and was able to reach remote resources without issue.
What I would like to do at this point is get it setup so that I can have a second profile that routes all traffic through the VPN. I assume its a client-side configuration change but I really don't know at this juncture.
Many thanks!
Doesn't CyanogenMod ROM have native OpenVPN support? I think the OpenVPN client on CM has an option to route all traffic through the VPN. I think for what you want to do you should need a custom ROM or kernel that supports iptables.
iptables is a system file that allows the system to redirect network traffic usually for apps like tethering, firewalls, and proxies.
Sent from my Galaxy Nexus using Tapatalk 2
Thanks for taking the time to reply KemikalElite.
I've got BusyBox 1.20.2 installed and I do have an iptables binary (v1.4.11.1). With solutions like Hotspot Shield VPN that don't require root yet supports encryption for all traffic, I figured root + OpenVPN + BusyBox + iptables would be sufficient.
My initial assumption was that I would need to make some changes to my OpenVPN configuration to encrypt & route all traffic through the tunnel. But maybe I've been thinking about this all wrong and its less about OpenVPN and more about running a custom script once connected to route everything through the tunnel; and vice versa when I disconnect to restore the original configuration.
Perhaps I should be scouring OpenVPN forums?
Phylum said:
Thanks for taking the time to reply KemikalElite.
I've got BusyBox 1.20.2 installed and I do have an iptables binary (v1.4.11.1). With solutions like Hotspot Shield VPN that don't require root yet supports encryption for all traffic, I figured root + OpenVPN + BusyBox + iptables would be sufficient.
My initial assumption was that I would need to make some changes to my OpenVPN configuration to encrypt & route all traffic through the tunnel. But maybe I've been thinking about this all wrong and its less about OpenVPN and more about running a custom script once connected to route everything through the tunnel; and vice versa when I disconnect to restore the original configuration.
Perhaps I should be scouring OpenVPN forums?
Click to expand...
Click to collapse
You have the tun module as well right?
code.google.com/p/android-openvpn-settings/issues/list
Check through some of those issues. Something did say that the DNS servers may need to be manually set.
OpenVPN is so complex because of the config options. I find it easier to use native PPTP connections since there's no config only authentication and it routes all traffic automatically.
Sent from my Galaxy Nexus using Tapatalk 2
You need to enter "redirect-gateway" into your ovpn config file.... Just remove the # in the your config
Thanks for the reply ZiCoN!
I should have mentioned this sooner - terribly sorry for omitting this.
Once I got the VPN connected, I did the old 'what is my ip' to verify the route. It was still using the provider's network, but I could reach my NAS and other remote devices in the 192.168.x.x range - so the VPN itself was working. After reading the mini explanation in the config file I enabled 'redirect-gateway' and after reconnecting I could no longer access the Internet. I checked the OpenVPN Manual I added 'def1' after the 'redirect-gateway' statement, reconnected but still no go: I can no longer access the Internet. Remote resources are still accessible in both scenarios.
KemikalElite said:
You have the tun module as well right?
code.google.com/p/android-openvpn-settings/issues/list
Check through some of those issues. Something did say that the DNS servers may need to be manually set.
OpenVPN is so complex because of the config options. I find it easier to use native PPTP connections since there's no config only authentication and it routes all traffic automatically.
Sent from my Galaxy Nexus using Tapatalk 2
Click to expand...
Click to collapse
I somehow missed this when drafting my last reply. I think you're right about it being a DNS problem. I made a change to the config file (adding a few lines for 'dhcp-option DNS x.x.x.x') and within OpenVPN used the 'Fix DNS' button.
Thanks all for your time, thoughts, opinions and instructions!
Phylum said:
Thanks for the reply ZiCoN!
I should have mentioned this sooner - terribly sorry for omitting this.
Once I got the VPN connected, I did the old 'what is my ip' to verify the route. It was still using the provider's network, but I could reach my NAS and other remote devices in the 192.168.x.x range - so the VPN itself was working. After reading the mini explanation in the config file I enabled 'redirect-gateway' and after reconnecting I could no longer access the Internet. I checked the OpenVPN Manual I added 'def1' after the 'redirect-gateway' statement, reconnected but still no go: I can no longer access the Internet. Remote resources are still accessible in both scenarios.
Click to expand...
Click to collapse
You probably need to allow traffic to route back along the vpn film the internet. On your gateway, route vpn addresses to the VPN server and make sure forwarding is enabled on the vpn server.
Questions go in Q&A
Read forum rules and stickies before posting
Thread moved
FNM
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 .
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.