mattlongman / Hassio-Access-Point

Hass.io addon to let you create a WiFi access point, perfect for using WiFi devices on off-grid installations.
MIT License
91 stars 64 forks source link

Parent DHCP, not getting an IP #26

Open discrockers opened 2 years ago

discrockers commented 2 years ago

Hello,

I am a newbie with Home Assistant. I just discovered it and already lovin it! :slight_smile: I installed the Hass.io Access Point on a Raspberry 4 and would like to use it in “bridge mode” like I did with RaspAp before. I can setup the WiFi and it is available, but when I try to connect my iPhone it couldn’t get an IP address. As soon as I activate the DHCP it works.

What I am doing wrong. I tought deactiveate the DHCP the DHCP server inside my network is used to get the IPs for the connected Accesspoint devices. I am using a FritzBox 4970 and eBlocker as DHCP server to filter ads and unwanted stuff.

ssid: ssid
wpa_passphrase: '123456789'
channel: '6'
address: 192.168.99.1
netmask: 255.255.255.0
broadcast: 192.168.99.255
interface: wlan0
hide_ssid: '0'
dhcp: '0'
dhcp_start_addr: 192.168.99.10
dhcp_end_addr: 192.168.99.20
allow_mac_addresses: []
deny_mac_addresses: []
debug: 0
hostapd_config_override: []
client_internet_access: '1'
client_dns_override:
  - IP of my local Network eBlocker

Any Idea would be helpful. Thank you Kind regards D-Rock

askmurphy commented 2 years ago

I have the same problem. I can connect if i use a manually ip. Dhcp is not working..

askmurphy commented 2 years ago

Ps: tested with rpi3 and HA64bits

askmurphy commented 2 years ago

To enable Dhcp you must use this according the manual:

dhcp: '1’

But doesn’t work too..

aladin2000 commented 1 year ago

same for me

aladin2000 commented 1 year ago

same for me

mattlongman commented 1 year ago

DHCP on the addon creates its own DHCP server. Without this, you would need to manually set an IP that works with the parent network's address range. Because the addon is downstream from your main network, enabling a DHCP on the Pi/device is fine, but just make sure the address you set for the addon address/dhcp range is different to the main network address/range.

askmurphy commented 1 year ago

Correct, but it doesn’t work.. Try it yourself..

aladin2000 commented 1 year ago

Thks Ok for DHCP range to bé compatible for network segment But it is not possible to get internet Access even with thé option Is there spécial route to cteate on local and on parent routeur to bé able to get that internet Access I use SFR box v8 as Cisco routeur

Regards Aladin

28 oct. 2022 21:44:19 mattlongman @.***>:

DHCP on the addon creates its own DHCP server. Without this, you would need to manually set an IP that works with the parent network's address range. Because the addon is downstream from your main network, enabling a DHCP on the Pi/device is fine, but just make sure the address you set for the addon address/dhcp range is different to the main network address/range.

— Reply to this email directly, view it on GitHub[https://github.com/mattlongman/Hassio-Access-Point/issues/26#issuecomment-1295394436], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AD7K4I6XWBBHOLVWQNQRWPTWFQUJFANCNFSM5QMEM3JA]. You are receiving this because you commented.[Image de pistage][https://github.com/notifications/beacon/AD7K4IY3U5HSVHKDJPBUCSTWFQUJFA5CNFSM5QMEM3JKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOJU3CNBA.gif]

mattlongman commented 1 year ago

@askmurphy @aladin2000 Good point (sorry, I haven't used this for ages so was trying to remember how I set it up).

client_internet_access: '1' & dhcp: '0' - then set the client IP address to the child network (on the same range as the RPI, i.e. 192.168.99.10), not the parent network. Just tested on the latest version of HAOS (64bit on rpi4), Home Assistant & the addon - working fine.

If you're still having issues, set debug to 1 and paste the logs, along with the versions/hardware etc. Thanks

Zakarumit commented 1 year ago

Hello, I think I might have similar problem. Running newest HA OS on dedicated Intel NUC. The computer is connected to local network via its ethernet adapter and running on IP 192.168.0.167. I have installed the addon and would like to create wifi coverage this way in my house (phones etc - internet access). I can connect to the wifi, but I cannot access internet. Here is the log:

s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service legacy-services: starting s6-rc: info: service legacy-services successfully started Starting Hass.io Access Point Addon

Setup interface:

Add to /etc/network/interfaces: iface wlp0s20f3 inet static Run command: nmcli dev set wlp0s20f3 managed no Run command: ip link set wlp0s20f3 down Add to /etc/network/interfaces: address 192.168.99.1 Add to /etc/network/interfaces: netmask 255.255.255.0 Add to /etc/network/interfaces: broadcast 192.168.99.255 Run command: ip link set wlp0s20f3 up

Setup hostapd:

Add to hostapd.conf: ssid=Wifi HA Add to hostapd.conf: wpa_passphrase=**** Add to hostapd.conf: channel=6 Add to hostapd.conf: ignore_broadcast_ssid=0 Add to hostapd.conf: macaddr_acl=0 Add to hostapd.conf: interface=wlp0s20f3

DHCP not enabled. Skipping dnsmasq

Starting hostapd daemon

rfkill: Cannot open RFKILL control device wlp0s20f3: interface state UNINITIALIZED->ENABLED wlp0s20f3: AP-ENABLED wlp0s20f3: STA 7c:03:ab:e9:8c:2f IEEE 802.11: authenticated wlp0s20f3: STA 7c:03:ab:e9:8c:2f IEEE 802.11: associated (aid 1) wlp0s20f3: AP-STA-CONNECTED 7c:03:ab:e9:8c:2f wlp0s20f3: STA 7c:03:ab:e9:8c:2f RADIUS: starting accounting session 2CD3868FAA2AD46C wlp0s20f3: STA 7c:03:ab:e9:8c:2f WPA: pairwise key handshake completed (RSN) wlp0s20f3: EAPOL-4WAY-HS-COMPLETED 7c:03:ab:e9:8c:2f wlp0s20f3: AP-STA-DISCONNECTED 7c:03:ab:e9:8c:2f

I think I might be having problems understanding what should I enter into the "address" field in configuration. Can you please advice? Thank you very much

EDIT: I have tried entering the address of the Intel NUC HA is running on (192.168.0.167) and also a random free IP from my network (192.168.0.111) - both led to losing access to the HA web interface, so probably wrong ideas...