Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
All the setup files looked ok, but when I run "$ sudo /usr/sbin/hostapd /etc/hostapd/hostapd.conf" I got the following error:
Configuration file: /etc/hostapd/hostapd.conf
Could not set interface wlan0 flags (UP): No such file or directory
nl80211: Could not set interface 'wlan0' UP
nl80211 driver initialization failed.
hostapd_free_hapd_data: Interface wlan0 wasn't started
I later realised that the address appears to be updating when I ran "$ sudo ifconfig wlan0 192.168.42.1" I also get the message: "SIOCSIFFLAGS: No such file or directory"
I'm relatively new to this so what does it mean?
Have I missed something obvious here?
Any help on where I may be going wrong would be appreciated.
When I first ran "sudo ifup wlan0" I got the message "RTNETLINK answers: No such file or directory"
What "file or directory" is it looking for exactly, wlan0?
Then it changed to: RTNETLINK answers: File exists Failed to bring up wlan0.
I think I'll just wipe the SD card and try again with a fresh Raspian install, and maybe just follow this tutorial step-by-step and see what happens!
I didn't realize the Belkin Stick I was using could have more than one type of firmware, so had to add another firmware driver.
my /etc/hostapd/hostapd.conf file is setup as follows (and is running):
interface=wlan0
driver=nl80211
ssid=OnionPi
hw_mode=g
channel=1
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=onionberry
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
After some more tweaking I got this working by running it from the command prompt e.g. "/usr/sbin/hostapd /etc/hostapd/hostapd.conf"
It also works if I run this as a background process. But it doesn't seem to run automatically on startup. The router setup is also working with TOR through the PI, and that all seems fine when the connection is actually running!
After testing I assumed the only extra commands needed to set this up automatically would be :
service hostapd start
service isc-dhcp-server start
update-rc.d hostapd enable
update-rc.d isc-dhcp-server enable
My /etc/network/interfaces file is set to:
source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.42.1
netmask 255.255.255.0
up iptables-restore < /etc/iptables.ipv4.nat
Am I missing something? I've been going through the RASPBERRY PI USERS GUIDE book to try and figure this out, if anyone knows of a better reference for the PI, feel free to let me know.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.