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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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
Code Exchange
  • Technologies
  • More
Code Exchange
Forum PI3 wlan0 access point without internet and predefined 192.168.XXX.XXX IP and eth0 with DHCP
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Code Exchange to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 9 replies
  • Subscribers 48 subscribers
  • Views 2530 views
  • Users 0 members are here
  • tcpip
  • rpi
  • access_point
Related

PI3 wlan0 access point without internet and predefined 192.168.XXX.XXX IP and eth0 with DHCP

ataf
ataf over 7 years ago

Good Day,

 

 

I try to create wlan0 AP (access point) without internet which allows to open tcpip socket connection to my process running on the rpi3 (just for some packages exchange with client application connecting to the AP with predefined 192.168.XXX.XXX IP adress and port), at the same time I need eth0 internet connection with DHCP.

 

 

Apparently, I get pretty close result configuring /etc/hostapd/hostapd.conf

[code]

interface=wlan0

driver=nl80211

ssid=MY_AP_SSID

hw_mode=g

channel=6

macaddr_acl=0

auth_algs=1

ignore_broadcast_ssid=MY_AP_SSID

wpa=0

wpa_passphrase=passphrase

wpa_key_mgmt=WPA-PSK

wpa_pairwise=TKIP

rsn_pairwise=CCMP

[/code]

and after that running

[code]

/etc/init.d/hostapd stop

ifdown wlan0

ifup wlan0

/etc/init.d/hostapd restart

[/code]

and I can connect socket and communicate with the rpi3 from my PC but I get "dynamic" IP 169.254.XX.XX. The IP is the same every time but it doesn't look like the constant one.

 

 

The question is: [b]how to configure static 192.168.XXX.XXX IP for the AP?[/b]

 

 

As soon as I try to do it with /etc/dhcpcd.conf addition like

[code]

nodhcp

static interface wlan0

static ip_address=192.168.111.111

[/code]

I can see the correct wlan0 IP in the 'ifconfig' and 'ip -4 addr show' output and I can  'ping 192.168.111.111' successfully on the rpi3 but I get 'destination unreachable' if I ping the IP from my PC connected to the AP.

 

 

I use  RPI3 (model B) with 'raspbian jessie lite', 'uname -a' output is

[code]

Linux raspberrypi 4.9.59-v7+ #1047 SMP Sun Oct 29 12:19:23 GMT 2017 armv71 GNU/Linux

[/code]

 

 

Any comment, thoughts, ideas are welcome image

  • Sign in to reply
  • Cancel
Parents
  • gecoz
    0 gecoz over 7 years ago

    Hi Alex,

    I don't know if you have already read this tutorial, but I think you might find it useful in solving your problem.

    Fabio.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • gecoz
    0 gecoz over 7 years ago

    Hi Alex,

    I don't know if you have already read this tutorial, but I think you might find it useful in solving your problem.

    Fabio.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • ataf
    0 ataf over 7 years ago in reply to gecoz

    Hi Fabio,

     

    Thanks for that.
    I've seen the tutorial and the /etc/dhcpcd.conf configuration seems to work for me but I don't succeed to ping the static ip from my PC. I can ping it inside the raspberry but it's not 'visible' from PC connecting to the AP.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • 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