diff options
-rw-r--r-- | data/templates/frr/bgp.frr.tmpl | 52 | ||||
-rw-r--r-- | data/templates/frr/ldpd.frr.tmpl | 33 | ||||
-rw-r--r-- | interface-definitions/include/bgp-neighbor-afi-ipv6-unicast.xml.i | 7 | ||||
-rw-r--r-- | interface-definitions/interfaces-ethernet.xml.in | 4 | ||||
-rw-r--r-- | interface-definitions/protocols-bgp.xml.in | 20 | ||||
-rw-r--r-- | interface-definitions/protocols-mpls.xml.in | 32 | ||||
-rwxr-xr-x | src/conf_mode/protocols_mpls.py | 80 | ||||
-rwxr-xr-x | src/services/vyos-hostsd | 2 |
8 files changed, 157 insertions, 73 deletions
diff --git a/data/templates/frr/bgp.frr.tmpl b/data/templates/frr/bgp.frr.tmpl index 36a426c9c..d0857ac2c 100644 --- a/data/templates/frr/bgp.frr.tmpl +++ b/data/templates/frr/bgp.frr.tmpl @@ -250,11 +250,13 @@ router bgp {{ asn }} {#- END attribute-unchanged #} {%- if 'capability' in conf_peer_group.address_family.ipv4_unicast %} -{%- if 'receive' in conf_peer_group.address_family.ipv4_unicast.capability.orf.prefix_list %} +{%- if 'orf' in conf_peer_group.address_family.ipv4_unicast.capability %} +{%- if 'receive' in conf_peer_group.address_family.ipv4_unicast.capability.orf.prefix_list %} neighbor {{ pr_group }} capability orf prefix-list receive -{%- endif %} -{%- if 'send' in conf_peer_group.address_family.ipv4_unicast.capability.orf.prefix_list %} +{%- endif %} +{%- if 'send' in conf_peer_group.address_family.ipv4_unicast.capability.orf.prefix_list %} neighbor {{ pr_group }} capability orf prefix-list send +{%- endif %} {%- endif %} {%- endif %} @@ -379,11 +381,19 @@ router bgp {{ asn }} {#- END attribute-unchanged ipv6 #} {%- if 'capability' in conf_peer_group.address_family.ipv6_unicast %} -{%- if 'receive' in conf_peer_group.address_family.ipv6_unicast.capability.orf.prefix_list %} +{%- if 'dynamic' in conf_peer_group.address_family.ipv6_unicast.capability %} +{#- exit from afi ipv6 unicast because 'dynamic' its a global parameter for peer-group in afi6. Other checks are ongoing in afi6. Also related T3037 #} + exit-address-family + neighbor {{ pr_group }} capability dynamic + address-family ipv6 unicast +{%- endif %} +{%- if 'orf' in conf_peer_group.address_family.ipv6_unicast.capability %} +{%- if 'receive' in conf_peer_group.address_family.ipv6_unicast.capability.orf.prefix_list %} neighbor {{ pr_group }} capability orf prefix-list receive {%- endif %} -{%- if 'send' in conf_peer_group.address_family.ipv6_unicast.capability.orf.prefix_list %} +{%- if 'send' in conf_peer_group.address_family.ipv6_unicast.capability.orf.prefix_list %} neighbor {{ pr_group }} capability orf prefix-list send +{%- endif %} {%- endif %} {%- endif %} @@ -475,7 +485,7 @@ router bgp {{ asn }} {#- set peer-group as conf_peer #} {%- set conf_peer = conf_bgp[asn].neighbor[peer] %} -{#- First parameter for peer-group - remote-as #} +{#- First parameter for peer neighbor - remote-as #} {%- if 'remote_as' in conf_peer %} neighbor {{ peer }} remote-as {{ conf_peer.remote_as }} {%- endif %} @@ -502,10 +512,6 @@ router bgp {{ asn }} {%- endif %} {%- endif %} -{%- if 'description' in conf_peer %} - neighbor {{ peer }} description {{ conf_peer.description }} -{%- endif %} - {%- if 'disable_capability_negotiation' in conf_peer %} neighbor {{ peer }} disable-capability-negotiation {%- endif %} @@ -597,6 +603,10 @@ router bgp {{ asn }} neighbor {{ peer }} update-source {{ conf_peer.update_source }} {%- endif %} +{%- if 'description' in conf_peer %} + neighbor {{ peer }} description {{ conf_peer.description }} +{%- endif %} + {#- START address family for peer; set protocols bgp xxx neighbor x.x.x.x address-family ipvX-unicast #} {%- if 'address_family' in conf_peer %} {%- for afi in conf_peer.address_family %} @@ -650,11 +660,13 @@ router bgp {{ asn }} {#- END attribute-unchanged #} {%- if 'capability' in conf_peer.address_family.ipv4_unicast %} -{%- if 'receive' in conf_peer.address_family.ipv4_unicast.capability.orf.prefix_list %} +{%- if 'orf' in conf_peer.address_family.ipv4_unicast.capability %} +{%- if 'receive' in conf_peer.address_family.ipv4_unicast.capability.orf.prefix_list %} neighbor {{ peer }} capability orf prefix-list receive -{%- endif %} -{%- if 'send' in conf_peer.address_family.ipv4_unicast.capability.orf.prefix_list %} +{%- endif %} +{%- if 'send' in conf_peer.address_family.ipv4_unicast.capability.orf.prefix_list %} neighbor {{ peer }} capability orf prefix-list send +{%- endif %} {%- endif %} {%- endif %} @@ -783,11 +795,13 @@ router bgp {{ asn }} {#- END attribute-unchanged #} {%- if 'capability' in conf_peer.address_family.ipv6_unicast %} -{%- if 'receive' in conf_peer.address_family.ipv6_unicast.capability.orf.prefix_list %} +{%- if 'orf' in conf_peer.address_family.ipv6_unicast.capability %} +{%- if 'receive' in conf_peer.address_family.ipv6_unicast.capability.orf.prefix_list %} neighbor {{ peer }} capability orf prefix-list receive -{%- endif %} -{%- if 'send' in conf_peer.address_family.ipv6_unicast.capability.orf.prefix_list %} - neighbor {{ peer }} capability orf prefix-list send +{%- endif %} +{%- if 'send' in conf_peer.address_family.ipv6_unicast.capability.orf.prefix_list %} + neighbor {{ peer }} capability orf prefix-list send +{%- endif %} {%- endif %} {%- endif %} @@ -981,6 +995,10 @@ router bgp {{ asn }} no bgp fast-external-failover {%- endif %} +{%- if 'router_id' in bgp_params %} + bgp router-id {{ bgp_params.router_id }} +{%- endif %} + {#- END parameters; set protocols bgp xxx parameters #} {%- if 'timers' in conf_bgp[asn] %} diff --git a/data/templates/frr/ldpd.frr.tmpl b/data/templates/frr/ldpd.frr.tmpl index 5f080d75f..81a992165 100644 --- a/data/templates/frr/ldpd.frr.tmpl +++ b/data/templates/frr/ldpd.frr.tmpl @@ -13,6 +13,7 @@ no neighbor {{neighbor_id}} password {{old_ldp.neighbors[neighbor_id].password}} {% for neighbor_id in ldp.neighbors -%} neighbor {{neighbor_id}} password {{ldp.neighbors[neighbor_id].password}} {% endfor -%} +! address-family ipv4 label local allocate host-routes {% if old_ldp.export_ipv4_exp -%} @@ -27,20 +28,20 @@ no discovery transport-address {{ old_ldp.d_transp_ipv4 }} {% if ldp.d_transp_ipv4 -%} discovery transport-address {{ ldp.d_transp_ipv4 }} {% endif -%} -{% if old_ldp.hello_holdtime -%} -no discovery hello holdtime {{ old_ldp.hello_holdtime }} +{% if old_ldp.hello_ipv4_holdtime -%} +no discovery hello holdtime {{ old_ldp.hello_ipv4_holdtime }} {% endif -%} -{% if ldp.hello_holdtime -%} -discovery hello holdtime {{ ldp.hello_holdtime }} +{% if ldp.hello_ipv4_holdtime -%} +discovery hello holdtime {{ ldp.hello_ipv4_holdtime }} {% endif -%} -{% if old_ldp.hello_interval -%} -no discovery hello interval {{ old_ldp.hello_interval }} +{% if old_ldp.hello_ipv4_interval -%} +no discovery hello interval {{ old_ldp.hello_ipv4_interval }} {% endif -%} -{% if ldp.hello_interval -%} -discovery hello interval {{ ldp.hello_interval }} +{% if ldp.hello_ipv4_interval -%} +discovery hello interval {{ ldp.hello_ipv4_interval }} {% endif -%} {% if old_ldp.ses_ipv4_hold -%} -no session holdtime {{ old_ldp.ses_ipv4_hold }} +no session holdtime {{ old_ldp.ses_ipv4_hold }} {% endif -%} {% if ldp.ses_ipv4_hold -%} session holdtime {{ ldp.ses_ipv4_hold }} @@ -65,7 +66,7 @@ no label local advertise explicit-null label local advertise explicit-null {% endif -%} {% if old_ldp.ses_ipv6_hold -%} -no session holdtime {{ old_ldp.ses_ipv6_hold }} +no session holdtime {{ old_ldp.ses_ipv6_hold }} {% endif -%} {% if ldp.ses_ipv6_hold -%} session holdtime {{ ldp.ses_ipv6_hold }} @@ -76,6 +77,18 @@ no discovery transport-address {{ old_ldp.d_transp_ipv6 }} {% if ldp.d_transp_ipv6 -%} discovery transport-address {{ ldp.d_transp_ipv6 }} {% endif -%} +{% if old_ldp.hello_ipv6_holdtime -%} +no discovery hello holdtime {{ old_ldp.hello_ipv6_holdtime }} +{% endif -%} +{% if ldp.hello_ipv6_holdtime -%} +discovery hello holdtime {{ ldp.hello_ipv6_holdtime }} +{% endif -%} +{% if old_ldp.hello_ipv6_interval -%} +no discovery hello interval {{ old_ldp.hello_ipv6_interval }} +{% endif -%} +{% if ldp.hello_ipv6_interval -%} +discovery hello interval {{ ldp.hello_ipv6_interval }} +{% endif -%} {% for interface in old_ldp.interfaces -%} no interface {{interface}} {% endfor -%} diff --git a/interface-definitions/include/bgp-neighbor-afi-ipv6-unicast.xml.i b/interface-definitions/include/bgp-neighbor-afi-ipv6-unicast.xml.i index dcdc0eb66..63bf582db 100644 --- a/interface-definitions/include/bgp-neighbor-afi-ipv6-unicast.xml.i +++ b/interface-definitions/include/bgp-neighbor-afi-ipv6-unicast.xml.i @@ -59,6 +59,13 @@ <help>Advertise capabilities to this neighbor (IPv6)</help> </properties> <children> + <!-- Capability dynamic in the afi ipv6 does nothing T3037 --> + <leafNode name="dynamic"> + <properties> + <help>Advertise dynamic capability to this neighbor</help> + <valueless/> + </properties> + </leafNode> <node name="orf"> <properties> <help>Advertise ORF capability to this neighbor</help> diff --git a/interface-definitions/interfaces-ethernet.xml.in b/interface-definitions/interfaces-ethernet.xml.in index 8ba09f7c4..431322b75 100644 --- a/interface-definitions/interfaces-ethernet.xml.in +++ b/interface-definitions/interfaces-ethernet.xml.in @@ -14,10 +14,6 @@ <format>ethN</format> <description>Ethernet interface name</description> </valueHelp> - <valueHelp> - <format>en[ospx]N</format> - <description>Ethernet interface name</description> - </valueHelp> </properties> <children> #include <include/address-ipv4-ipv6-dhcp.xml.i> diff --git a/interface-definitions/protocols-bgp.xml.in b/interface-definitions/protocols-bgp.xml.in index e1469d6ad..6de8017f2 100644 --- a/interface-definitions/protocols-bgp.xml.in +++ b/interface-definitions/protocols-bgp.xml.in @@ -282,7 +282,7 @@ <constraint> <validator name="ipv4-address"/> <validator name="ipv6-address"/> - <regex>(en|eth|br|bond|gnv|vxlan|wg|tun)[0-9]+</regex> + <regex>(br|bond|dum|en|eth|gnv|lo|peth|tun|vti|vxlan|wg|wlan)[0-9]+</regex> </constraint> </properties> <children> @@ -628,7 +628,11 @@ <help>Source IP of routing updates</help> <valueHelp> <format>ipv4</format> - <description>IP address of route source</description> + <description>IPv4 address of route source</description> + </valueHelp> + <valueHelp> + <format>ipv6</format> + <description>IPv6 address of route source</description> </valueHelp> <valueHelp> <format><interface></format> @@ -636,7 +640,8 @@ </valueHelp> <constraint> <validator name="ipv4-address"/> - <regex>(en|eth|br|bond|gnv|vxlan|wg|tun)[0-9]+</regex> + <validator name="ipv6-address"/> + <regex>(br|bond|dum|en|eth|gnv|lo|peth|tun|vti|vxlan|wg|wlan)[0-9]+</regex> </constraint> </properties> </leafNode> @@ -1134,7 +1139,11 @@ <help>Source IP of routing updates</help> <valueHelp> <format>ipv4</format> - <description>IP address of route source</description> + <description>IPv4 address of route source</description> + </valueHelp> + <valueHelp> + <format>ipv6</format> + <description>IPv6 address of route source</description> </valueHelp> <valueHelp> <format><interface></format> @@ -1142,7 +1151,8 @@ </valueHelp> <constraint> <validator name="ipv4-address"/> - <regex>(en|eth|br|bond|gnv|vxlan|wg|tun)[0-9]+</regex> + <validator name="ipv6-address"/> + <regex>(br|bond|dum|en|eth|gnv|lo|peth|tun|vti|vxlan|wg|wlan)[0-9]+</regex> </constraint> </properties> </leafNode> diff --git a/interface-definitions/protocols-mpls.xml.in b/interface-definitions/protocols-mpls.xml.in index 3ea610d8b..94ece8d45 100644 --- a/interface-definitions/protocols-mpls.xml.in +++ b/interface-definitions/protocols-mpls.xml.in @@ -54,9 +54,9 @@ </valueHelp> </properties> <children> - <leafNode name="hello-holdtime"> + <leafNode name="hello-ipv4-holdtime"> <properties> - <help>Hello holdtime</help> + <help>Hello ipv4 holdtime</help> <valueHelp> <format>1-65535</format> <description>Time in seconds</description> @@ -66,9 +66,33 @@ </constraint> </properties> </leafNode> - <leafNode name="hello-interval"> + <leafNode name="hello-ipv4-interval"> <properties> - <help>Hello interval</help> + <help>Hello ipv4 interval</help> + <valueHelp> + <format>1-65535</format> + <description>Time in seconds</description> + </valueHelp> + <constraint> + <validator name="numeric" argument="--range 1-65535"/> + </constraint> + </properties> + </leafNode> + <leafNode name="hello-ipv6-holdtime"> + <properties> + <help>Hello ipv6 holdtime</help> + <valueHelp> + <format>1-65535</format> + <description>Time in seconds</description> + </valueHelp> + <constraint> + <validator name="numeric" argument="--range 1-65535"/> + </constraint> + </properties> + </leafNode> + <leafNode name="hello-ipv6-interval"> + <properties> + <help>Hello ipv6 interval</help> <valueHelp> <format>1-65535</format> <description>Time in seconds</description> diff --git a/src/conf_mode/protocols_mpls.py b/src/conf_mode/protocols_mpls.py index 904d219e2..d2ff0a2ea 100755 --- a/src/conf_mode/protocols_mpls.py +++ b/src/conf_mode/protocols_mpls.py @@ -38,30 +38,32 @@ def get_config(config=None): 'router_id' : None, 'mpls_ldp' : False, 'old_ldp' : { - 'interfaces' : [], - 'neighbors' : {}, - 'd_transp_ipv4' : None, - 'd_transp_ipv6' : None, - 'hello_holdtime' : None, - 'hello_interval' : None, - 'ses_ipv4_hold' : None, - 'ses_ipv6_hold' : None, - 'export_ipv4_exp' : False, - 'export_ipv6_exp' : False - + 'interfaces' : [], + 'neighbors' : {}, + 'd_transp_ipv4' : None, + 'd_transp_ipv6' : None, + 'hello_ipv4_holdtime' : None, + 'hello_ipv4_interval' : None, + 'hello_ipv6_holdtime' : None, + 'hello_ipv6_interval' : None, + 'ses_ipv4_hold' : None, + 'ses_ipv6_hold' : None, + 'export_ipv4_exp' : False, + 'export_ipv6_exp' : False }, 'ldp' : { - 'interfaces' : [], - 'neighbors' : {}, - 'd_transp_ipv4' : None, - 'd_transp_ipv6' : None, - 'hello_holdtime' : None, - 'hello_interval' : None, - 'ses_ipv4_hold' : None, - 'ses_ipv6_hold' : None, - 'export_ipv4_exp' : False, - 'export_ipv6_exp' : False - + 'interfaces' : [], + 'neighbors' : {}, + 'd_transp_ipv4' : None, + 'd_transp_ipv6' : None, + 'hello_ipv4_holdtime' : None, + 'hello_ipv4_interval' : None, + 'hello_ipv6_holdtime' : None, + 'hello_ipv6_interval' : None, + 'ses_ipv4_hold' : None, + 'ses_ipv6_hold' : None, + 'export_ipv4_exp' : False, + 'export_ipv6_exp' : False } } if not (conf.exists('protocols mpls') or conf.exists_effective('protocols mpls')): @@ -78,19 +80,33 @@ def get_config(config=None): if conf.exists('router-id'): mpls_conf['router_id'] = conf.return_value('router-id') - # Get hello holdtime - if conf.exists_effective('discovery hello-holdtime'): - mpls_conf['old_ldp']['hello_holdtime'] = conf.return_effective_value('discovery hello-holdtime') + # Get hello-ipv4-holdtime + if conf.exists_effective('discovery hello-ipv4-holdtime'): + mpls_conf['old_ldp']['hello_ipv4_holdtime'] = conf.return_effective_value('discovery hello-ipv4-holdtime') + + if conf.exists('discovery hello-ipv4-holdtime'): + mpls_conf['ldp']['hello_ipv4_holdtime'] = conf.return_value('discovery hello-ipv4-holdtime') + + # Get hello-ipv4-interval + if conf.exists_effective('discovery hello-ipv4-interval'): + mpls_conf['old_ldp']['hello_ipv4_interval'] = conf.return_effective_value('discovery hello-ipv4-interval') + + if conf.exists('discovery hello-ipv4-interval'): + mpls_conf['ldp']['hello_ipv4_interval'] = conf.return_value('discovery hello-ipv4-interval') + + # Get hello-ipv6-holdtime + if conf.exists_effective('discovery hello-ipv6-holdtime'): + mpls_conf['old_ldp']['hello_ipv6_holdtime'] = conf.return_effective_value('discovery hello-ipv6-holdtime') - if conf.exists('discovery hello-holdtime'): - mpls_conf['ldp']['hello_holdtime'] = conf.return_value('discovery hello-holdtime') + if conf.exists('discovery hello-ipv6-holdtime'): + mpls_conf['ldp']['hello_ipv6_holdtime'] = conf.return_value('discovery hello-ipv6-holdtime') - # Get hello interval - if conf.exists_effective('discovery hello-interval'): - mpls_conf['old_ldp']['hello_interval'] = conf.return_effective_value('discovery hello-interval') + # Get hello-ipv6-interval + if conf.exists_effective('discovery hello-ipv6-interval'): + mpls_conf['old_ldp']['hello_ipv6_interval'] = conf.return_effective_value('discovery hello-ipv6-interval') - if conf.exists('discovery hello-interval'): - mpls_conf['ldp']['hello_interval'] = conf.return_value('discovery hello-interval') + if conf.exists('discovery hello-ipv6-interval'): + mpls_conf['ldp']['hello_ipv6_interval'] = conf.return_value('discovery hello-ipv6-interval') # Get session-ipv4-holdtime if conf.exists_effective('discovery session-ipv4-holdtime'): diff --git a/src/services/vyos-hostsd b/src/services/vyos-hostsd index 59dbeda17..4c4bb036e 100755 --- a/src/services/vyos-hostsd +++ b/src/services/vyos-hostsd @@ -589,7 +589,7 @@ if __name__ == '__main__': socket = context.socket(zmq.REP) # Set the right permissions on the socket, then change it back - o_mask = os.umask(0o007) + o_mask = os.umask(0o000) socket.bind(SOCKET_PATH) os.umask(o_mask) |