HAProxy - how to change URL IP based on incoming VLAN or network

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

rickdrummond

New Member
Dec 2, 2016
1
0
1
57
I have 3 networks (for test). I need users to be redirected to a different URL IP based on what network they are coming from. Example 10.32.0.0. I need to redirect to 10.32.1.1. 10.33.0.0 I need to redirect to 10.33.1.1, and so on. How do I do this?

I am new to HAProxy so sorry for the novice question
Thanks
 

TedB

Active Member
Dec 2, 2016
123
33
28
45
You different networks have different address space so you can use "acl" then based on this make a decision.

Shor example with just one backend shown.

acl net_A src 10.10.0.0/16
acl net_B src 10.20.0.0/16
acl net_C src 10.30.0.0/16

use backend back_net_A if net_A
use backend back_net_B if net_B
use backend back_net_C if net_C

backend back_net_A
balance roundrobin
mode http
server srv_net_A 10.99.0.10:80 check​
 
  • Like
Reactions: eva2000 and Patrick