By default, OpenWRT bridges the LAN and WiFi interfaces to share the same layer 2 domain. If your WAN connection is WiFi and you want to set it up as a router (segregating two separate subnets), you'll need to sever the LAN/WiFi bridge and remove the default WiFi access point configuration before attempting to set OpenWRT up as a WiFi client.
For example, here's the default configuration from a VoCore VoCore2 (single NIC + WiFi + USB, not dissimilar to a Raspberry Pi in terms of connectivity):
root@OpenWrt:/etc/config# cat network
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fd2b:30ee:54cb::/48'
config interface 'lan'
option type 'bridge'
option ifname 'eth0.1'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
config device 'lan_eth0_1_dev'
option name 'eth0.1'
option macaddr 'b8:d8:12:67:1f:57'
config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'
config switch_vlan
option device 'switch0'
option vlan '1'
option ports '0 2 6t'
And here's the default wireless configuration:
root@OpenWrt:/etc/config# cat wireless
config wifi-device 'radio0'
option type 'mac80211'
option channel '11'
option hwmode '11g'
option path 'platform/10300000.wmac'
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'
As you can see, there's no WAN connection defined... yet.
Here's what it looks like with the bridge severed and the WiFi repurposed as a WiFi client for the WAN interface.
First, the network:
root@OpenWrt:/etc/config# cat network
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fd2b:30ee:54cb::/48'
config interface 'lan'
option ifname 'eth0.1'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
config device 'lan_eth0_1_dev'
option name 'eth0.1'
option macaddr 'b8:d8:12:67:1f:57'
config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'
config switch_vlan
option device 'switch0'
option vlan '1'
option ports '0 2 6t'
config interface 'wwan'
option proto 'dhcp'
See the removal of the "bridge" directive. Also see the new "wwan" entry at the bottom. In this instance, it's set as a DHCP client.
Next the wireless:
root@OpenWrt:/etc/config# cat wireless
config wifi-device 'radio0'
option type 'mac80211'
option channel '11'
option hwmode '11g'
option path 'platform/10300000.wmac'
option htmode 'HT20'
config wifi-iface 'wifinet0'
option ssid '<insert ssid here>'
option device 'radio0'
option mode 'sta'
option key '<insert passphrase here>'
option network 'wwan'
option encryption 'psk2'
During the creation of the WiFi client interface "wwan", it was assigned to the "wan" firewall zone, turning the device into a two-subnet router with a firewall.