(AP Router) Internet in Wireless and not in LAN port

Hi,

I installed OpenWRT in my router and my objective is to set the router as Wired AP. The router receives internet from the main router through cable in wan port. DHCP is disable.

For some reason when I connect through wireless I have internet but when I connect through wire in LAN port I don't have.

Network config: 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 'fd63:575b:c335::/48'

 config interface 'lan'
         option type 'bridge'
         option proto 'static'
         option ipaddr '192.168.1.2'
         option netmask '255.255.255.0'
         option gateway '192.168.1.1'
         option dns '192.168.1.200'
         option ifname 'eth0 eth0.1 eth0.2'

 config device 'lan_dev'
         option name 'eth0.1'
         option macaddr '50:64:2b:18:86:c8'

 config interface 'wan'
         option proto 'dhcp'
         option ifname 'eth0.2'

 config switch
         option name 'switch0'
         option reset '1'
         option enable_vlan '1'

 config switch_vlan
         option device 'switch0'
         option vlan '1'
         option ports '2 3 6t'
         option vid '1'

 config switch_vlan
         option device 'switch0'
         option vlan '2'
         option ports '1 6t'
         option vid '2'

Wireless config:

 config wifi-device 'radio0'
         option type 'mac80211'
         option channel '11'
         option hwmode '11g'
         option path 'pci0000:00/0000:00:00.0/0000:01:00.0'
         option htmode 'HT20'
         option disabled '1'

 config wifi-iface 'default_radio0'
         option device 'radio0'
         option mode 'ap'
         option ssid 'OpenWrt'
         option encryption 'none'
         option network 'lan'

 config wifi-device 'radio1'
         option type 'mac80211'
         option hwmode '11a'
         option path 'pci0000:00/0000:00:01.0/0000:02:00.0'
         option htmode 'VHT80'
         option country '00'
         option legacy_rates '1'
         option channel '40'

 config wifi-iface 'default_radio1'
         option device 'radio1'
         option mode 'ap'
         option ssid 'Net 2 (5G)'
         option encryption 'psk2'
         option key 'XXXXXXXX'
         option network 'lan'

Router: Xiaomi WiFi Router 3G

Manual followed to install OpenWRT https://forum.openwrt.org/t/xiaomi-wifi-router-3g

eth0.2 belongs to both wan and lan interface.
You may delete the wan interface, as you want a dump AP here.

2 Likes

You missed that from the pre-formatted text

If this is a router with 4 + 1 Ethernet ports, your switch config has some ports that are not in a VLAN at all, those ports will not work.

I would suggest starting over with a default configuration. Turn off the DHCP server, change the LAN IP to be in the same subnet but different address than your main router, and add the main router IP as gateway and DNS. Set up a wifi AP on the lan network.

Now if you were to plug the cable from the main router into one of the LAN ports instead of the WAN port, it would work. But the WAN port isn't useable for anything.

To make the WAN port work like another LAN port, change the switch configuration by moving that port out of VLAN 2 and into VLAN 1.

1 Like

Probably best to keep the default configuration in case he needs the WAN port later, unless he has too many wired devices.