Find the answer to your Linux question:
Results 1 to 3 of 3
Hello everyone this is my first post and Im a bit of a newbie when it comes to dhcp and DNS routing so please bare with me I'll try and ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2008
    Posts
    2

    Make a laptop into a wireless AP, help!


    Hello everyone this is my first post and Im a bit of a newbie when it comes to dhcp and DNS routing so please bare with me I'll try and explain what I am trying to do.

    I have a large area to cover with a wireless network and the connection at points away from the router is spotty at best. Instead of going out and getting a repeater to increase the range of the router I have an old laptop with an internal wireless card and a second wlan interface in the form of a USB dongle.

    What I want to do is connect to my wireless router using the internal card (Intel 4965AGN) then allow other computers to connect to my laptop as though it were a wireless router through my second interface (ALFA 500mW with RTL8187 chip)
    This should allow clients connecting to my laptop to be assigned an address through dhcp and be able to send queries to my ISPs dns server while also allowing me to monitor traffic and install firewalls on my laptop.

    I guess this would be a subnet of a subnet that allows for internet connectivity from both subnets.

    So far I have managed to get my laptop to behave as a wireless access point using a program called airbase-ng. This program puts my USB interface into monitor mode and replaces it with a tap interface called at0. I can then set an essid and encryption and all that.

    My next challenge is to get my laptop to bridge the two interfaces, (not sure if bridge is the right term) I need to have it assign IP addresses in my new subnet (listening on at0) and forward DNS requests to the router (connected by wlan0). I have been trying to use dnsmasq to accomplish this but I have not been able to find much information on doing this specific kind of thing.

    If anyone could point me in the right direction it would be very much appreciated.

  2. #2
    Just Joined!
    Join Date
    Oct 2008
    Posts
    14
    I did something similar last winter for fun.
    I used some of the hints I found here
    Build A Linux-Based Wireless Access Point
    Build A Linux-Based Wireless Access Point (Part 2)

    This of course is a very simple configuration and does not have any sort of security. But will get the job done.
    If you use the DSL (Dam Small Linux) distribution you can even get it on several hundred MB worth of space. Enough for a USB stick.

    You won't easily get the features of the WiFi routers on the market. Or the ease of use.
    I would recommend that you purchase one of the routers that supports OpenWRT <<http://openwrt.org/>>
    You will get a very small Linux distro that is easy to setup and very powerfull.

  3. #3
    Just Joined!
    Join Date
    Dec 2010
    Posts
    1
    Well tried to do the same last week: Got a new Android 2.1 phone had fun teething it and using it for skype-sip, however only at work. At home the router is used to hook me to next door wireless and provide internet and VoIP. Well thought it would be fun to setup my laptop as a router using Fedora-Core fc9 (standard engineer moto: if it works don't fix it!). Mind you Android 2.2 can provide reverse teething through the usb cable or ad-hoc wifi, however upgrading my phone to 2.2 is not provided by manufacturer, therefore would be a great challenge for me; not to mention skype, sip and android market would probably not work!

    It seems setting your laptop as an acess point is almost close to impossible! Needs atheros, broadcom or prism cards; hostapd is the deamon, which was not convinced to utilize my build-in ipw2200 wireless card, my wl-167 usb dongle or even an atheros TP-LINK-722, since ath9k_htc drivers would not compile in my 2.6.27 kernel !!! So I let it settle for a couple of days, until I realized airbase-ng of the aicrack-ng suite acts as a base station! Furthermore there is an abundance of wireless cards, which offer support for it (including my internal patched wireless and usb dongle)! Airbase-ng is available in aircrack-ng 1.1 onwoards (possibly in some late 1.0-rc version as well), which compliles like a charm in most systems, or alternatively you could use a back-track 4.2 bootable DVD with wireless card support available .

    Well this is my script (run it a root):

    Code:
    #!/bin/bash
    
    killall airbase-ng
    export KEY=`date | sha1sum | hexdump -C -n 10 | gawk '{gsub("[|]","",$NF); print $NF; getline}'`
    #export KEY="1234567890" 
    # generates a unique key every time the script it is used
    airmon-ng start rausb0
    airbase-ng -e test -c 11 rausb0 -W 1 -w "$KEY" -v -d <00:11:22:33:44:55_your_client_mac> & #-X
    sleep 5
    ifconfig at0 up
    ifconfig at0 192.168.0.1 netmask 255.255.255.0
    iptables --flush
    iptables --table nat --flush
    iptables --delete-chain
    iptables --table nat --delete-chain
    echo 1 > /proc/sys/net/ipv4/ip_forward
    /etc/init.d/dnsmasq restart
    iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
    iptables --append FORWARD --in-interface at0 -j ACCEPT
    iptables -t nat -A PREROUTING -p udp --dport 53 -j DNAT --to 192.168.2.1
    echo "ACESSPOINT READY ch: 11 ESSID: test"
    echo "KEY='$KEY'"
    BTW router LAN is in my case 192.168.0.xx and router WAN is 192.168.2.xx
    "eth0" is my wired ethernet card and "rausb0" my usb wifi card.
    Need to change /etc/dnsmasq.conf to suit your needs

    Code:
    interface=at0
    dhcp-range=192.168.0.50,192.168.0.150,12h
    dhcp-host=00:11:22:33:44:55,192.168.0.10,24h
    dhcp-ignore=00:17:3F:75:0F:DB
    #some near-by wireless card
    conf-dir=/etc/dnsmasq.d
    Down side is that ony WEP is supported by airbase-ng for the time being; therefore I went through the steps of changing the key every time I run it, added mac-filtering and I shut the system down when not used. Furthermore intrusion detection will be evident from airbase-ng log, while you could even introduce some associated airbase-ng fishing tricks , to scare people away from your router .

    Have fun

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •