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

linus_hologram
  • 167
  • 1
  • 6

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,367
  • 1
  • 11
  • 23