I want to configure a device, connected to the eth5 using the navigation subnet provided by the ISP (lets say x.x.x.128/30, available for devices 129,130 - gateway dynamically assigned by the ISP thourgh the PPPoE) without any NAT/firewall rules.
The project would involve a script under /etc/ppp/ip-up.d (or maybe under /etc/hotplug.d) which removes the IP from pppoe-wan, adds an onlink route to br-lan for this IP, cleans up any stale onlink routes, and reconfigures dnsmasq to issue the lease via DHCP to a device with a chosen MAC.
option name 'wan'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'
list network 'wan'
list masq_src '!x.y.z.128/30'
Then, on devices, add x.y.z.129/32 and x.y.z.130/32 IP addresses (yes, with /32 as the netmask) and 192.168.1.1 (or whatever your router LAN IP is) as the gateway. BTW, with this /32 netmask, I think that device IPs ending with .128 and .131 will also work.
Thank you very much @patrakov, I confirm that your solution works perfectly. you have no idea how much time we lost between various configurations and other devices like opnsense, tplink, zyxel...
Can I ask you for some more informations on this configuration?
In this case, why is ‘limited masquerading’ necessary?
Limited masquerading means "NAT disabled for certain address ranges". This is exactly what you have asked for.
I recommend software flow offloading. OpenWrt presents an option to enable hardware flow offloading even if the hardware does not support it, so don't enable it unless you are sure it is supported. If you enable it on unsupported hardware, it will fall back to software offloading with broken WiFi roaming.
As for the "router has no direct access to the internet" issue, this is unexpected. Could you please provide the output of ip route?
root@OpenWrt:~# ip route
default via x.y.z.15 dev pppoe-wan
x.y.z.15 dev pppoe-wan scope link src d.e.f.23
a.b.c.128/30 dev br-lan scope link
192.168.1.0/24 dev br-lan scope link src 192.168.1.1
root@OpenWrt:~#
Only two of those are usable: 129 and 130. The first and last addresses in a v4 subnet block are reserved.
If the ISP is routing additional addresses to your line you can expand the subnet definition at your end. As far as I know this is used only to set up routing tables and possibly filter IPs at the port driver.
Creating a separate "DMZ" lan for servers that are routed directly from/to the Internet would be more secure.
My advice would be to choose hardware that is fast enough without any magic tricks. The more advanced forms of hardware acceleration can be very capable, but they are also fragile in nature.
@patrakov do you have any idea why this happens?
I also encountered a second problem: I have a web server on the ip x.y.z.130, when I try to access a website I get the ip of the point-to-point (d.e.f.23). why?
I don't know. I will be busy in meetings in the next hour, but then we can attempt a video meeting to troubleshoot. A link will be posted via a private message.