I'm using TP link TL-WR840N v2 router. Somedays ago during storm my router's wan port got damaged and it's not working. My other lan ports are okay.
I want to make one of lan ports to wan port. How can I do that? I installed OpenWrt in my router by firmware upgrading last night. I'm still novice/new in OpenWrt. So your kind helping will be much appreciable.
Is it just the WAN port that got damaged, or the SoC itself?
If the other ports are working, you can reconfigure the switch using LuCI. Take note of the settings of the WAN port in the switch-configuration section, copy them to the port you want to use, and remove all settings from the "old" WAN port.
If you're not seeing anything in the "2" row, you've got some basic configuration problems to start. What you're showing there doesn't connect the CPU "WAN" sub-interface to any ports at all.
Typically, with a single-Interface SoC, I'd expect something like what lleachii posted. If you match his screenshot, to you "magically" have your WAN back?
If you don't know where is /etc/config/network then you probably shouldn't touch it. Editing config files manually can easily break things if you don't know what you are doing. Using uci commands is a bit safer.
Aside from the WAN port that is not showing, did you try just swapping one LAN port from VLAN1 to VLAN2 as @lleachii explained and see if it works?
On this model the WAN port has its own connection to the CPU. The network settings are:
WAN : eth0
LAN: eth1.1
Now the eth0 port is burned out, so is go to Network--WAN--Physical settings and connect it to eth1.2 (create a new interface at the bottom) instead. This sends WAN traffic toward the switch with a tag of 2.
You must have a VLAN 2 in the switch and have that VLAN connected tagged to the CPU. In other words both VLANs are tagged to the CPU, but untagged to the physical port(s) you want them to appear on. Have only one VLAN on each physical port. It needs to be off on the other VLANs.
It should be pointed out that if lightning hit your installation hard enough to damage the router, the modem was also likely damaged.
And I would not count on everything else on the router still working. All the Ethernet cables go into the same chip, the AR9344, which is also the CPU, the switch, and the wifi.
Switch configuration looks good now but you must also attach the WAN network to eth1.2, which did not exist before. The default is to use eth0, which leads directly to the blue "WAN" port and doesn't involve the switch.