Jump to content

Set the correct routes for at0 **Bounty for solution**


Recommended Posts

Hi all

Im stuck @ setting up a wifi AP on a Pineapple. Tried on a laptop with the same results. Im sure the fault is a routing issue. Its driving me crazy since day's / weeks.

Tried different setups and infusions but i dont get it working.

So now im willing to give 0.10 BTC (or equivalent in you FIAT) bounty for a solution.

Here the setup:

PIneapple is connected trough a lan cable to a linux laptop, wp5 script is running there, so the pineapple has WAN, laptop too.

Plug in Alfa wifi card, will be listed as wlan1

airmon-ng start wlan1

start airbase-ng, on wlan1 - created interface at0 is listed

After that i put at0 up and bridge it with br-lan

ifconfig at0 up

br-ctl addif br-lan at0

Now the clients gets a ip (range in the logs i can see the replies from dnsmask. But the clients didnt get WAN/internet. While the to connection to the Pineapple ( web portal is very slow.

I can install infusions, so internet is working, And with the networkmanager infusion i can get up and working a AP with wlan1.

I think im missing something with setting up at0 on a Ip or set a route. But every combinazion a try, it didnt work.

Something like: ifconfig at0 172.16.42.xxx netmask

add route -net xxx.xxx.xxx.xxx netmask gw xxx.xxx.xxx.xxx

I used the search function and google. Found a lot about that, but not specific in case of at0 and wifi pineapple.

Thanks for help

Link to comment
Share on other sites

The pineapple has already bridget eth0(wan)/wlan0/1

Before i start "brctl show" lists this:


STP enabled





So your solution:

ifconfig at0 up (thats exactly what im doing)

br-ctl addif br-lan at0 (same as by now)

br-ctl addif br-lan wlan0 (i dont use this interface, why bridge it? U meant wlan1? Itsalready bridged...)

In the logs i see dnsmasq ack for IP, but still no internet for my clients...

so at0 and eth0 are bridget correctly, something with the IP routing must be wrong. Do i have to set a IP for at0?

So still no internet on my clients...

Link to comment
Share on other sites

Route Table:

Destination Gateway Genmask Flags Metric Ref Use Iface
default UG 0 0 0 br-lan * U 0 0 0 br-lan

Wlan1 has no ip, since the command "ifconfig at0 up" is executed without a ip nor netmask.

Tried something new:

The wlan0/1 is managed by hostapd, and maybe cause some problem to my at0 interface.

So now i tried to stop the hostapd with "killall hostapd"

now wlan0/1 disappears from ifconfig. Still there the br-lan interface with the adress.

then i restart my steps,

airmon-ng start wlan1 (create interface mon0)

airbase-ng -e test -P -C 30 -c 6 mon0 (create interface at0)

ifconfig at0 up

brctl addif br-lan at0

now i see at0 on ifconfig and brctl. But now i dindt get even an ip on clients.

This is the job from dnsmasq right? How to repoint dnsmasq on at0 without messing up the already working settings?

Link to comment
Share on other sites

Don't do a killall hostapd. i suggest you reboot your pineapple now to make sure all services and configurations are loaded proper.

We also need your GW ip adress, subnet and all of that stuff. If i'm correct, this is your setup:

Alfa <=USB=>Pineapple<=ethernet=>laptop







Link to comment
Share on other sites

more like that:

Alfa <=USB=>Pineapple( on br-lan)<=ethernet=>laptop( on eth0)



Wireless ( on wlan0)



Router/gw/ap/internet (

After a factory reset and fresh connection to a laptop i have in ifconfig:

br-lan ip: bcadd: mask:

eth0 with no ip

and routes as statet in post above


config 'dnsmasq'
option 'domainneeded' '1'
option 'boguspriv' '1'
option 'filterwin2k' '0'
option 'localise_queries' '1'
option 'rebind_protection' '1'
option 'rebind_localhost' '1'
option 'local' '/lan/'
option 'domain' 'lan'
option 'expandhosts' '1'
option 'nonegcache' '0'
option 'authoritative' '1'
option 'readethers' '1'
option 'leasefile' '/tmp/dhcp.leases'
option 'resolvfile' '/tmp/resolv.conf.auto'

config 'dhcp' 'lan'
option 'interface' 'lan'
option 'start' '100'
option 'limit' '150'
option 'leasetime' '12h'
option 'ignore' '0'
list 'dhcp_option' '3,'
list 'dhcp_option' '3,'
list 'dhcp_option' '6,,'
list 'dhcp_option' '6,,'

#config 'dhcp' 'wan'
# option 'interface' 'wan'
# option 'ignore' '1'
# option 'start' '100'
# option 'limit' '150'
# option 'leasetime' '12h'
# list 'dhcp_option' '3,'
# list 'dhcp_option' '6,,'
# list 'dhcp_option' '6,,'
Edited by Mr.miYagi
Link to comment
Share on other sites

Ok for that kind of setup your better of settting a static ip on your laptop. lets say ( this becomes your GW for the 172.16.42.XXX network, DO NOT SET A GW HERE )

Also enable ip routing on this device. ( if its windows use enable share internet connection on wireless, also check firewalling )

Linux you need something like:

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
iptables -A FORWARD -i eth0 -j ACCEPT

Now configure the Pineapple:

nameserver as or ( or if router does dns )

DHCP server settings in pineapple:

dns set as

gateway set as

Now you run your commands:

airmon-ng start wlan1
start airbase-ng, on wlan1 - created interface at0 is listed
ifconfig at0 up
br-ctl addif br-lan at0

Then should do it. If not do the following tests:




nslookup www.google.com or dig www.google.com ( dont know wich command you use )

Link to comment
Share on other sites

The laptop has a static ip

This is made by the wp4.sh script from the pineapple wiki.

So you mean i have to change this adress?

But when i do this, the pineapple will loose connection to my Laptop?!

When i activate the wlan0 as ap, it dosent change the ip from the laptop and its working. So it must work also with the wlan1/at0?

Iprefer to keep the setting on my laptop, because they are set automatically and later i want to change to a 3g stick.

It must be possible to swap the configuration from wlan0 to at0.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...