I would like to switch a setup from the ISP-provided Huawei EG8145V5 to a OpenWRT setup with the RPI3B. This setup connects to the Internet via optical fiber, which the EG8145V5 supports, unlike the RPI. My question is, ¿what I should do to connect the RPI to the Internet? I'm thinking I might need to buy a device like the TP-Link TL-FC311B-2, but I would like advice before I proceed with the purchase.
The simplest solution will be to put the EG8145V5 into bridge mode and just use it to convert the optical fiber to ethernet. You can then use your chosen replacement router device to do everything else.
Your ISP is using GPON, where several customers passively couple into one fiber to the central office, much like cable modems. GPON ONTs like the EG8145 have logic to authenticate with the ISP, share time on the fiber, and encrypt packets so that others on the same fiber can't eavesdrop. A standard point-to-point media converter does none of these things so it will not work.
I don't know. OP would have to look through the device's configuration screens, if the ISP allows access for a customer to configure it. They could also ask the ISP if they can provide a simple ONT such as a GigaPoint 801, which is always a bridge.
Bringing your own GPON equipment may be technically possible but it is like a cable modem where the ISP has to agree to provision it on their network. It is simpler to use the ISP-provided device and treat it as an untrusted part of the Internet. Which is what OpenWrt does anyway since it will be on the WAN side of your firewall.
However I tried to do that and found out something disappointing.
Attempting to setup bridge mode in the EG8145V5 in Advanced -> WAN brings up a table that is quickly deleted entirely and replaced with --.
Analyzing the source code (the javascript isn't minified) reveals that the page calls the ShowWanListTable function, which calls IsAdminUser. I don't know if this is the case in other EG8145V5 but it is in mine.
There are 2 types of users, the one printed on the router and another one with all functions unlocked, which I suspect only the ISP knows.
No luck.
Also tried root/admin and root/adminHW as provided in this thread on the Huawei forum. Looks like they changed it to custom ones. Will try contacting the ISP later, but I suspect they might not give me access.
So, knowing that bridge mode isn't accessible in my case, I think I will go with Poor Man's Bridge Mode, which uses the DMZ function, which is accessible in my case.
To any future readers of this post in the same situation as mine, if you have a bridge mode capable device from your ISP, I recommend following instead krazeh's answer.