diff options
31 files changed, 182 insertions, 65 deletions
| diff --git a/.gitignore b/.gitignore index d781beead..7707e94ca 100644 --- a/.gitignore +++ b/.gitignore @@ -109,7 +109,6 @@ ENV/  templates-cfg/*  templates-op/*  tests/templates/* -xml_cache/*  # Debian packaging  debian/files @@ -3,7 +3,6 @@ OP_TMPL_DIR := templates-op  BUILD_DIR := build  DATA_DIR := data  SHIM_DIR := src/shim -CACHE_DIR := xml_cache  LIBS := -lzmq  CFLAGS :=  BUILD_ARCH := $(shell dpkg-architecture -q DEB_BUILD_ARCH) @@ -24,11 +23,10 @@ op_xml_obj = $(op_xml_src:.xml.in=.xml)  .ONESHELL:  interface_definitions: $(config_xml_obj)  	mkdir -p $(TMPL_DIR) -	mkdir -p $(CACHE_DIR)  	$(CURDIR)/scripts/override-default $(BUILD_DIR)/interface-definitions -	$(CURDIR)/python/vyos/xml_ref/generate_cache.py --xml-dir $(BUILD_DIR)/interface-definitions --package-name vyos-1x --output-path $(CACHE_DIR) +	$(CURDIR)/python/vyos/xml_ref/generate_cache.py --xml-dir $(BUILD_DIR)/interface-definitions  	find $(BUILD_DIR)/interface-definitions -type f -name "*.xml" | xargs -I {} $(CURDIR)/scripts/build-command-templates {} $(CURDIR)/schema/interface_definition.rng $(TMPL_DIR) || exit 1 @@ -98,7 +96,6 @@ clean:  	rm -rf $(BUILD_DIR)  	rm -rf $(TMPL_DIR)  	rm -rf $(OP_TMPL_DIR) -	rm -rf $(CACHE_DIR)  	$(MAKE) -C $(SHIM_DIR) clean  .PHONY: test diff --git a/data/templates/dhcp-client/dhcp6c_daemon-options.j2 b/data/templates/dhcp-client/dhcp6c_daemon-options.j2 new file mode 100644 index 000000000..d33d418fc --- /dev/null +++ b/data/templates/dhcp-client/dhcp6c_daemon-options.j2 @@ -0,0 +1,2 @@ +{% set no_release = '-n' if dhcpv6_options.no_release is vyos_defined else '' %} +DHCP6C_OPTS="-D -k /run/dhcp6c/dhcp6c.{{ ifname }}.sock -c /run/dhcp6c/dhcp6c.{{ ifname }}.conf -p /run/dhcp6c/dhcp6c.{{ ifname }}.pid {{ no_release }} {{ ifname }}" diff --git a/debian/rules b/debian/rules index 39185f1e6..9ada2bf87 100755 --- a/debian/rules +++ b/debian/rules @@ -9,7 +9,6 @@ VYOS_CFG_TMPL_DIR := opt/vyatta/share/vyatta-cfg/templates  VYOS_OP_TMPL_DIR := opt/vyatta/share/vyatta-op/templates  VYOS_MIBS_DIR := usr/share/snmp/mibs  VYOS_LOCALUI_DIR := srv/localui -VYOS_XML_CACHE_DIR := python/vyos/xml_ref/pkg_cache  MIGRATION_SCRIPTS_DIR := opt/vyatta/etc/config-migrate/migrate  SYSTEM_SCRIPTS_DIR := usr/libexec/vyos/system @@ -36,8 +35,6 @@ override_dh_auto_install:  	# convert the XML to dictionaries  	env PYTHONPATH=python python3 python/vyos/xml/generate.py -	cp xml_cache/vyos_1x_cache.py python/vyos/xml_ref/pkg_cache -  	cd python; python3 setup.py install --install-layout=deb --root ../$(DIR); cd ..  	# Install scripts diff --git a/interface-definitions/container.xml.in b/interface-definitions/container.xml.in index d36b34941..6d2eb18d0 100644 --- a/interface-definitions/container.xml.in +++ b/interface-definitions/container.xml.in @@ -3,7 +3,7 @@    <node name="container" owner="${vyos_conf_scripts_dir}/container.py">      <properties>        <help>Container applications</help> -      <priority>1280</priority> +      <priority>450</priority>      </properties>      <children>        <tagNode name="name"> diff --git a/interface-definitions/include/interface/dhcpv6-options.xml.i b/interface-definitions/include/interface/dhcpv6-options.xml.i index 609af1a2b..5ca1d525f 100644 --- a/interface-definitions/include/interface/dhcpv6-options.xml.i +++ b/interface-definitions/include/interface/dhcpv6-options.xml.i @@ -95,6 +95,12 @@          <valueless/>        </properties>      </leafNode> +    <leafNode name="no-release"> +      <properties> +        <help>Do not send a release message on client exit</help> +        <valueless/> +      </properties> +    </leafNode>    </children>  </node>  <!-- include end --> diff --git a/interface-definitions/system-option.xml.in b/interface-definitions/system-option.xml.in index efab50a66..b1b5f7fae 100644 --- a/interface-definitions/system-option.xml.in +++ b/interface-definitions/system-option.xml.in @@ -144,6 +144,26 @@                 <valueless/>               </properties>             </leafNode> +           <leafNode name="time-format"> +            <properties> +              <help>System time-format</help> +              <completionHelp> +                <list>12-hour 24-hour</list> +              </completionHelp> +              <valueHelp> +                <format>12-hour</format> +                <description>12 hour time format</description> +              </valueHelp> +              <valueHelp> +                <format>24-hour</format> +                <description>24 hour time format</description> +              </valueHelp> +              <constraint> +                <regex>(12-hour|24-hour)</regex> +              </constraint> +            </properties> +            <defaultValue>12-hour</defaultValue> +           </leafNode>          </children>        </node>      </children> diff --git a/op-mode-definitions/include/ospfv3/detail.xml.i b/op-mode-definitions/include/frr-detail.xml.i index 4e3c91268..4edf82eab 100644 --- a/op-mode-definitions/include/ospfv3/detail.xml.i +++ b/op-mode-definitions/include/frr-detail.xml.i @@ -1,8 +1,8 @@ -<!-- included start from ospfv3/detail.xml.i --> -<node name="detail"> +<!-- included start from frr-detail.xml.i --> +<leafNode name="detail">    <properties>      <help>Show detailed information</help>    </properties>    <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command> -</node> +</leafNode>  <!-- included end --> diff --git a/op-mode-definitions/include/ospf/common.xml.i b/op-mode-definitions/include/ospf/common.xml.i index c8341bd3e..684073cc5 100644 --- a/op-mode-definitions/include/ospf/common.xml.i +++ b/op-mode-definitions/include/ospf/common.xml.i @@ -524,12 +524,7 @@    </properties>    <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>    <children> -    <node name="detail"> -      <properties> -        <help>Show detailed IPv4 OSPF neighbor information</help> -      </properties> -      <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command> -    </node> +    #include <include/frr-detail.xml.i>    </children>  </node>  <tagNode name="neighbor"> diff --git a/op-mode-definitions/include/ospfv3/adv-router-id-node-tag.xml.i b/op-mode-definitions/include/ospfv3/adv-router-id-node-tag.xml.i index a1bd67a90..806366444 100644 --- a/op-mode-definitions/include/ospfv3/adv-router-id-node-tag.xml.i +++ b/op-mode-definitions/include/ospfv3/adv-router-id-node-tag.xml.i @@ -8,7 +8,7 @@    </properties>    <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>    <children> -    #include <include/ospfv3/detail.xml.i> +    #include <include/frr-detail.xml.i>      #include <include/ospfv3/dump.xml.i>      #include <include/ospfv3/internal.xml.i>    </children> diff --git a/op-mode-definitions/include/ospfv3/adv-router.xml.i b/op-mode-definitions/include/ospfv3/adv-router.xml.i index a14fc39db..238242d11 100644 --- a/op-mode-definitions/include/ospfv3/adv-router.xml.i +++ b/op-mode-definitions/include/ospfv3/adv-router.xml.i @@ -7,7 +7,7 @@      </completionHelp>    </properties>    <children> -    #include <include/ospfv3/detail.xml.i> +    #include <include/frr-detail.xml.i>      #include <include/ospfv3/dump.xml.i>      #include <include/ospfv3/internal.xml.i>      #include <include/ospfv3/linkstate-id.xml.i> diff --git a/op-mode-definitions/include/ospfv3/border-routers.xml.i b/op-mode-definitions/include/ospfv3/border-routers.xml.i index b6fac6785..e8827a2c4 100644 --- a/op-mode-definitions/include/ospfv3/border-routers.xml.i +++ b/op-mode-definitions/include/ospfv3/border-routers.xml.i @@ -5,7 +5,7 @@    </properties>    <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>    <children> -    #include <include/ospfv3/detail.xml.i> +    #include <include/frr-detail.xml.i>    </children>  </node>  <tagNode name="border-routers"> diff --git a/op-mode-definitions/include/ospfv3/database.xml.i b/op-mode-definitions/include/ospfv3/database.xml.i index e98f9e35b..fdc45f184 100644 --- a/op-mode-definitions/include/ospfv3/database.xml.i +++ b/op-mode-definitions/include/ospfv3/database.xml.i @@ -29,7 +29,7 @@              </completionHelp>            </properties>            <children> -            #include <include/ospfv3/detail.xml.i> +            #include <include/frr-detail.xml.i>              #include <include/ospfv3/dump.xml.i>              #include <include/ospfv3/internal.xml.i>            </children> @@ -45,7 +45,7 @@        </properties>        <command>vtysh -c "show ipv6 ospf6 database * $6"</command>        <children> -        #include <include/ospfv3/detail.xml.i> +        #include <include/frr-detail.xml.i>          #include <include/ospfv3/dump.xml.i>          #include <include/ospfv3/internal.xml.i>          #include <include/ospfv3/adv-router-id-node-tag.xml.i> @@ -67,12 +67,12 @@            </properties>            <command>vtysh -c "show ipv6 ospf6 database as-external * $7"</command>            <children> -            #include <include/ospfv3/detail.xml.i> +            #include <include/frr-detail.xml.i>              #include <include/ospfv3/dump.xml.i>              #include <include/ospfv3/internal.xml.i>            </children>          </tagNode> -        #include <include/ospfv3/detail.xml.i> +        #include <include/frr-detail.xml.i>          #include <include/ospfv3/dump.xml.i>          #include <include/ospfv3/internal.xml.i>          #include <include/ospfv3/linkstate-id.xml.i> @@ -87,14 +87,14 @@          </completionHelp>        </properties>        <children> -        #include <include/ospfv3/detail.xml.i> +        #include <include/frr-detail.xml.i>          #include <include/ospfv3/dump.xml.i>          #include <include/ospfv3/internal.xml.i>          #include <include/ospfv3/self-originated.xml.i>          #include <include/ospfv3/adv-router-id-node-tag.xml.i>        </children>      </tagNode> -    #include <include/ospfv3/detail.xml.i> +    #include <include/frr-detail.xml.i>      #include <include/ospfv3/internal.xml.i>      #include <include/ospfv3/linkstate-id.xml.i>      #include <include/ospfv3/self-originated.xml.i> @@ -105,7 +105,7 @@        <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>        <children>          #include <include/ospfv3/adv-router.xml.i> -        #include <include/ospfv3/detail.xml.i> +        #include <include/frr-detail.xml.i>          #include <include/ospfv3/dump.xml.i>          #include <include/ospfv3/internal.xml.i>          #include <include/ospfv3/linkstate-id.xml.i> @@ -120,7 +120,7 @@        <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>        <children>          #include <include/ospfv3/adv-router.xml.i> -        #include <include/ospfv3/detail.xml.i> +        #include <include/frr-detail.xml.i>          #include <include/ospfv3/dump.xml.i>          #include <include/ospfv3/internal.xml.i>          #include <include/ospfv3/linkstate-id.xml.i> @@ -135,7 +135,7 @@        <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>        <children>          #include <include/ospfv3/adv-router.xml.i> -        #include <include/ospfv3/detail.xml.i> +        #include <include/frr-detail.xml.i>          #include <include/ospfv3/dump.xml.i>          #include <include/ospfv3/internal.xml.i>          #include <include/ospfv3/linkstate-id.xml.i> @@ -150,7 +150,7 @@        <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>        <children>          #include <include/ospfv3/adv-router.xml.i> -        #include <include/ospfv3/detail.xml.i> +        #include <include/frr-detail.xml.i>          #include <include/ospfv3/dump.xml.i>          #include <include/ospfv3/internal.xml.i>          #include <include/ospfv3/linkstate-id.xml.i> @@ -165,7 +165,7 @@        <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>        <children>          #include <include/ospfv3/adv-router.xml.i> -        #include <include/ospfv3/detail.xml.i> +        #include <include/frr-detail.xml.i>          #include <include/ospfv3/dump.xml.i>          #include <include/ospfv3/internal.xml.i>          #include <include/ospfv3/linkstate-id.xml.i> @@ -180,7 +180,7 @@        <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>        <children>          #include <include/ospfv3/adv-router.xml.i> -        #include <include/ospfv3/detail.xml.i> +        #include <include/frr-detail.xml.i>          #include <include/ospfv3/dump.xml.i>          #include <include/ospfv3/internal.xml.i>          #include <include/ospfv3/linkstate-id.xml.i> @@ -195,7 +195,7 @@        <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>        <children>          #include <include/ospfv3/adv-router.xml.i> -        #include <include/ospfv3/detail.xml.i> +        #include <include/frr-detail.xml.i>          #include <include/ospfv3/dump.xml.i>          #include <include/ospfv3/internal.xml.i>          #include <include/ospfv3/linkstate-id.xml.i> @@ -210,7 +210,7 @@        <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>        <children>          #include <include/ospfv3/adv-router.xml.i> -        #include <include/ospfv3/detail.xml.i> +        #include <include/frr-detail.xml.i>          #include <include/ospfv3/dump.xml.i>          #include <include/ospfv3/internal.xml.i>          #include <include/ospfv3/linkstate-id.xml.i> @@ -225,7 +225,7 @@        <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>        <children>          #include <include/ospfv3/adv-router.xml.i> -        #include <include/ospfv3/detail.xml.i> +        #include <include/frr-detail.xml.i>          #include <include/ospfv3/dump.xml.i>          #include <include/ospfv3/internal.xml.i>          #include <include/ospfv3/linkstate-id.xml.i> diff --git a/op-mode-definitions/include/ospfv3/interface.xml.i b/op-mode-definitions/include/ospfv3/interface.xml.i index 7a0b8ea48..45d5dbd45 100644 --- a/op-mode-definitions/include/ospfv3/interface.xml.i +++ b/op-mode-definitions/include/ospfv3/interface.xml.i @@ -11,7 +11,7 @@        </properties>        <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>        <children> -        #include <include/ospfv3/detail.xml.i> +        #include <include/frr-detail.xml.i>        </children>      </node>      <tagNode name="prefix"> @@ -23,7 +23,7 @@        </properties>        <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>        <children> -        #include <include/ospfv3/detail.xml.i> +        #include <include/frr-detail.xml.i>          <node name="match">            <properties>              <help>Matched interface prefix information</help> @@ -49,7 +49,7 @@        </properties>        <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>        <children> -        #include <include/ospfv3/detail.xml.i> +        #include <include/frr-detail.xml.i>        </children>      </node>      <tagNode name="prefix"> @@ -61,7 +61,7 @@        </properties>        <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>        <children> -        #include <include/ospfv3/detail.xml.i> +        #include <include/frr-detail.xml.i>          <node name="match">            <properties>              <help>Matched interface prefix information</help> diff --git a/op-mode-definitions/include/ospfv3/linkstate-id-node-tag.xml.i b/op-mode-definitions/include/ospfv3/linkstate-id-node-tag.xml.i index ee3863b35..66674e754 100644 --- a/op-mode-definitions/include/ospfv3/linkstate-id-node-tag.xml.i +++ b/op-mode-definitions/include/ospfv3/linkstate-id-node-tag.xml.i @@ -8,7 +8,7 @@    </properties>    <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>    <children> -    #include <include/ospfv3/detail.xml.i> +    #include <include/frr-detail.xml.i>      #include <include/ospfv3/dump.xml.i>      #include <include/ospfv3/internal.xml.i>      #include <include/ospfv3/self-originated.xml.i> diff --git a/op-mode-definitions/include/ospfv3/linkstate-id.xml.i b/op-mode-definitions/include/ospfv3/linkstate-id.xml.i index 9ead17c20..aa226c988 100644 --- a/op-mode-definitions/include/ospfv3/linkstate-id.xml.i +++ b/op-mode-definitions/include/ospfv3/linkstate-id.xml.i @@ -7,7 +7,7 @@      </completionHelp>    </properties>    <children> -    #include <include/ospfv3/detail.xml.i> +    #include <include/frr-detail.xml.i>      #include <include/ospfv3/dump.xml.i>      #include <include/ospfv3/internal.xml.i>    </children> diff --git a/op-mode-definitions/include/ospfv3/linkstate.xml.i b/op-mode-definitions/include/ospfv3/linkstate.xml.i index 78ef3efa1..030dc7923 100644 --- a/op-mode-definitions/include/ospfv3/linkstate.xml.i +++ b/op-mode-definitions/include/ospfv3/linkstate.xml.i @@ -4,7 +4,7 @@      <help>Show OSPFv3 linkstate routing information</help>    </properties>    <children> -    #include <include/ospfv3/detail.xml.i> +    #include <include/frr-detail.xml.i>      <tagNode name="network">        <properties>          <help>Show linkstate Network information</help> diff --git a/op-mode-definitions/include/ospfv3/neighbor.xml.i b/op-mode-definitions/include/ospfv3/neighbor.xml.i index 37859f815..b736270be 100644 --- a/op-mode-definitions/include/ospfv3/neighbor.xml.i +++ b/op-mode-definitions/include/ospfv3/neighbor.xml.i @@ -5,7 +5,7 @@    </properties>    <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>    <children> -    #include <include/ospfv3/detail.xml.i> +    #include <include/frr-detail.xml.i>      <node name="drchoice">        <properties>          <help>Show neighbor DR choice information</help> diff --git a/op-mode-definitions/include/ospfv3/route.xml.i b/op-mode-definitions/include/ospfv3/route.xml.i index 9271c9c3a..a5b97cd05 100644 --- a/op-mode-definitions/include/ospfv3/route.xml.i +++ b/op-mode-definitions/include/ospfv3/route.xml.i @@ -11,7 +11,7 @@        </properties>        <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>        <children> -        #include <include/ospfv3/detail.xml.i> +        #include <include/frr-detail.xml.i>        </children>      </node>      <node name="external-2"> @@ -20,7 +20,7 @@        </properties>        <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>        <children> -        #include <include/ospfv3/detail.xml.i> +        #include <include/frr-detail.xml.i>        </children>      </node>      <node name="inter-area"> @@ -29,7 +29,7 @@        </properties>        <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>        <children> -        #include <include/ospfv3/detail.xml.i> +        #include <include/frr-detail.xml.i>        </children>      </node>      <node name="intra-area"> @@ -38,10 +38,10 @@        </properties>        <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>        <children> -        #include <include/ospfv3/detail.xml.i> +        #include <include/frr-detail.xml.i>        </children>      </node> -    #include <include/ospfv3/detail.xml.i> +    #include <include/frr-detail.xml.i>      <node name="summary">        <properties>          <help>Show route table summary</help> @@ -71,7 +71,7 @@        </properties>        <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>        <children> -        #include <include/ospfv3/detail.xml.i> +        #include <include/frr-detail.xml.i>        </children>      </node>    </children> diff --git a/op-mode-definitions/include/ospfv3/self-originated.xml.i b/op-mode-definitions/include/ospfv3/self-originated.xml.i index 734f3f8ad..7549ccb2c 100644 --- a/op-mode-definitions/include/ospfv3/self-originated.xml.i +++ b/op-mode-definitions/include/ospfv3/self-originated.xml.i @@ -5,7 +5,7 @@    </properties>    <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>    <children> -    #include <include/ospfv3/detail.xml.i> +    #include <include/frr-detail.xml.i>      #include <include/ospfv3/dump.xml.i>      #include <include/ospfv3/internal.xml.i>    </children> diff --git a/op-mode-definitions/show-bridge.xml.in b/op-mode-definitions/show-bridge.xml.in index a272ea204..fad3f3418 100644 --- a/op-mode-definitions/show-bridge.xml.in +++ b/op-mode-definitions/show-bridge.xml.in @@ -7,12 +7,20 @@            <help>Show bridging information</help>          </properties>          <children> -          <leafNode name="vlan"> +          <node name="vlan">              <properties>                <help>View the VLAN filter settings of the bridge</help>              </properties>              <command>${vyos_op_scripts_dir}/bridge.py show_vlan</command> -          </leafNode> +            <children> +              <leafNode name="tunnel"> +                <properties> +                  <help>Show bridge VLAN tunnel mapping</help> +                </properties> +                <command>${vyos_op_scripts_dir}/bridge.py show_vlan --tunnel</command> +              </leafNode> +            </children> +          </node>          </children>        </node>        <leafNode name="bridge"> diff --git a/op-mode-definitions/show-evpn.xml.in b/op-mode-definitions/show-evpn.xml.in index 0bdb41e7a..a005cbc30 100644 --- a/op-mode-definitions/show-evpn.xml.in +++ b/op-mode-definitions/show-evpn.xml.in @@ -7,6 +7,34 @@            <help>Show Ethernet VPN (EVPN) information</help>          </properties>          <children> +          <node name="access-vlan"> +            <properties> +              <help>Access VLANs</help> +            </properties> +            <children> +              #include <include/frr-detail.xml.i> +            </children> +            <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command> +          </node> +          <tagNode name="access-vlan"> +            <properties> +              <help>Access VLANs interface name</help> +              <completionHelp> +                <script>${vyos_completion_dir}/list_interfaces --bridgeable --no-vlan-subinterfaces</script> +              </completionHelp> +            </properties> +            <children> +              <node name="node.tag"> +                <properties> +                  <help>VLAN ID</help> +                  <completionHelp> +                    <list><1-4094></list> +                  </completionHelp> +                </properties> +                <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command> +              </node> +            </children> +          </tagNode>            <node name="arp-cache">              <properties>                <help>ARP and ND cache</help> diff --git a/op-mode-definitions/webproxy.xml.in b/op-mode-definitions/webproxy.xml.in index 4e555c3d9..57df44ff8 100644 --- a/op-mode-definitions/webproxy.xml.in +++ b/op-mode-definitions/webproxy.xml.in @@ -87,6 +87,17 @@                <help>Update the webproxy blacklist database</help>              </properties>              <command>sudo ${vyos_op_scripts_dir}/webproxy_update_blacklist.sh --update-blacklist</command> +            <children> +              <tagNode name="vrf"> +                <properties> +                  <help>Update webproxy blacklist database via specified VRF</help> +                  <completionHelp> +                    <path>vrf name</path> +                  </completionHelp> +                </properties> +                <command>sudo ${vyos_op_scripts_dir}/webproxy_update_blacklist.sh --update-blacklist --vrf "${5}" </command> +              </tagNode> +            </children>            </node>          </children>        </node> diff --git a/python/vyos/firewall.py b/python/vyos/firewall.py index 2793b201c..903cc8535 100644 --- a/python/vyos/firewall.py +++ b/python/vyos/firewall.py @@ -304,7 +304,7 @@ def parse_rule(rule_conf, fw_name, rule_id, ip_name):      if 'ipsec' in rule_conf:          if 'match_ipsec' in rule_conf['ipsec']:              output.append('meta ipsec == 1') -        if 'match_non_ipsec' in rule_conf['ipsec']: +        if 'match_none' in rule_conf['ipsec']:              output.append('meta ipsec == 0')      if 'fragment' in rule_conf: diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py index 120f2131b..99ddb2021 100644 --- a/python/vyos/ifconfig/interface.py +++ b/python/vyos/ifconfig/interface.py @@ -1288,9 +1288,11 @@ class Interface(Control):          ifname = self.ifname          config_file = f'/run/dhcp6c/dhcp6c.{ifname}.conf' +        options_file = f'/run/dhcp6c/dhcp6c.{ifname}.options'          systemd_service = f'dhcp6c@{ifname}.service'          if enable and 'disable' not in self._config: +            render(options_file, 'dhcp-client/dhcp6c_daemon-options.j2', self._config)              render(config_file, 'dhcp-client/ipv6.j2', self._config)              # We must ignore any return codes. This is required to enable diff --git a/smoketest/scripts/cli/base_interfaces_test.py b/smoketest/scripts/cli/base_interfaces_test.py index b4afac0e2..a3868fa70 100644 --- a/smoketest/scripts/cli/base_interfaces_test.py +++ b/smoketest/scripts/cli/base_interfaces_test.py @@ -791,6 +791,7 @@ class BasicInterfaceTest:                  # Enable DHCPv6 client                  self.cli_set(path + ['address', 'dhcpv6']) +                self.cli_set(path + ['dhcpv6-options', 'no-release'])                  self.cli_set(path + ['dhcpv6-options', 'rapid-commit'])                  self.cli_set(path + ['dhcpv6-options', 'parameters-only'])                  self.cli_set(path + ['dhcpv6-options', 'duid', duid]) @@ -798,6 +799,9 @@ class BasicInterfaceTest:              self.cli_commit() +            dhcp6c_options = read_file(f'/run/dhcp6c/dhcp6c.{interface}.options') +            self.assertIn(f'-n', dhcp6c_options) +              duid_base = 10              for interface in self._interfaces:                  duid = '00:01:00:01:27:71:db:f0:00:50:00:00:00:{}'.format(duid_base) diff --git a/src/conf_mode/system-login.py b/src/conf_mode/system-login.py index afd75913e..82941e0c0 100755 --- a/src/conf_mode/system-login.py +++ b/src/conf_mode/system-login.py @@ -54,7 +54,7 @@ MAX_USER_UID: int = 59999  # LOGIN_TIMEOUT from /etc/loign.defs minus 10 sec  MAX_RADIUS_TIMEOUT: int = 50  # MAX_RADIUS_TIMEOUT divided by 2 sec (minimum recomended timeout) -MAX_RADIUS_COUNT: int = 25 +MAX_RADIUS_COUNT: int = 8  # Maximum number of supported TACACS servers  MAX_TACACS_COUNT: int = 8 diff --git a/src/conf_mode/system-option.py b/src/conf_mode/system-option.py index 5172b492e..1495e9223 100755 --- a/src/conf_mode/system-option.py +++ b/src/conf_mode/system-option.py @@ -1,6 +1,6 @@  #!/usr/bin/env python3  # -# Copyright (C) 2019-2022 VyOS maintainers and contributors +# Copyright (C) 2019-2023 VyOS maintainers and contributors  #  # This program is free software; you can redistribute it and/or modify  # it under the terms of the GNU General Public License version 2 or later as @@ -36,6 +36,11 @@ airbag.enable()  curlrc_config = r'/etc/curlrc'  ssh_config = r'/etc/ssh/ssh_config.d/91-vyos-ssh-client-options.conf'  systemd_action_file = '/lib/systemd/system/ctrl-alt-del.target' +time_format_to_locale = { +    '12-hour': 'en_US.UTF-8', +    '24-hour': 'en_GB.UTF-8' +} +  def get_config(config=None):      if config: @@ -143,6 +148,11 @@ def apply(options):      else:        cmd('systemctl disable root-partition-auto-resize.service') +    # Time format 12|24-hour +    if 'time_format' in options: +        time_format = time_format_to_locale.get(options['time_format']) +        cmd(f'localectl set-locale LC_TIME={time_format}') +  if __name__ == '__main__':      try:          c = get_config() diff --git a/src/op_mode/bridge.py b/src/op_mode/bridge.py index 1834b9cc9..185db4f20 100755 --- a/src/op_mode/bridge.py +++ b/src/op_mode/bridge.py @@ -29,7 +29,6 @@ from vyos.utils.dict import dict_search  import vyos.opmode -  def _get_json_data():      """      Get bridge data format JSON @@ -46,11 +45,14 @@ def _get_raw_data_summary():      return data_dict -def _get_raw_data_vlan(): +def _get_raw_data_vlan(tunnel:bool=False):      """      :returns dict      """ -    json_data = cmd('bridge --json --compressvlans vlan show') +    show = 'show' +    if tunnel: +        show = 'tunnel' +    json_data = cmd(f'bridge --json --compressvlans vlan {show}')      data_dict = json.loads(json_data)      return data_dict @@ -134,10 +136,34 @@ def _get_formatted_output_vlan(data):              flags = ', '.join(flags_raw if isinstance(flags_raw,list) else "").lower()              data_entries.append([interface, vlan, flags]) -    headers = ["Interface", "Vlan", "Flags"] +    headers = ["Interface", "VLAN", "Flags"]      output = tabulate(data_entries, headers)      return output +def _get_formatted_output_vlan_tunnel(data): +    data_entries = [] +    for entry in data: +        interface = entry.get('ifname') +        first = True +        for tunnel_entry in entry.get('tunnels'): +            vlan = tunnel_entry.get('vlan') +            vni = tunnel_entry.get('tunid') +            if first: +                data_entries.append([interface, vlan, vni]) +                first = False +            else: +                # Group by VXLAN interface only - no need to repeat +                # VXLAN interface name for every VLAN <-> VNI mapping +                # +                # Interface      VLAN    VNI +                # -----------  ------  ----- +                # vxlan0          100    100 +                #                 200    200 +                data_entries.append(['', vlan, vni]) + +    headers = ["Interface", "VLAN", "VNI"] +    output = tabulate(data_entries, headers) +    return output  def _get_formatted_output_fdb(data):      data_entries = [] @@ -192,12 +218,15 @@ def show(raw: bool):          return _get_formatted_output_summary(bridge_data) -def show_vlan(raw: bool): -    bridge_vlan = _get_raw_data_vlan() +def show_vlan(raw: bool, tunnel: typing.Optional[bool]): +    bridge_vlan = _get_raw_data_vlan(tunnel)      if raw:          return bridge_vlan      else: -        return _get_formatted_output_vlan(bridge_vlan) +        if tunnel: +            return _get_formatted_output_vlan_tunnel(bridge_vlan) +        else: +            return _get_formatted_output_vlan(bridge_vlan)  def show_fdb(raw: bool, interface: str): diff --git a/src/op_mode/webproxy_update_blacklist.sh b/src/op_mode/webproxy_update_blacklist.sh index 4fb9a54c6..05ea86f9e 100755 --- a/src/op_mode/webproxy_update_blacklist.sh +++ b/src/op_mode/webproxy_update_blacklist.sh @@ -45,6 +45,9 @@ do      --auto-update-blacklist)          auto="yes"          ;; +    --vrf) +        vrf="yes" +        ;;      (-*) echo "$0: error - unrecognized option $1" 1>&2; exit 1;;      (*) break;;      esac @@ -76,7 +79,11 @@ fi  if [[ -n $update ]] && [[ $update -eq "yes" ]]; then      tmp_blacklists='/tmp/blacklists.gz' -    curl -o $tmp_blacklists $blacklist_url +    if [[ -n $vrf ]] && [[ $vrf -eq "yes" ]]; then +        sudo ip vrf exec $1 curl -o $tmp_blacklists $blacklist_url +    else +        curl -o $tmp_blacklists $blacklist_url +    fi      if [ $? -ne 0 ]; then          echo "Unable to download [$blacklist_url]!"          exit 1 diff --git a/src/systemd/dhcp6c@.service b/src/systemd/dhcp6c@.service index 9a97ee261..495cb7e26 100644 --- a/src/systemd/dhcp6c@.service +++ b/src/systemd/dhcp6c@.service @@ -2,14 +2,16 @@  Description=WIDE DHCPv6 client on %i  Documentation=man:dhcp6c(8) man:dhcp6c.conf(5)  ConditionPathExists=/run/dhcp6c/dhcp6c.%i.conf +ConditionPathExists=/run/dhcp6c/dhcp6c.%i.options  After=vyos-router.service  StartLimitIntervalSec=0  [Service]  WorkingDirectory=/run/dhcp6c +EnvironmentFile=-/run/dhcp6c/dhcp6c.%i.options  Type=forking  PIDFile=/run/dhcp6c/dhcp6c.%i.pid -ExecStart=/usr/sbin/dhcp6c -D -k /run/dhcp6c/dhcp6c.%i.sock -c /run/dhcp6c/dhcp6c.%i.conf -p /run/dhcp6c/dhcp6c.%i.pid %i +ExecStart=/usr/sbin/dhcp6c $DHCP6C_OPTS  Restart=on-failure  RestartSec=20 | 
