2

Introduction

I am trying to use my Ubuntu Core-RaspberryPi as a Wifi Access point. Therefore, I am using hostapd and dnsmasq. I followed this tutorial in order to setup everything.

I start them manually - so all interfaces should be up and running when the services start.

HOSTAPD

My hostapd.conf file:

interface=wlan0
driver=nl80211
ssid=my_ap
hw_mode=g
channel=6
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=3
wpa_passphrase=my_password
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

I added this line to /etc/default/hostapd:

DAEMON_CONF=/etc/hostapd/hostapd.conf

DNSMASQ

I have the following dnsmasq.conf file:

interface=wlan0
dhcp-range=10.0.0.2,10.0.0.10,255.255.255.0,12h
no-hosts
addn-hosts=/etc/hosts.dnsmasq

My etc/hosts.dnsmasq file:

10.0.0.1 raspbi

My etc/network/interfaces file:

auto wlan0
iface wlan0 inet static
address 10.0.0.1
netmask 255.255.255.0

IP Address List Logs:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether b8:27:eb:46:24:90 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.68/24 brd 10.0.0.255 scope global dynamic eth0
       valid_lft 86207sec preferred_lft 86207sec
    inet6 fe80::ba27:ebff:fe46:2490/64 scope link 
       valid_lft forever preferred_lft forever
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
    link/ether b8:27:eb:13:71:c5 brd ff:ff:ff:ff:ff:ff

What I get

If I then try to start my dnsmasq by running systemctl start dnsmasq I get an error "unknown interface wlan0".

What I tried

I also tried to force start wlan0 by running sudo ifconfig up wlan0 but still get the same error message

1 Answers1

3

The Tutorial you used is not up to date as it was written in 2013 and seems to be written for normal Ubuntu not Ubuntu Core.

I never used Ubuntu Core but they seem to use systemd-networkd:

By default network management on Ubuntu Core is handled by systemd's networkd and netplan. While NetworkManager has some support to handle netplan configuration files, Ethernet support is disabled by default and has to be turned on explicitly to avoid conflicts with existing network configuration. Source

So I think you could mainly follow this tutorial.

Fiddling around with /etc/network/interfaces won't ever work in this context, I think.

jake
  • 1,347
  • 10
  • 23
  • Thanks for answering jake! I have now tried the tutorial you sent me and it looks quite okay. However, I can't see my Wifi and therefore can't connect to it. All services are up and running and I don't get any error logs. Do you have any Idea what I could do? I would comment on the tutorial but I don't have enough reputation yet... :( – linus_hologram Jul 29 '19 at 14:37
  • @linus_hologram You could try to start hostapd manually and maybe see whats wrong there, but I think you really should try @Ingo's tutorial. Could you add the ouput of systemctl status networking systemd-networkd hostapd to your question? – jake Jul 29 '19 at 20:06
  • Sorry If I was unprecise in my comment. I tried your tutorial and think that this is the right way to go. Unfortunately, although I followed each step of the tutorial, I do not see a raspberry-pi WIFI network on my iPhone. So, somehow, the wifi network is not created. Also, I do not get any error logs or something so I really don't know where the problem is.

    I did the following tutorial steps: 1) general setup; 2) Setting up a standalone access point; 3) Setting up an access point and with eth0, without routing;

    I followed every step mentioned precisely but dont see my wifi.

    – linus_hologram Jul 30 '19 at 10:56
  • Also, if you take a look at the "Troubleshooting" part of the tutorial, and then reference to the "wifi" section, you will find a command sudo iw dev wlan0 info which should return some information about the interface, especially type AP. If I run this command, I don't get type AP but 'managed'. Do you have any idea where I messed up or what the reason for the different type is? – linus_hologram Jul 30 '19 at 11:01
  • Hi, I just read about your problems. Now we are mixing up two questions. This one you used old style networking but current discussing my tutorial using systemd-networkd. To not get confused it would be better you open a short new question, something like "I followed this tutorial but have this problem ...". Then I will look if I can make an answer. – Ingo Jul 30 '19 at 11:13
  • @Ingo thanks for you interest in helping me. I am now using ubuntu server on my raspberry pi and am still trying to setup a wifi access point. https://askubuntu.com/q/1170261/977546 would you mind taking a look at it? Thanks in advance. – linus_hologram Sep 02 '19 at 12:47
  • @linus_hologram Sorry, but I don't have any experience with Ubuntu on Raspberry Pi. – Ingo Sep 02 '19 at 15:43