hAP as Station?

I’m sure I’m going to totally mess up the validity/consistency/comprehensibility of this question, but here goes my best effort.

I have several locations where I’ve installed Tasmota devices and they revert to factory default config sometimes (when power goes out, I think). I’ve tried SETOPTION65 1 but that didn’t help.

We have a power outage last night, and a bunch of Tasmotas are now at default config. This means they are in AP mode waiting for a station to connect to it, get an IP via DHCP from it, web browse to the Tasmota’s web config page and tell it which wifi network (SSID) to connect to.

Instead of travelling there, I am hoping I can do this using the local hAPax3 (which I have access to).

Using winbox or terminal /INTERFACE WIFIWAVE2 SCAN 4 I see the Tasmota devices (SSID tasmota-DEA63D-1597 for example).

If I click the CONNECT button, then my wireless interface named WIFI2 changes mode to STATION and takes on the SSID of the tasmota device.

Does this mean the hAP is now a station connected to the tasmota device? How can I now access the tasmota device’s web config page?

EDIT: I set the frequency in the master interface to match the tasmota’s and enabled DHCP client on the tasmota wireless interface I created in STATIOn mode and I am connected!

Now if I can just figure out how to get a web browser to access 192.168.4.1

Thank you!

If Tasmota device has working default gateway then port NAT may be enough. If not then full IP address NAT is the next option I’d consider.

Thanks.

I tried dstnat port forwarding but couldn’t get it to work.

I can ping the tasmota device from the router.

Might have something to do with not being able to put the slave Station interface in the same bridge as the other interfaces.

You will need both dstnat and srcnat for the port forwarding.

So the IP address hitting the Tasmota is the ax3’s IP address,
which it knows how to reply too.

srcnat is beyond my current understanding (other than the very very basic idea that it changes the source IP address identified on the packet).

Tasmota is 192.168.4.1

hAPax3 has 192.168.4.2 statically assigned to interface “Tasmota-connect” which is a slave under interface “wifi2”:


add address=192.168.4.2/24 interface=Tasmota-connect network=192.168.4.0



/interface wifiwave2
add configuration.mode=station .ssid=tasmota-DF1BA9-7081 disabled=no l2mtu=2290 mac-address=1A:FD:74:FE:87:EB master-interface=wifi2 name=Tasmota-connect security=common-auth security.authentication-types=""

Tasmota-connect status:

state: authorized
channel: 2412/g
ap-address: C6:5B:BE:DF:1B:A9
tx-power: 27
available-channels: 2412/g

This is what I have for my dstnat rule:

add action=dst-nat chain=dstnat dst-port=8888 log=yes protocol=tcp  to-addresses=192.168.4.1 to-ports=80

Thank you!

I got it working!!! I’m shocked at myself!

I set up the following NAT rules:

/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" ipsec-policy=out,none out-interface-list=WAN
add action=dst-nat chain=dstnat dst-port=80 log=yes protocol=tcp to-addresses=192.168.4.1 to-ports=80
add action=src-nat chain=srcnat dst-address=192.168.4.0/24 log=yes to-addresses=192.168.4.2