I'm trying to move the wifi interface from LAN to WAN (not as a client---still as an access point). I.e. I want to be able to have a device connect to the wifi, and have that device receive an IP from the DHCP server on the WAN (the same DHCP server that gives the router its IP)
If I move the wifi to the WAN, then when a device connects to the wifi, it's unable to obtain an IP (it gets a 169.254.* address).
Below is the contents of /etc/config/wireless (radio1 is the one I'm trying to configure to be on the WAN)
root@LittleHouse:~# cat /etc/config/wireless
config wifi-device 'radio0'
option type 'mac80211'
option path 'platform/soc/a000000.wifi'
option channel '1'
option band '2g'
option htmode 'HT20'
option disabled '1'
config wifi-iface 'default_radio0'
option device 'radio0'
option network 'lan'
option mode 'ap'
option ssid 'OpenWrt'
option encryption 'none'
config wifi-device 'radio1'
option type 'mac80211'
option path 'platform/soc/a800000.wifi'
option channel '36'
option band '5g'
option htmode 'VHT80'
option cell_density '0'
config wifi-iface 'default_radio1'
option device 'radio1'
option mode 'ap'
option ssid '[redacted]'
option encryption 'sae-mixed'
option key '[redacted]'
option network 'wan wan6'
1 Like
Remove all the networks of target adapter. Click scan, join the desired network, and create a new interface for it (wwan as a suggestion), assigning to "wan" firewall zone, save and apply.
LK
Thanks, but I'm trying to move the WIFI to the WAN as an access point, not trying to join an existing wifi network as a client.
Usually to make an access point I would just plug the Ethernet cable into the LAN side to put the wifi on the existing (host) wired network, but this time I want to keep the LAN side as a separate wired subnet with its own DHCP server hosted by the router, so I'm trying just to move the router's WIFI to the WAN. When I do this, devices joining the access point are not getting DHCP assigned IPs from the host wired network though.
If I understand correctly your moving the WIFI interface to the WAN interface on an OpenWRT router.
What is connected to the OpenWRT router's physical WAN port? Your ISP router?
Wired WAN interface is connected to another router's LAN (not ISP) so if the WIFI is on the WAN as an access point, devices on the WIFI should be able to get IPs via DHCP.
You haven't shown your /etc/config/network, but I guess your wan interface is a single ethernet port and not a bridge and hostapd can't bridge it to wireless interface. You have to create new bridge device, add wan port to it and set wan and wan6 interfaces to use that bridge. Then it should work as you want.
2 Likes
Here's my /etc/config/network file (below). eth0 and eth1 are swapped over ( from [Solved] How to swap LAN switch to WAN ) so there are two physical WAN ports.
root@LittleHouse:~# cat /etc/config/network
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fd67:9f27:7058::/48'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth1'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
config interface 'wan'
option device 'eth0'
option proto 'dhcp'
option type 'bridge'
config interface 'wan6'
option device 'eth0'
option proto 'dhcpv6'
option type 'bridge'
config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'
config switch_vlan
option device 'switch0'
option vlan '1'
option ports '3 4 0'
You need to add bridge device for wan
config device
option name 'br-wan'
option type 'bridge'
list ports 'eth0'
then change
option device 'eth0'
to
option device 'br-wan'
for both wan and wan6 interfaces and remove
option type 'bridge'
from them.
2 Likes
additionally, adjust the interface from "lan" to "wan" in the WIFI configuration.
Sorry, was damn sleepy, confused things.
I'm not sure if you want to do another NAT layer or WDS (bridge, preffered). For WDS, please reffer to [https://openwrt.org/docs/guide-user/network/wifi/atheroswds ] and earlier m8s posts.
LK
I tried, but lost wan connection.
/etc/config/network:
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fd67:9f27:7058::/48'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth1'
config device
option name 'br-wan'
option type 'bridge'
list ports 'eth0'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
config interface 'wan'
option device 'br-wan'
option proto 'dhcp'
option type 'bridge'
config interface 'wan6'
option device 'br-wan'
option proto 'dhcpv6'
option type 'bridge'
config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'
config switch_vlan
option device 'switch0'
option vlan '1'
option ports '3 4 0'
output of ifconfig (note, all the HWaddr values are the same as eth1, and the HWaddr of eth0 has gone)
root@LittleHouse:/etc/config# ifconfig
br-lan Link encap:Ethernet HWaddr [redacted]8E:1A
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: [redacted] Scope:Global
inet6 addr: [redacted] Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5974 errors:0 dropped:0 overruns:0 frame:0
TX packets:5161 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:629483 (614.7 KiB) TX bytes:2623433 (2.5 MiB)
br-wan Link encap:Ethernet HWaddr [redacted]8E:1A
inet6 addr: [redacted] Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:253 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:82132 (80.2 KiB)
eth1 Link encap:Ethernet HWaddr [redacted]8E:1A
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6055 errors:0 dropped:0 overruns:0 frame:0
TX packets:5159 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:726597 (709.5 KiB) TX bytes:2623235 (2.5 MiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:1016 errors:0 dropped:0 overruns:0 frame:0
TX packets:1016 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:83508 (81.5 KiB) TX bytes:83508 (81.5 KiB)
wlan1 Link encap:Ethernet HWaddr [redacted]:8E:1A
inet6 addr: [redacted] Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:260 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:87558 (85.5 KiB)
mk24
February 10, 2023, 4:14pm
12
That looks like it should work, though clearly it did not as br-wan has no IPv4 or non-local IPv6 address assigned.
You may need to change the wan6 device to @wan
. If the ISP does not support IPv6, remove wan6 section entirely.
Looks like eth0 is down. Run
ifconfig eth0
Does it show eth0?
root@LittleHouse:~# ifconfig eth0
eth0 Link encap:Ethernet HWaddr [redacted]:8E:19
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:264 errors:0 dropped:1 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:70928 (69.2 KiB) TX bytes:2602 (2.5 KiB)
if I bring eth0 up (with ifconfig eth0 up), it still doesn't get an IP on the wan.
Try to add eth0 device
config device
option name 'eth0'
option macaddr 'ma:c:a:dd:re:ss'
Adding eth0 with 'config device...[etc]' in config/network didn't make a difference (eth0 didn't come up, and still no IP on wan if I do 'ifconfig eth0 up')
mk24
February 10, 2023, 5:35pm
18
Take the option type bridge
line out of the wan definition. option type bridge inside a config interface
is no longer allowed.
Taking the "option type 'bridge'
" lines out of config interface
worked!
Thanks for all the help!
Below is the working config:
root@LittleHouse:~# cat /etc/config/network
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fd67:9f27:7058::/48'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth1'
config device
option name 'br-wan'
option type 'bridge'
list ports 'eth0'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
config interface 'wan'
option device 'br-wan'
option proto 'dhcp'
# option type 'bridge'
config interface 'wan6'
option device 'br-wan'
option proto 'dhcpv6'
# option type 'bridge'
config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'
config switch_vlan
option device 'switch0'
option vlan '1'
option ports '3 4 0'
root@LittleHouse:/etc/config# cat wireless
config wifi-device 'radio0'
option type 'mac80211'
option path 'platform/soc/a000000.wifi'
option channel '1'
option band '2g'
option htmode 'HT20'
option disabled '1'
config wifi-iface 'default_radio0'
option device 'radio0'
option network 'lan'
option mode 'ap'
option ssid 'OpenWrt'
option encryption 'none'
config wifi-device 'radio1'
option type 'mac80211'
option path 'platform/soc/a800000.wifi'
option channel '36'
option band '5g'
option htmode 'VHT80'
option cell_density '0'
config wifi-iface 'default_radio1'
option device 'radio1'
option mode 'ap'
option ssid '[redacted]'
option encryption 'sae-mixed'
option key '[redacted]'
option network 'wan wan6'
1 Like
@rincewind I see now that you said that before, but I missed it!