1

I have a Linux Desktop (Fedora 18 or Ubuntu 14) on a wired LAN connected to the Internet. This Desktop has just 1 NIC which is connected to the LAN; it has no wifi card in it.

What hardware and software config choices do I have if I want to share this Desktop's Internet connection with my Android phone every now and then? The phone has bluetooth and wifi both, but no Internet connection of its own via 3G etc.

Some searching on the Net tells me that there are USB based bluetooth and wifi dongles which I could use to first get my Desktop to become wireless-capable. But will these dongles require any device drivers too for Linux, or will they work out of the box?

The other option is to get a wireless router, connect the Desktop to the router and the router to the LAN, and then try sharing the Internet connection with my phone. But my LAN is configured to allow Internet only to specific IP addresses (e.g. currently my Desktop and not the router) and I am not sure if a router's IP address can be changed to my desktop's original IP address. If it can be changed, then I could setup forwarding between my Desktop and the wireless router allowing the Desktop Internet access as before, plus share the Internet connection with my Android too.

Is there any other option?

2

There's two options - some phones support reverse tethering, but not all phones support it. In many cases you need root, and your phone is tied into the router.

Alternately you can use the lovely hostapd to do this. You'll be using a slightly unusual setup here since we're bridging our AP to the other router, rather than running a whole seperate network.

I'm assuming ubuntu but you need to install hostapd and bridge-utils. I've adapted my own setup from the one on cyberciti.biz, and its well worth a read

For starters you need a wireless chipset that has support in the kernel - I tend to go with USB nano dongles (which have a supported mediatek/ralink chipset).

On a network in the 192.168.1.x range, with a static ip of 192.168.1.127 on your desktop, and a router/dhcp server with the ip address 192.168.1.1, backup your current /etc/networks/interfaces and replace it with this. Its pretty self explainatory, so just change what dosen't fit to meet your needs

auto lo br0
iface lo inet loopback

# wireless wlan0
allow-hotplug wlan0
iface wlan0 inet manual

# eth0 connected to the ISP router
allow-hotplug eth0
iface eth0 inet manual
iface eth0 inet6 auto
# Setup bridge
iface br0 inet static
    bridge_ports wlan0 eth0
    address 192.168.1.127
    netmask 255.255.255.0
    network 192.168.1.0
    ## isp router ip, 192.168.1.1 also runs DHCPD ##
    gateway 192.168.1.1
    dns-nameservers 192.168.1.1

You'll also want to set up /etc/hostapd/hostapd.conf - Something like this will work but I read through and edited the stock one

### Wireless network name ###
interface=wlan0
### Set your bridge name ###
bridge=br0
driver=nl80211

###CHANGE ANYTHING BELOW THIS TO SUIT!###

### (IN == INDIA, UK == United Kingdom, US == United Stats and so on ) ###
country_code=SG
hw_mode=g
channel=6
wpa=2
## Key management algorithms ##
wpa_key_mgmt=WPA-PSK

## Set cipher suites (encryption algorithms) ##
## TKIP = Temporal Key Integrity Protocol
## CCMP = AES in Counter mode with CBC-MAC
wpa_pairwise=TKIP
rsn_pairwise=CCMP

## Shared Key Authentication ##
auth_algs=1

## Accept all MAC address ###
macaddr_acl=0
1

USB bluetooth dongles are usually written for Windows only, sometimes with Mac support and rarely with Linux support. But Linux ones exist nonetheless. Wifi dongle not required unless you actually have a wireless modem to connect to.

If you have a wireless modem/router, you can use both wired network cable for the desktop and wireless network for the Android. Set security and a password otherwise your neighbours will probably use your Internet for free.

  • With the wireless router option... how do I set the router up on a LAN that I am not the admin of?I can only control my desktop's and my router's IP address (assuming the latter is even possible!), little else. – Harry Jul 8 '14 at 3:24
1

You can get a wireless USB network adapter for less than £10 on Amazon. You can set it up as a hotspot and share your wired internet connection with your phone/tablet.

I advise using Wifi over Bluetooth because you'll get a better range with your Wifi.

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.