Hi, c/selfhosted! This is my first post on Fediverse and I am glad to be making it here.

I recently got fed up with having to use Tailscale to access my server at home and decided to expose it publicly. A friend recommended segregating the server into a dedicated VLAN. My router’s stock firmware does not allow that, so I flashed OpenWrt on it (I am amazed how simple and easy the process was).

Getting the router to actually assign an IP address to the server was quite a headache (with no prior experience using OpenWrt), but I managed to do it at the end with a help from a tutorial video on YouTube.

Now, everything is working perfectly fine and as I’d expect, except that all requests’ IP addresses are set to the router’s IP address (192.168.3.1), so I am unable to use proper rate limiting and especially fail2ban.

I was hoping someone here would have an experience with this situation and help me.


Edit: Solved thanks to @PotatoesFall@discuss.tchncs.de.

I messed around with the port-forward settings with no luck in the past. Instead, disabling the “Masquerade” option in the firewall settings for the server’s VLAN worked.

  • talkingpumpkin@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 hours ago

    Getting the router to actually assign an IP address to the server

    You would typically want to use static ip addresses for servers (because if you use DHCP the IP is gonna change sooner or later, and it’s gonna be a pain in the butt).

    IIRC dnsmasq is configured to assign IPs from .100 upwards (unless you changed that), so you can use any of the IPs up to .99 without issue (you can also assign a DNS name to the IP, of course).

    all requests’ IP addresses are set to the router’s IP address (192.168.3.1), so I am unable to use proper rate limiting and especially fail2ban.

    Sounds like you are using masquerade and need DNAT instead. No idea how to configure that in openwrt - sorry.