Name-based to IP-based virtual host configuration?

Hi,

I am very far from being a networking expert so please be patient with me if I've got any terminology wrong or if my ideas are misconstrued.

I have a fairly normal small business internet connection with a single static IP allocated and I have configured a server so that it runs MetalLB (in front of Traefik) on the ethernet adapter and gives seperate IP addresses for each virtual host that is running on the server. I can access my virtual servers from the LAN by using the virtual hostname eg accessing http://server1.domain1.net gets those web pages (via LAN IP 192.168.1.8) and http://other_serv.domain2.com gets the web pages for that virtual server (via LAN IP 192.168.1.9). The name resolution for LAN traffic is done by LUCI/Network/Hostnames mapping server1.domain1.net to 192.168.1.8 and other_serv.domain2.com to 192.168.1.9. Works fine.

What I need is a way to route internet host requests that come in on the broadband internet connection to the individual LAN IP addresses with similar effect but I am lost in a sea of jargon and don't really know what is the best way to approach this or what t try to set up.

Any ideas, comments or suggestions would be most welcome.

Thanks,

Can't you just redirect all the external traffic to MetalLB, and let it handle the issue? I was going to say you need a reverse proxy, but that is exactly what you already have on MetalLB.

1 Like

Unfortunately not, MLB/Traefik works by having the connections for each server to come in on a different IP (though all on the same MAC). If I direct internet traffic for host1.server1.com to the IP for host2.server2.com then the response is the html for h2.s2. That seems to be how the MetalLB / Traefik combo works.

Thanks for your reply,

1 Like

Sorry vgaeyera but you are going to have to be more explicit than that for me to understand. Do you mean that I need to install an Nginx onto my OpenWRT router ? I had hoped it would be possible to configure the firewall to achieve what I need ?

You need to parse the HTTP headers to redirect traffic to a specific IP.
Firewall does not provide this function, but you can use a reverse proxy.
Install the reverse proxy on either the router or some host behind it.

1 Like