Closed autarkper closed 2 years ago
It looks like this could be achieved by tweaking the settings in dnsmasq.conf.
I have got it more or less working by adding the following directly to /etc/dnsmasq.conf
:
domain-needed
bogus-priv
addn-hosts=/etc/dnsmasq_static_hosts.conf
local=/mydomain.example/
domain=mydomain.example
expand-hosts
The "mydomain.example" stuff is a dirty hack to make it work with the ping command:
$ ping berber
PING berber.mydomain.example (10.0.1.63) 56(84) bytes of data.
64 bytes from berber.mydomain.example (10.0.1.63): icmp_seq=1 ttl=64 time=184 ms
I have discovered a problem: the router still seems to be involved in DHCP, as hinted by the output of dhclient
$ sudo dhclient -v -r
[sudo] password for pang:
Internet Systems Consortium DHCP Client 4.3.5
Copyright 2004-2016 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Listening on LPF/wwp0s20u4i6/36:bd:ad:0b:04:4d
Sending on LPF/wwp0s20u4i6/36:bd:ad:0b:04:4d
Listening on LPF/wlan0/e0:9d:31:0d:1c:a8
Sending on LPF/wlan0/e0:9d:31:0d:1c:a8
Listening on LPF/eth0/3c:97:0e:e8:38:6d
Sending on LPF/eth0/3c:97:0e:e8:38:6d
Sending on Socket/fallback
DHCPRELEASE on wlan0 to 192.168.1.1 port 67 (xid=0x444e5d05)
I had expected 10.0.1.1 instead of 192.168.1.1 on the last line
I don't know whether this is due to my changes.
Hi @autarkper I was not able to reproduce your scenario.
I've tested a setup like this:
eth0, wlan0, wlan1
(and "loopback" ), when wlan0
is the onboard interface and wlan1
is an external usb deviceeth0
( so I can ssh to it as I'm using headless setup)10.0.0.79
and executing ansible playbook like this:
ansible-playbook -u pi --ask-pass \
-i "10.0.0.79," \
ansible/setup_repeater.yaml \
-e ap_ssid_name="PI_TEST_NET" \
-e ap_ssid_pass="nalkinscloud" \
-e ssid_name="MY_HOME_WLAN_SSID" \
-e ssid_pass="MY_HOME_WLAN_PASSOWRD"
PI_TEST_NET
associated to the wlan0
interfaceMY_HOME_WLAN_SSID
network associated to the wlan1
interfacePI_TEST_NET
10.0.1.X
hostname.domain
(that resolves to an ip that is some where in the 10.0.0.X
network) successfully executesHi @ArieLevs,
Are you saying that you cannot recreate my initial scenario? My problems might be due to my router having been set up to serve my devices specific addresses in the 192.168.1.x range. If you don't have that setup this could perhaps work out of the box. With my changes to dnsmasq.conf I am now more or less satisfied. I even got the dhclient issue sorted, somehow.
Since the repeater acts as a DHCP server it would be great if it could serve as a simple name server, to provide the addresses of the attached devices by name, only forwarding requests it cannot handle upstream to the router.
Scenario: 1) Device "barbara" is assigned IP address 10.0.1.36. 2) Device "berber" is assigned IP address 10.0.1.63. The router is configured to assign berber address 192.168.1.199. 3) User on device "barbara" tries to ping device "berber"
Current behavior:
Desired behavior: