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 have an internet connection through a cable modem. The IP address on the cable modem is not static and is perhaps obtained through a DHCP mode.

I wish to share this internet connection through the Wifi port available on my computer. Interestingly, the ad-hoc network setting does not work for my case on Ubuntu.

Therefore, I have set up my /etc/network/interfaces as follows:

auto lo
iface lo inet loopback

auto wlan0
iface wlan0 inet static
address 10.10.0.1
netmask 255.255.255.0

I am not clear with the process of routing, as I do not know the DHCP address until it is assigned i.e. only after I connect I will know the IP address of the system, and that IP address would be the one which the DHCP clients of my computer would use to route their internet connectivity.

Any clues on this?

share|improve this question

2 Answers 2

Try ap-hotspot, which is a convenient wrapper around hostapd.

share|improve this answer

I assume you are connecting to internet through your eth0 and wish to share the connection to other computers via your wireless card (wlan0).

The reason what you have tried is failing is because your ubuntu only shares the connection as is, and your cable modem provider likely provides only one external IP address, which is given to your ubuntu computer. The other computers connecting to your newly created WiFi network are not getting IP addresses, and thus are not able to get connected.

Thus you have to install & enable a DHCP server on your ubuntu machine.

sudo apt-get install dnsmasq

and then configure it sudo nano /etc/dnsmasq.conf by adding the following lines in the "interface" section:

interface=wlan0
dhcp-range=192.168.0.100,192.168.0.250,72h

After this, your clients should get a IP address when connecting to the newly created WiFi network, and then the connection should be forwarded to the internet.

share|improve this answer

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.