OPNsense Forum

Archive => 20.7 Legacy Series => Topic started by: vaibhavtawade144@gmail.co on August 27, 2020, 11:07:43 AM

Title: Nginx Plugin - How to setup UDP LoadBalancer.
Post by: vaibhavtawade144@gmail.co on August 27, 2020, 11:07:43 AM
I have Installed Nginx plugin on OPNsense for UDP load balancing. I don't have any prior knowledge of this.

Consider I have 3 backend servers, UDP1, UDP2 and UDP3.
When I try this on nginx installed on any OS, the LoadBalancer will be accessible on IP of the host.

Please Guide me how to configure it on OPNsense.
Steps I have Followed,
1. First added UDP1, 2 and 3 in Upstream servers section.
2. Then Created Upstream with those 3 servers.
3. Created stream with that Upstream.

so what I need to do further?
On what IP this LoadBalancer will be accessible.
Title: Re: Nginx Plugin - How to setup UDP LoadBalancer.
Post by: Fright on August 27, 2020, 12:15:31 PM
"When I try this on nginx installed on any OS, the LoadBalancer will be accessible on IP of the host"
"On what IP this LoadBalancer will be accessible"
yes. ip of the host (if fw rules allow)
Title: Re: Nginx Plugin - How to setup UDP LoadBalancer.
Post by: vaibhavtawade144@gmail.co on August 27, 2020, 01:23:43 PM
Quote from: Fright on August 27, 2020, 12:15:31 PM
"When I try this on nginx installed on any OS, the LoadBalancer will be accessible on IP of the host"
"On what IP this LoadBalancer will be accessible"
yes. ip of the host (if fw rules allow)

How to do it with OPNsense, as it is plugin based, on what IP I will get the load balancer.
Title: Re: Nginx Plugin - How to setup UDP LoadBalancer.
Post by: Fright on August 27, 2020, 02:06:30 PM
I didn't understand the question, to be honest.
You need to install nginx plugin.
Configurte streaming to your backend servers.
Open upd/tcp (what your application use) port on firewall (on opnsense) on interfaces\ip which you want to listen.
nginx listen on system interfaces. ie opnsense host interfaces\IPs
Title: Re: Nginx Plugin - How to setup UDP LoadBalancer.
Post by: fabian on August 27, 2020, 11:07:19 PM
nginx always binds on 0.0.0.0 for IPv4 and :: for IPv6, which means that it is available on all interfaces the has unless a firewall rule (default = block) restricts that.