My task: Configure and run Access Point (AP) on the tablet (x86) with Linux mint with access from devices connected to the created AP.
All the scripts are provided for the physical WiFi interface wlp1s0
I created the virtual interface with the name wlp1s0_ap
/lib/systemd/system/wireless-device@.service
[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
Then run
systemctl enable wireless-device@wlp1s0_ap.service
Reboot the PC
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
hostapd
I called the AP as EVT
with password ******
. More details are below.
hostapd
sudo apt install hostapd
sudo nano /etc/default/hostapd
DAEMON_CONF="/etc/hostapd/hostapd.conf"
sudo nano /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
sudo systemctl start hostapd
Fro the DHCP server isc-dhcp-server
is selected.
sudo apt install isc-dhcp-server
sudo nano /etc/dhcp/dhcpd.conf
, (below is the current variant):# 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
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
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
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:
hostapd + DHCP
are running?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