View Full Version : [ubuntu] simple router

May 19th, 2008, 10:02 AM
i am using Ubuntu 7.10

i have 2 laptops, A and B, both with WLAN cards.
A is connected to the internet through an ethernet cable.
how can i make A function as an access point so that B can receive the signal from A and surf the internet?

i use "Create New Wireless Network", but it keeps failing. It just reverts back to itz wired connection.

thank you.

May 19th, 2008, 11:51 AM
Additional niformation : you can say that i want to turn my laptop into a wireless hotspot

May 19th, 2008, 11:54 AM
Firestarter has this function.


May 19th, 2008, 12:13 PM
There is a package called "hostapd". Hostapd is a daemon. It deals with all related to wifi connectivity. To configure it you need to edit /etc/hostapd/hostapd.conf, but it needs understanding wifi principles to edit.
If you manage to setup hostapd, follow the instructions above related to firestarter. Firestarter + hostapd = AP.
Apart from that, if you have Atheros-based wifi card (see the output of "lspci" tool) and agree to have an open (unencrypted and public) wifi AP, there is a simpler solution, i know and can explain you.

May 19th, 2008, 01:32 PM
any other methods?

May 19th, 2008, 01:48 PM
Well I'm a Newbie too, but this can be done in MS.

for PC A (the hotspot) make sure its connected to the Lan.
then Assign the wireless IP address of or something.
then on the Laptop B you could use as your default Gateway.
The other thing you could do is get a wireless router and do the same thing.

May 19th, 2008, 01:57 PM
The truth is that there is (yet) no high level gui in Ubuntu, that would let one create a wifi-inet-sharer. All, that can be done, needs system-level digging. =(

May 19th, 2008, 06:05 PM
The truth is that there is (yet) no high level gui in Ubuntu, that would let one create a wifi-inet-sharer. All, that can be done, needs system-level digging. =(


Firestarter is a GUI.

I didn't have to edit anything, other than installing hostapd & firestarter.

May 20th, 2008, 08:14 AM
i have 2 laptops and both have WLAN.
Laptop A has Ubuntu 7.10
Laptop B has Ubuntu 7.04

i am trying to link the 2 laptops using Ad-Hoc
Laptop A is the transmitter and B is the receiver

in A, i type "ifconfig eth2 netmask broadcast up"

B is now connected to "Test"
However, when i type "ping", it says:-
From xxx.xxx.x.xxx icmp_seq=2 Desination Host unreachable
From xxx.xxx.x.xxx icmp_seq=3 Desination Host unreachable
From xxx.xxx.x.xxx icmp_seq=4 Desination Host unreachable
and so on until i hot Ctrl + C

What is the problem?
pls help me

p/s :- i am used this website for instructions.

thank you

May 20th, 2008, 08:38 AM
Your B card doesn't seem to have an IP adress.

sudo ifconfig eth2

to assign one(if eth2 is your interface)

Check this guide (https://help.ubuntu.com/community/WifiDocs/Adhoc)

May 20th, 2008, 09:16 AM
after typing "sudo dhclient eth2" at the activation part, i get this message:-
(my WLAN is eth2)

DHCPDISCOVER on eht2 to port 67 interval 5
DHCPDISCOVER on eht2 to port 67 interval 6
DHCPDISCOVER on eht2 to port 67 interval 20
No DHCPOFFERS received.
No worknig leases in persistent database - sleeping.

is this a problem?


May 20th, 2008, 09:34 AM
To use dhcp, you'll have to set up a dhcp server in one of your computers.

As you only have two pcs, it's easier to use static IP adresses.
For the first:
sudo ifconfig eth2
For the second:
sudo ifconfig eth2

May 20th, 2008, 09:37 AM
about the Firestarter, website, i dont understand how to do it
can smoeone pls write me the commands?
i am very new to Linux


May 20th, 2008, 09:50 AM
i still get the same problem
it is sleeping T_T

any other solutions?

May 20th, 2008, 09:59 AM
So, you have followed the instructions of the site and created a wireless network "test" from computer A.Then you connected to "test" from computer B,correct?

Could you post the output of ifconfig and iwconfig from both computers?

May 20th, 2008, 10:16 AM
i think i just succeeded

Laptop A
ifconfig eth2

Laptop B
ifconfig eth1

Laptop A
(i receive packets)

Laptop B
(i receive packets)

so, has a connection been established?


May 20th, 2008, 10:20 AM
I was meaning to create a How-To when I did this... unfortunately, I didn't :( So this is from memory.

Let me know how it goes.

I am assuming that the 2 wifi cards both work with Ubuntu. If you don't already know that, then this may be tricky.

Laptop A:

In System->Administration->Synaptic Package Manager
Search for and install firestarter and dhcp3-server

REbooting may be necessary here (unsure).

In System->Administration->Network (unlock it if necessary)
Wireless - disable roaming.
Configuration: Static IP
IP address: (make sure this is different than your router - if the same, try
Default gateway (IP): <leave empty>

In System->Administration->Firestarter
The Firestarter Wizard starts.
Click Forward
Select your Internet connection device (e.g. eth0 - most likely for wired)
(select "IP address is assigned by DHCP" if that is what you use - likely to be the case)
Select "Enable Internet connection sharing"
Select your wifi device (e.g. eth1, wlan0, ath0 for wifi) as Local area network device
Select "Enable area network device"
Start the Firewall.

Laptop B:

Enable wifi as you would expect, with DHCP / roaming.

Hopefully, that should work now.

I am going to give it a quick try to see how it works.

EDIT: Sorry - I see you have got it working already - didn't see page 2!!

May 20th, 2008, 10:22 AM
Yes, your network is up and running!

May 20th, 2008, 10:37 AM
ok, that is good
however, laptop B cannot surf the internet.
Laptop A is connected to the internet via Ethernet.
Both laptops A and B are connected through WLAN.

pls help
i need laptop B to be able to surf the internet