Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BPFire HA for LoxiLB with Keepalived #28

Closed
vincentmli opened this issue Jun 16, 2024 · 3 comments
Closed

BPFire HA for LoxiLB with Keepalived #28

vincentmli opened this issue Jun 16, 2024 · 3 comments

Comments

@vincentmli
Copy link
Owner

Add BPFire WebUI for keepalived to create virtual IP for LoxiLB load balancer. a typical keepalived configuration

global_defs {
   notification_email {
     root@mydomain.com
   }
   notification_email_from svr1@mydomain.com
   smtp_server localhost
   smtp_connect_timeout 30
}

vrrp_instance VRRP1 {
    state MASTER
#   Specify the network interface to which the virtual address is assigned
    interface eth0
#   The virtual router ID must be unique to each VRRP instance that you define
    virtual_router_id 41
#   Set the value of priority higher on the master server than on a backup server
    priority 200
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass 1066
    }
    virtual_ipaddress {
        10.0.0.100/24
    }
}

above keepalived configuration could be used in Perl here doc from WebUI to simplify the generation of keepalived configuration

   		print $keepalived_fh <<EOF

global_defs {
   notification_email {
     $email
   }
   notification_email_from $email
   smtp_server $smtp_server
   smtp_connect_timeout $smtp_timeout
}

vrrp_instance VRRP1 {
    state MASTER
#   Specify the network interface to which the virtual address is assigned
    interface $interface
#   The virtual router ID must be unique to each VRRP instance that you define
    virtual_router_id $router_id
#   Set the value of priority higher on the master server than on a backup server
    priority $priority
    advert_int $advert
    authentication {
        auth_type PASS
        auth_pass 1066
    }
    virtual_ipaddress {
        $vip
    }
}
EOF
@vincentmli
Copy link
Owner Author

need to change keepalived addon as BPFire core package as part of iso/img build

move config/rootfiles/packages/keepalived to config/rootfiles/common/keepalived

@vincentmli
Copy link
Owner Author

vincentmli commented Jun 22, 2024

since both red0 and green0 requires shared/floating virtual IP, virtual IP on red0 for load balancer virtual IP, virtual IP on green0 for virtual gateway IP to endpoint/backend server, so we need to create keepalived VRRP instance for both red0 and green0 interface, for such UI, html/cgi-bin/dhcp.cgi code could be referenced.

dhcp service in HA can be tricky, maybe disable dhcp in HA for simplicity :)

@vincentmli
Copy link
Owner Author

dhcp service in HA can be tricky, maybe disable dhcp in HA for simplicity :)

it looks the dhcp router ip is hard coded to green0 interface ip from html/cgi-bin/dhcp.cgi

    #Subnet range definition
    foreach my $itf (@ITFs) {

            print FILE "\toption routers " . $netsettings{"${itf}_ADDRESS"} . ";\n";

we could add DHCP UI with option routers with a shared/floadting ip between HA as default gateway of backend/endpoint server in HA

vincentmli pushed a commit that referenced this issue Dec 14, 2024
- Update from version 0.6.1-f54b3fa to 0.6.3
- Update of rootfile not required
- Changelog
    0.6.3
	* remove outdated copyright and email
	* Merge pull request #25 from fweimer/patch-1 AC_QEF_C_NORETURN: Include
	  <stdlib.h> for exit
	* Merge pull request #27 from ofalk/master Fix potential write to unallocated
	  memory.
	* Merge pull request #28 from vgropp/#2-fix-csv-bits feat: #2 output bits in csv
	* Merge pull request #29 from vgropp/#2-fix-csv-bits fix(doc): #2 output bits
	  in csv
	* Merge pull request #32 from vgropp/new-netstat-#5 feat: add support for
	  newer (2016+) linux netstat #5
    0.6.2
	* Merge pull request #22 from vgropp/issue-#13 to fix windows build
	* Merge pull request #20 from dreibh/master CSV file output: fix for timestamp
	  inaccuracy and Y-2038 problem
	* Merge pull request #21 from vgropp/travisci add travisci
	* Merge pull request #17 from Himura2la/master Add the started time in "sum" mode
	* Merge pull request #18 from Himura2la/fix-dynamic Fix DYNAMIC and ANSIOUT in
	  config
	* Merge pull request #10 from SoapGentoo/fixes Use `static inline` instead of
	  `inline`
	* Merge pull request #9 from adventureloop/master Always fflush the pipe
	* Merge pull request #7 from samueloph/fsf_address_clean Update FSF address
	* Merge pull request #6 from samueloph/master Fix typos
	* fix nan and inf values on fast refresh (fixes debian bug #532331

Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant