element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Raspberry Pi as an Access Point.
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 29 replies
  • Subscribers 678 subscribers
  • Views 4743 views
  • Users 0 members are here
  • access
  • raspberry
  • current
  • in
  • act
  • to
  • as
  • are
  • a;
  • these
  • my;
  • like
  • wireless
  • the;
  • point.;
  • settings
  • ;/etc/network/interfaces:
  • would
  • i
  • pi;
Related

Raspberry Pi as an Access Point.

wallarug
wallarug over 13 years ago

I would like my Raspberry Pi to act as a wireless access point.  These are the current settings in /etc/network/interfaces:

 

auto lo

 

 

iface lo inet loopback

iface eth0 inet dhcp

 

 

allow-hotplug wlan0

 

 

iface wlan0 inet static

        wireless-essid "wireless"

        wireless-mode ad-hoc

        wireless-channel auto

        address 192.168.12.1

        netmask 255.255.255.0

        gateway 192.168.12.2

#wpa-psk "robotics"

 

 

Any ideas how I can turn this into a dhcp server that can give out IP addresses?  I really am getting tired of changing to manual ever time on PC.

 

Any help will be apreciated.

  • Sign in to reply
  • Cancel
Parents
  • wallarug
    wallarug over 12 years ago

    Hello,

     

    I have successfully got the Raspberry Pi working as an access point but I have a few questions about different setups.

     

    http://sirlagz.net/2012/08/09/how-to-use-the-raspberry-pi-as-a-wireless-access-pointrouter-part-1/

     

    I used the link above which worked out nicely.

     

    Part One seems to do the trick for me...

    A. Raspberry Pi can be accessed through AP

    B. AP gives out IP addresses

    C. Devices can communicate between each other through AP (I tested between two windows machines Remote Desktoping into one of them)

     

    Part Two:

    If you want a wifi router, ignore Part 2, and go from this part straight to Part 3

    QuickLinks:

    I believe that this is if you DO NOT want to access the raspberry pi but attach it to a network. (PLEASE correct me if I am wrong)

     

    Part Three:

    How to make your RPi into a Router

    Now this is the bit that confuses me...

    If I can do everything that I listed above in Part One, doesn't that already mean I am routing data?

     

    Could someone please explain the benefit of Part three to me so I can decide if I need to follow the steps involved to improve my setup.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to wallarug

    Hi,

     

    Part 3 is if you want to use the Pi to route network traffic from one network onto a Wireless network hosted on the Pi.

     

    e.g. Network 1 (10.0.0.0/24) -> Raspberry Pi -> Wifi -> Network 2 (10.0.1.0/24)

     

    Part 2 is if you want to use the Pi to extend the network

     

    e.g. Network 1 (10.0.0.0/24) -> Raspberry PI -> Wifi -> Network 1 (10.0.0.0/24)

    There is no routing involved when packets go from ethernet to wifi.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • wallarug
    wallarug over 12 years ago in reply to Former Member

    Lawrence,

    I think I replied to you on the other forum...

    http://www.raspberrypi.org/phpBB3/viewtopic.php?f=36&t=31404&p=273543#p273543

     

    Jim,

    I had a look at Pi point but it DOESN'T Come setup to go as you think...

    It's had the Pi-Point stuff stripped out, too, to provide a pretty lean setup into which you can install what you need.

    So, You need to install all the software and stuff to get it working...

     

    I used this setup here: http://sirlagz.net/2012/08/09/how-to-use-the-raspberry-pi-as-a-wireless-access-pointrouter-part-1/

     

    Which is very good.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to wallarug

    Indeed you did image

     

    I plan on packaging up RaspAP into an easy to use SD card image with a web interface.

    Would you be interested in trying it out for me ?

     

    Cheers,

    Lawrence

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • recantha
    recantha over 12 years ago in reply to Former Member

    I'd be interested in testing that for you, Lawrence.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to recantha

    Sounds good, I'm still writing up the Web interface but I'll post it up here when I finish it up image

    Getting there though, with the interface you'll be able to configure both the WiFi client details, and HostAPD as well image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to wallarug

    Fergus Byrne wrote:

     

    Jim,

    I had a look at Pi point but it DOESN'T Come setup to go as you think...

    It's had the Pi-Point stuff stripped out, too, to provide a pretty lean setup into which you can install what you need.

    So, You need to install all the software and stuff to get it working...

     

     

    That is rather disappointing and I would think somewhat counter productive that the pi Point image had all the pi-point stuff stripped out of it.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • wallarug
    wallarug over 12 years ago in reply to Former Member

    Rather counter productive you would think...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • wallarug
    wallarug over 12 years ago in reply to Former Member

    What sort of web code will you be using?

     

    Also remember that it is the Raspberry Pi that would be running the web page... nothing to fancy image

     

    The main problem I am having with a  little bash script that I am writing is the three lines on the bottom of the /etc/network/interfaces file... They have something to do with the GUI interface (which I have never used due to lllaaaaaggggg on the Raspberry Pi.).  Can anyone inform me of how to remove certain lines from files please (using bash).

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • recantha
    recantha over 12 years ago in reply to wallarug

    Try using a text editor like nano or vi. Nano is easier to use.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • wallarug
    wallarug over 12 years ago in reply to recantha

    I know how to remove them...

     

    Just how do I do it through bash script? 

     

    Right now I bring up a nano session: sudo nano /etc/interfaces/network

     

    But I am sure there is a bash way.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • wallarug
    wallarug over 12 years ago in reply to recantha

    I know how to remove them...

     

    Just how do I do it through bash script? 

     

    Right now I bring up a nano session: sudo nano /etc/interfaces/network

     

    But I am sure there is a bash way.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • mconners
    mconners over 12 years ago in reply to wallarug

    Normally the sh script way would be to make calls to sed and awk from your script and do in line editing that way.

     

    Here is an example:

    http://en.kioskea.net/faq/1451-sed-delete-one-or-more-lines-from-a-file

     

    Mike

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • mconners
    mconners over 12 years ago in reply to wallarug

    Another great example:

     

    http://quickleft.com/blog/command-line-tutorials-sed-awk

     

    Mike

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to mconners

    Here's another way, just for fun and educational value:

     

    If you happen to know for sure that a file, call it foo, is 10 lines long,

    you can get all but the last 3 lines by doing:

     

       $ head -7 foo

     

    It's usually dangerous to rely on your file always being a fixed length,

    so you can find out how long foo is by doing:

     

       $ cat foo | wc -l

     

    You can combine these into a script that gets all but the last 3 lines

    of an arbitrary sized file by doing:

     

      $ z=`cat  foo  |  wc  -l`

      $ z=`expr  $z  -  3`

      $ head  -$z  foo

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to Former Member

    I just remembered that the head command allows a negative argument to mean

    counting from the end.  So you could say simply:

     

        $ head  --lines=-3  foo

     

    to get all but the last 3 lines of file foo. 

    (note that there is a double dash in --lines.)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube