+{% for address, address_config in rp.address.items() %}
+{% for group in address_config.group %}
+ip pim rp {{ address }} {{ group }}
+{% endfor %}
{% endfor %}
-{% endfor %}
-{% if pim.rp_keep_alive %}
-ip pim rp keep-alive-timer {{ pim.rp_keep_alive }}
+{% endif %}
+{% if rp.keep_alive_timer is vyos_defined %}
+ip pim rp keep-alive-timer {{ rp.keep_alive_timer }}
+{% endif %}
+{% if no_v6_secondary is vyos_defined %}
+no ip pim send-v6-secondary
+{% endif %}
+{% if spt_switchover.infinity_and_beyond is vyos_defined %}
+ip pim spt-switchover infinity-and-beyond {{ 'prefix-list ' ~ spt_switchover.infinity_and_beyond.prefix_list if spt_switchover.infinity_and_beyond.prefix_list is defined }}
+set protocols pim interface eth1 igmp version '2'
+set protocols pim interface eth2
+set protocols pim rp address 172.16.255.1 group '224.0.0.0/4'
+set service ntp server 0.pool.ntp.org
+set service ntp server 1.pool.ntp.org
+set service ntp server 2.pool.ntp.org
+set system domain-name 'vyos.io'
+set system host-name 'vyos'
+set system login user vyos authentication encrypted-password '$6$2Ta6TWHd/U$NmrX0x9kexCimeOcYK1MfhMpITF9ELxHcaBU/znBq.X2ukQOj61fVI2UYP/xBzP4QtiTcdkgs7WOQMHWsRymO/'
+set system login user vyos authentication plaintext-password ''
if not ask_yes_no('WARNING: This is a potentially unsafe function!\n' \
'You may lose the connection to the router or active configuration after\n' \
'running this command. Use it at your own risk!\n\n'
'Continue?'):
return False
# check if another restart process already running
if len([process for process in psutil.process_iter(attrs=['pid', 'name', 'cmdline']) if 'python' in process.info['name'] and 'restart_frr.py' in process.info['cmdline'][1]]) > 1:
message = 'Another restart_frr.py process is already running!'
logger.error(message)
if not ask_yes_no(f'\n{message} It is unsafe to continue.\n\n' \
'Do you want to process anyway?'):
return False
# check if watchfrr.sh is running
tmp = os.path.basename(watchfrr)
if process_named_running(tmp):
message = f'Another {tmp} process is already running.'
logger.error(message)
if not ask_yes_no(f'{message} It is unsafe to continue.\n\n' \
'Do you want to process anyway?'):
return False
# check if vtysh is running
if process_named_running('vtysh'):
message = 'vtysh process is executed by another task.'
logger.error(message)
if not ask_yes_no(f'{message} It is unsafe to continue.\n\n' \