RP4 as wifi bridge

August 6, 2024, 13:30

pixpaw

I want to use my RP4 as a access point / bridge, meaning i have the Pi connected via LAN to my switch (unmanaged), the Pi should have a static ip (e.g. 192.168.85.4), clients should be able to connect to the wifi of the pi and get a IP from my local DHCP server via LAN (not from the Pi). Everything should be all one network 192.168.85.0/24 with traffic being able to go in both directions (basiaclly removing the Access Point Part of my router). I already tried a lot the past 48 hours but im lost and i cant get it to work (even it should not be that hard i guess). Anyone can guide me through a config? Im using raspi os lite

pixpaw

Well, this is using the Pi as DHCP which i dont want

oops.se

Don't do that part then!

pixpaw

so just leave the dhcpcd.conf empty? i just saw the guide enables wifi from the raspi-config, that could have been a big issue, because my wifi gor shut down by rfkill before ill give it a try, just reformatted again to have everything clean

jannik44

setup RaspAP

pixpaw

using raspAP gave me even more trouble. Using network manager gave me the best results so far

pixpaw

so the best method i found so far: - reimage the raspi with current os - update it - raspi config -> set wifi country to germany to disable rfkill - sudo nmcli con add con-name hotspot ifname wlan0 type wifi ssid "Wifi-Name" - sudo nmcli con modify hotspot wifi-sec.key-mgmt wpa-psk - sudo nmcli con modify hotspot wifi-sec.psk "Wifi-PW" - sudo nmcli con modify hotspot 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared rebooted and could connect successfully. - sudo nmtui to change the ip of the wired connection to a static ip. ip a: 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 noprefixroute valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether dc:a6:32:15:c9:7f brd ff:ff:ff:ff:ff:ff inet 192.168.85.3/24 brd 192.168.85.255 scope global noprefixroute eth0 valid_lft forever preferred_lft forever inet6 fe80::7ee8:9477:8c11:6f76/64 scope link noprefixroute valid_lft forever preferred_lft forever 3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether dc:a6:32:15:c9:80 brd ff:ff:ff:ff:ff:ff inet 10.42.0.1/24 brd 10.42.0.255 scope global noprefixroute wlan0 valid_lft forever preferred_lft forever inet6 fd34:76df:1dad:d0ed:6a97:97a0:e31c:901b/64 scope global dynamic noprefixroute valid_lft 1750sec preferred_lft 1750sec inet6 fe80::6d88:421a:707a:aee9/64 scope link noprefixroute valid_lft forever preferred_lft forever The wifi address subnet is 10.42.0.0/24 but id like it to be 192.168.85.0/24 Also the routing works as expected for a hotspot, so i can not ping the wifi clients from the LAN

pixpaw

Issues: - PI serves as DHCP Server for wireless. This should be done by my local DHCP Server. - Routing only works from wireless to lan, not from lan to wireless

pixpaw

there is no specific part that i can leave out for this case