Looking for working Keepalived config

Ahoy friends.
Currently i am looking for a working simple keepalived config, unfortunately the example given in the Wiki doesn't work as expected.

Unfortunately it's quite tough to find good examples and guides in order to configure keepalived for VRRP on OpenWrt.

Right at the moment i got 2 very simple virtual machines running OpenWrt for testing. Only eth0 (LAN) and eth1 (WAN) . No additional config. I have followed the guide, and performed all given steps.
Unfortunately keepalived still auto-generates a config file in /tmp/keepalived.conf.
Even though /etc/config/keepalived is correctly set to : config global_defs option alt_config_file "/etc/keepalived/keepalived.conf"
What's going wrong in my config?

Also i got some additional questions.
I am coming from the HSRP on Cisco so it's quite different for me how this works.
Is there a way to use virtual mac addresses as well like in HSRP?
On my "DMZ" facing the WAN side of my routers, i can only provied port forwards to a device based on it's mac address. So when one routers fail, the other one will not be able to accept inbound traffic.
According to the config in the wiki, there is a virtual ip address on the WAN side for the WAN facing ISP routers, but no virtual ip address for the LAN facing devices on eth0' side.

My current setup:
Router 1:

WAN IP Address: 192.168.3.2
LAN IP Address: 192.168.1.2

Router 2:

WAN IP Address: 192.168.3.3
LAN IP Address: 192.168.1.3

What's this 10.9.8.4 ip address in the wiki example for? In my opinion it should be something like 192.168.1.4, but i don't know what's the use of this ip address here. I didn't question it yet, because it is part of the wiki, so i think it must be correct what's written there.
And how do the routers communicate to each other? Do they use the VRRP Multicast address?

! internal
vrrp_instance I1 {
  state backup
  interface br-lan
  virtual_router_id 51
  priority 101
  advert_int 1
  virtual_ipaddress {
    10.9.8.4/24
  }
  authentication {
    auth_type PASS
    auth_pass s3cret
  }
  nopreempt
}

EDIT: I was able solve the problem regarding the config, unfortunately the config provided by the wiki was wrong in some aspects.

The problem with the auto-generated config on startup still persists.

I hope someone can help me in order to get a basic working config for my keepalived setup!! Thanks in advance!

On the latest firmware 21.02.3 I set /etc/config/keepalived to:

config globals 'globals'
option alt_config_file '/etc/keepalived/keepalived.conf'

That worked for me.

2 Likes