[PPPOE] Access modem without nat

There is an openwrt router with a fritzbox in front of it (VDSL), currently the fritz is connected via pppoe, and there is a /30 network between the two devices, this is done before because of the fritz has an fxs port, which is used, since the sip server is after openwrt, there is a NAT at openwrt, this is how it works now, but it's a very bad solution and I want to eliminate it. Fritz would switch to bridge and openwrt would connect via pppoe, eliminating double nat. However, the fxs port would still be necessary, what would be a good solution for thi? Until then, it is ok that the pppoe interface is an alias on the wan interface, so the wan remains with the static ip, where the fritz is available, but in this case there will also be a nat from the fritz tot he síp server, how could it be eliminated? (I think it doesn't work if I put the wan interface in a bridge with the lan, and fritz gets an ip from the lan range and the bridge has an alias for pppoe)

Likely none, I bet your ISP routes VoIP traffic through the PPPoE tunnel... I would consider getting another fritzbox and use that as VoIP base (just configure that FB to use one of the LAN ports as wan and configure iy for DHCP and add your VoIP credentials, you should be able to use that FB's FXS port then.

I use the fxs with my own freepbx server, which is on the lan side of the openwrt.

This is clearly outside of my area of expertise, so I will shut up, hopefully others with relevant first-hand experience will chime in.

Your Fritz!Box can be configured in IPoE/ client mode, behind your OpenWrt router (be it in a locked down VoIP subnet or directly on your LAN), this way you can make use of all of its pbx/ ATA and DECT features, but you lose the ability to use it as VDSL modem that way (so you'd need another dedicated VDSL modem for that aspect). How you configure your SIP connection (be it to your ISP's SIP servers directly or freebx in your LAN or the cloud) is immaterial to this question, it should work either way.

While I was still on VDSL, I was using this approach (and basically I still am, just now on ftth) and had two alternative (tested- and battle-proven) setups ready:

                       [PSTN/ Internet]
                              |
          [Draytek Vigor 130, VDSL2+vectoring modem]
                              |
              [ ZyXEL NBG6817, running OpenWrt]
                  |          | |        |
              VoIP VLAN   LAN VLAN   IoT VLAN
            (locked down)    | |  (locked down)
                  |          | |        |
           [Fritz!Box 7430]  … …        …
            |       |    |
           FXS     eth  DECT
           /       |      \
[Fax machine] [SIP phone] [DECT handsets]
                       [PSTN/ Internet]
                              |
                [ BTHub5a, running OpenWrt]
                  |          | |        |
              VoIP VLAN   LAN VLAN   IoT VLAN
            (locked down)    | |  (locked down)
                  |          | |        |
         [Fritz!Box 7362SL]  … …        …
            |       |    |
           FXS     eth  DECT
           /       |      \
[Fax machine] [SIP phone] [DECT handsets]

Propably your modem has three different connections configured

  1. For Internet, VLAN tag 835 or similar with 802.1p = 0
  2. For VoIP, VLAN tag 837 or similar with 802.1p = 6 (voice)
  3. For IPTV, VLAN tag 836 or similar 802.1p = 5 (video)

Bridging the first wan connection in Fritz, leaves the other two unaffected and telephone will work. Just change the internet wan connection from PTM PPPoE to PTM bridge and keep vlan tag and 802.1.p

Then to access your modem you will need this

I dont want to use a second modem, the fritz uses my freepbx's sip so it doesn't need to connect to the isp. I tried my idea and it works, but I think it is not the best solution.

Ah, OK then what could work is:
A) bridge the DSL port with one of the LAN ports (and remove it from the FB's LAN bridge) and connect your OpenWrt router to that.
B) configure another of the FB's LAN ports as WAN and connect that to the OpenWrt router
C) you can use two VLANs over a single cable/port for that to optimize things a bit...

On the fritz I cannot manage vlans and ports because it has it's own firmware not openwrt. What if I put the wan interface in a bridge with the lan, and fritz gets an ip from the lan range and the wan has an alias interface for pppoe? This works, I tested it, but is it a good solution?

I would hope that with freetz one could configure a fritzbox in more detail, but i honestly never tried... I just got my second* fritzbox (7520) and put OpenWrt on it to configure it as bridged-modem.

No idea, sorry.

*) First was a fritzbox sl wlan in the early 200s