My Opensuse 13.2 Xfce system is connected to the internet with ethernet, and has a Wifi netcard, from which I want to create a hotspot for my mobile devices. Sadly it seems that Xfce is rather feature lacking, so I’ve tried going through config files and scrips with the help of this guide: https://nims11.wordpress.com/2012/04/27/hostapd-the-linux-way-to-create-virtual-wifi-access-point/
(not mentioned in the guide: I had to make a rule for NetworkManager not to touch my Wifi card, for the nl80211 driver to be able to load)
I use the dnsmasq route in the guide, as it can’t find the “dhcpd” command even though I have dhcp installed, along with a bunch of other errors. It says dnsmasq is better anyways.
None of my devices get an IP address after connecting to my hotspot, however. Also, once I have started the hotspot, my computer loses all internet connectivity, seemingly because of DNS problems.
I might have made a mistake, in that my /etc/dnsmasq.conf file now only contains the content of the guide, while it says the content should be appended to the existing file. I don’t remember deleting anything from it, though.
I’m not really sure what to do. If I go into Network Manager and set my Ethernet’s IPv4 Method to “Share to other computers”, I lose internet. I can create a new wireless network that I set to Ad-Hoc, but it doesn’t… turn on. I have set that to “Share to other computers” as well. And worse, the only security available is WEP.
Well, your wireless card is not in AP mode, so you need to review your configuration and maybe share here if necessary. Also, confirm that hostapd is running.
But I’m able to create a hotspot with the script form the page I linked to in my first post, doesn’t that put it into AP mode…? I think the issue is with DHCP. All my config files are taken directly from that page, the only things I have changed is the names of my adaptors, SSID, password, and that I only want WPA-PSK2.
Your ‘iwconfig’ output shows that the device is still in ‘managed’ mode. You need to investigate further to find out why that is.
In an effort to help, I’ve just configured a wireless hotspot using NM. Once I had done that and activated my ‘hotspot’ connection, I get the following reported
# iwconfig
ens1 no wireless extensions.
lo no wireless extensions.
wlan0 IEEE 802.11bg Mode:Master Tx-Power=20 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Power Management:off
and I quickly tested that connection with my iPhone and was able to connect and reach the internet.
My working routing table now looks like
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.90.1 0.0.0.0 UG 0 0 0 ens1
10.42.0.0 0.0.0.0 255.255.255.0 U 9 0 0 wlan0
192.168.90.0 0.0.0.0 255.255.255.0 U 1 0 0 ens1
Well, if you’re using hostapd (check that it is running) and the configuration is ok, the wireless card should be in master mode and available for other devices to connect to.
The configuration guide (you were using) describes how to test using a minimal configuration:
CONFIGURING HOSTAPD
The /etc/hostapd/hostapd.conf is the main configuration which you need to deal with in order to set
up a SoftAP.
This is the minimal configuration setting which will let you test if hostapd is working. Create a
file ~/hostapd-test.conf
with the following content:
#change wlan0 to your wireless device
interface=wlan0
driver=nl80211
ssid=test
channel=1
start hostapd by
sudo hostapd ~/hostapd-test.conf
Use a wifi device to check if the access point is being detected. You won’t be able to connect to it
at present.
Once hostapd is working fine, its time to configure hostapd with more options.
Yes, devices detect and can connect to the access point. They are then stuck at waiting for an IP address.
Yes, dnsmasq is running.
ip route:
default via 10.62.68.1 dev enp2s0 proto static metric 1024 10.0.0.0/24 dev wlp3s7 proto kernel scope link src 10.0.0.1
10.62.68.0/24 dev enp2s0 proto kernel scope link src 10.62.68.250
80.71.128.56 via 10.62.68.1 dev enp2s0 proto dhcp metric 1
iptables:
-P INPUT DROP-P FORWARD DROP
-P OUTPUT ACCEPT
-A FORWARD -i wlp3s7 -j ACCEPT
wlp3s7 is the name of the wireless adapter, enp2s0 is the ethernet
I still don’t know how to activate the hotspot I create with Network Manager. It just sits there.
The default route is not correct and it should be pointing at your router. Here’s mine for reference
default via 192.168.90.1 dev ens1 proto static
10.42.0.0/24 dev wlan0 proto kernel scope link src 10.42.0.1 metric 9
192.168.90.0/24 dev ens1 proto kernel scope link src 192.168.90.250 metric 1
I think you’ve configured dnsmasq incorrectly, and it’s binding to the wrong interface. That would explain why your devices don’t get a DHCP lease.
I have made some progress. I had to right-click the icon in the task bar, and tick off “Enable Wi-fi”. Now I was able to use it to create my Wi-fi. My devices can’t see it though, and it still only supports WEP encryption. It just looks like the computer connects to it’s own Wi-fi. I have set the mode to Ad-hoc. If I set the mode to Infrastructure, it supports WPA-PSK2, but then it disappears from the list of Wi-fi networks I could create.
I also tried setting it to no security at all, it still doesn’t show up on my devices.
At the top in the right-click menu, it says that Ethernet is disconnected, even though that is what’s providing internet…
nmcli d after creating the Wi-fi:
DEVICE TYPE STATE CONNECTION enp2s0 ethernet connected Wired connection 1
wlp3s7 wifi connected ComeWithMe!!
lo loopback unmanaged --
nm is unknown:
nmcli nmError: Object 'nm' is unknown, try 'nmcli help'.