Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm using a Mobile Broadband device/ usb modem to connect my computer to the Internet.When I was using Windows 7, I made my laptop a Wifi hotspot, so I could surf internet on my iPod touch . Now I have moved to Ubuntu 12.04. I read the tutorials and did everythig I could and finally ended up with creating an ad-hoc network.. My iPod Touch successfully connects to the ad-hoc network, but I'm not getting any internet on the iPod. I thought it's because I didn't bridge my Mobile Broadband connection with the wireless connection. So I changed my wireless connection's method to "Shared to other computers" in IPv4 settings. I can't download apps to my iPod touch.

Can someone help me share my mobile broadband connection over Wifi?

share|improve this question
    
What you need is to setup a wifi network using. Setting Adhoc network is easy on Ubuntu –  BigSack Aug 19 '12 at 12:52
    
have you set up ipforward and iptables? –  arhimed Aug 19 '12 at 13:49
    
No I haven't setup ipforward. I saw it in forums..but I don't know how to apply those codes for my network types. Those codes are far beyond understanding for me. How do i figureout which ip address to choose? (My ISP provides me a static IP. Is that the one, or can I choose any? ) I did create a wireless network and a ad-hoc. Are you sure pforward and iptables will help me to solve this issue? Please explain.. –  Naveen Aug 19 '12 at 14:19
2  
See if this helps help.ubuntu.com/community/Internet/ConnectionSharing –  nikhil Oct 22 '12 at 8:12
    
Thanks. It did help... I got the simplified instryctions. –  Naveen Oct 22 '12 at 8:29
add comment

1 Answer 1

up vote 0 down vote accepted

This is how I worked it out...

  1. Create a new wireless network (aka hotspot) using the network manager.
  2. Enable IP forwarding by executing the command below:

echo 1| sudo tee /proc/sys/net/ipv4/ip_forward

  1. Identify the device which connects your computer to Internet, by using ifconfig command. (My one is ppp0, because it has an IP address.)
  2. Finally tell iptables to forward ppp0's internet traffic to everywhere!

sudo iptables -t nat -A POSTROUTING -s 10.10.0.0/16 -o ppp0 -j MASQUERADE

Disconnect & reconnect the Wifi connection(Hotpsot) you made earlier.
Internet should be flowing to the wireless network now!
If you did it correctly, the output of sudo iptables -L should be similar to this:

Chain FORWARD (policy ACCEPT)
target.....prot opt.....source....................destination
ACCEPT.....all ---........ anywhere.............10.42.43.0/24.........state RELATED,ESTABLISHED
ACCEPT.....all ---........ 10.42.43.0/24......anywhere

An external guide is available here.

Thanks to web-E...!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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