ipportdhcpaccess-pointhostapd

How to get access (`ip` and `port` configuration) to the tablet running Linuxmint with `hostapd + DHCP`


My task: Configure and run Access Point (AP) on the tablet (x86) with Linux mint with access from devices connected to the created AP.

Background as additional information (but this is not the topic of question, real question at the end of description):

I have done the next parts:


1. Created the Virtual WiFi interface

All the scripts are provided for the physical WiFi interface wlp1s0

I created the virtual interface with the name wlp1s0_ap

[Unit]
Description=Create virtual wireless interface
Requires=sys-subsystem-net-devices-wlp1s0.device
#After=network.target
After=sys-subsystem-net-devices-wlp1s0.device
[Service]
Type=oneshot
#ExecStart=/usr/sbin/iw dev wlp1s0 interface add %I type __ap  addr "00:0c:e3:6f:78:ee"
ExecStart=/usr/sbin/iw dev wlp1s0 interface add %I type managed addr "00:0c:e3:6f:78:ee"
#ExecStart=/usr/bin/iw dev wlan0 interface add wlp1s0_ap type __ap addr "00:0c:e3:6f:78:ee"
[Install]
WantedBy=multi-user.target

2. Added the new virtual interface into ignored ones for the NetworkManager

edit:

sudo nano /etc/NetworkManager/NetworkManager.conf

by adding wlp1s0_ap created interface into unmanaged-devices section (NB! append to existing ones)

[keyfile]
unmanaged-devices=interface-name:wlp1s0_ap

run

sudo nmcli general reload

3. Configured hostapd

I called the AP as EVT with password ******. More details are below.

DAEMON_CONF="/etc/hostapd/hostapd.conf"
interface=wlp1s0_ap
driver=nl80211
country_code=EE

ssid=EVT
wpa_passphrase=****

hw_mode=g
channel=10

wpa=2
wpa_key_mgmt=WPA-PSK

wpa_pairwise=TKIP
rsn_pairwise=CCMP
auth_algs=1
macaddr_acl=0
ieee80211n=1

4. Configured DHCP server

Fro the DHCP server isc-dhcp-server is selected.

isc-dhcp-server configuration

# dhcpd.conf

#INTERFACES="wlp1s0_ap"

option domain-name "etv.org";
option domain-name-servers 192.168.1.2, 192.168.1.3;

default-lease-time 86400;
max-lease-time 604800;

ddns-update-style none;

authoritative;

subnet 192.168.1.0 netmask 255.255.255.0 {
        interface wlp1s0_ap;
        ## dhcp start  and end IP range ##
        range 192.168.1.100 192.168.1.200;
        option subnet-mask 255.255.255.0;     ## subnet
        option broadcast-address 192.168.1.255; ## broadcast
        option routers 192.168.1.254; ## router IP
}

The daemon is started as

service isc-dhcp-server start


5. Assigned static IP address for the created virtual interface

I modified the file to assign the IP 192.168.1.111 to the interface wlp1s0_ap:

sudo nano /etc/network/interfaces

the content of the /etc/network/interfaces file is

auto lo
iface lo inet loopback

auto wlp1s0_ap
iface wlp1s0_ap inet static
  address 192.168.1.111
  netmask 255.255.255.0
  gateway 192.168.1.0
  broadcast 192.168.1.255
  dns-nameservers 192.168.1.2,192.168.1.3

The parts described above are working and I can connect to the AP.

ifconfig listing:

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 1386  bytes 149889 (149.8 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1386  bytes 149889 (149.8 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp1s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.20.92.22  netmask 255.255.255.0  broadcast 172.20.92.255
        inet6 fe80::9ea9:58d3:aa31:b7e9  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:e3:6f:78:ed  txqueuelen 1000  (Ethernet)
        RX packets 1111808  bytes 125498550 (125.4 MB)
        RX errors 0  dropped 7507  overruns 0  frame 0
        TX packets 23673  bytes 3070974 (3.0 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp1s0_ap: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.111  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::20c:e3ff:fe6f:78ee  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:e3:6f:78:ee  txqueuelen 1000  (Ethernet)
        RX packets 808  bytes 124999 (124.9 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 893  bytes 155057 (155.0 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Problem:

However I cannot communicate with this Tablet

For example, ping to the assigned IP ping 192.168.1.111 gives the next response:

PING 192.168.1.111 (192.168.1.111) 56(84) bytes of data.
From 192.168.1.101 icmp_seq=1 Destination Host Unreachable
From 192.168.1.101 icmp_seq=2 Destination Host Unreachable
From 192.168.1.101 icmp_seq=3 Destination Host Unreachable
From 192.168.1.101 icmp_seq=4 Destination Host Unreachable
^C
--- 192.168.1.111 ping statistics ---
5 packets transmitted, 0 received, +4 errors, 100% packet loss, time 4065ms

telnet output:

~$ telnet 192.168.1.111
Trying 192.168.1.111...
telnet: Unable to connect to remote host: No route to host

The questions:

  1. What I missed?
  2. How to configure the access to the Tablet on which hostapd + DHCP are running?

Solution

  • Your Static IP (.111) is within "DHCP Range" (.100-.200), so I assume you might have an IP conflict there.

    Try to use the .93 IP as Static and ensure there's no other static entry with .93