LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices


Reply
  Search this Thread
Old 04-26-2013, 10:25 AM   #1
revered
LQ Newbie
 
Registered: Jun 2010
Posts: 6

Rep: Reputation: 0
Arrow Problems connecting to "fake" access point


My router broke so I am trying to setup something temporarily to share internet connection from my main pc (internet comes from modem connected directly to ethernet card) to other devices via an ad hoc network, for that I have a wifi adapter that uses the zd1211rw driver (i also have the alfa rtl8187 but that adapter is not working at all on ubuntu 12.04).

The problem that I am having is that I can't connect to the wifi AP I create, it just stays "acquiring network address" and never finish connecting.

My main computer OS is Ubuntu 12.04, this is what I am doing. First I put the wifi adapter on monitor mode with:

Code:
airmon-ng start wlan2
This creates a mon0 interface, then I use:

Code:
airbase-ng -e MyNetName -c 11 -v mon0
From here I can already see the MyNetName network using my laptop (with windows), but if I try to connect it stays at "acquiring network address". The tutorials I followed continue with these commands:

Code:
ifconfig at0 up
ifconfig at0 192.168.1.254 netmask 255.255.255.0
route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.254

iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
iptables -P FORWARD ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo > '/var/lib/dhcp/dhcpd.leases'
Then I start the dhcp server with

Code:
dhcpd -d -f -cf /etc/dhcp/dhcpd.conf at0
The dhcpd.conf file looks like this:

Code:
ddns-update-style interim; <- also tried ad-hoc instead of interim
default-lease-time 600;
max-lease-time 7200;
authoritative;
subnet 192.168.1.0 netmask 255.255.255.0 {
  option subnet-mask 255.255.255.0;
  option broadcast-address 198.168.1.255;
  option routers 192.168.1.254;
  option domain-name-servers 8.8.8.8;
  range 192.168.1.1 192.168.1.253;
}
The output looks like:
Code:
Internet Systems Consortium DHCP Server 4.1-ESV-R4
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit xxxxxx
Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
Wrote 0 leases to leases file.
Listening on LPF/at0/00:02:72:69:28:c8/192.168.2.128/25
Sending on   LPF/at0/00:02:72:69:28:c8/192.168.2.128/25
Sending on   Socket/fallback/fallback-net
Can't create PID file /var/run/dhcpd.pid: Permission denied.
The last command:

Code:
echo "1" > /proc/sys/net/ipv4/ip_forward
The airbase-ng command output looks like this:

Code:
11:34:03  Created tap interface at0
11:34:03  Trying to set MTU on at0 to 1500
11:34:03  Trying to set MTU on mon0 to 1800
11:34:03  Access Point with BSSID 00:02:72:69:28:C8 started.
11:34:10  Client 70:F3:95:B3:27:76 associated (unencrypted) to ESSID: "MyNetName"
11:34:13  Client 70:F3:95:B3:27:76 reassociated (unencrypted) to ESSID: "MyNetName"
11:34:17  Client 70:F3:95:B3:27:76 reassociated (unencrypted) to ESSID: "MyNetName"
11:34:21  Client 70:F3:95:B3:27:76 reassociated (unencrypted) to ESSID: "MyNetName"
So my problem is that I cannot get an internal ip on the laptop that is trying to connect, the windows wifi manager thing just stays at "acquiring network address", airbase reacts by showing more of those reassociated messages while the laptop tries to connect. Another problem is that after running iptables --flush the internet in the main PC stops working, but I want to deal with that once I am able to fully connect to MyNetName.

Does anyone have an idea what am I doing wrong?

Last edited by revered; 04-26-2013 at 10:59 AM.
 
Old 04-26-2013, 03:46 PM   #2
rigor
Member
 
Registered: Sep 2003
Location: 19th moon ................. ................Planet Covid ................Another Galaxy;............. ................Not Yours
Posts: 705

Rep: Reputation: Disabled
revered,

There might be other issues in what you are doing, but one main thing I see is the following.

AFAIK, when MS-Windows gives that message, it is trying to get a DHCP lease. When your DHCP server issues this message:

Quote:
Originally Posted by revered View Post
Code:
Can't create PID file /var/run/dhcpd.pid: Permission denied.
:
is it just a warning? Does the server continue to run, or does it die? Naturally if your DHCP server dies, MS-Windows won't be able to get a DHCP lease, which is to say that it won't be able to get an IP address.

Last edited by rigor; 04-26-2013 at 03:50 PM.
 
Old 05-01-2013, 12:31 AM   #3
revered
LQ Newbie
 
Registered: Jun 2010
Posts: 6

Original Poster
Rep: Reputation: 0
I ended up buying a new router.

Also, I solved the .pid problem but still was not able to get an ip.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to permanent spoof "fake" mac address for eth0 & eth1? in NEW linux distro"s... vastvet Linux - Newbie 22 02-02-2013 12:40 AM
[SOLVED] bt5 r2 "wicd "wireless bad password and unable to connect to access point errors sagy Linux - Newbie 2 05-19-2012 05:03 PM
Ubuntu lucid user & AnyData adu 560d modem "Problems connecting to Internet" ubuser Linux - Newbie 1 01-25-2011 09:31 AM
problem "creating" an access point with dnsmasq samel_tvom Linux - Networking 2 01-13-2008 11:08 AM
Why my wireless card "atheros" run only as an acces point in "Master" mode. jardiamj Linux - Wireless Networking 3 11-11-2007 12:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 11:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration