Can anyone explain the purpose of the vlan-tagging statement under interfaces interface-name ? The documentation says it exists "to enable the reception and transmission of 802.1Q VLAN-tagged frames on the interface"
1. How is this any different from simply configuring set interfaces family ethernet-switching interface-name port-mode trunk?
2. The documentation states "On EX Series switches except for EX4300 and EX9200 switches, the vlan-tagging and family ethernet-switching statements cannot be configured on the same interface." This suggests that it can be configured together on the EX4300 and EX9200 -- why would I want to do this and what purpose does it serve?
The vlan-tagging statement is used so you can configure logical units aka layer 3 subinterfaces.
That way you can configure ge-0/0/1 unit 0
ge-0/0/1 unit 0
ge-0/0/1 unit 1
ge-0/0/1 unit 2
ge-0/0/1 unit 4094 (if your device supports it)
When you configure the subinterfaces, you will then add a vlan-d tag to each of the subinterfaces created. This allows these sub-interfaces to recieve untagged packets.
How is this any different from simply configuring set interfaces family ethernet-switching interface-name port-mode trunk?
Ethernet-switching is a layer 2 concept. With the trunk port, it will only accept frames that have a vlan tag identifier.
The nomenclature vlan-tagging maybe what is misdirecting the understanding
The second part of your question, seems confusing.
"2. The documentation states "On EX Series switches except for EX4300 and EX9200 switches, the vlan-tagging and family ethernet-switching statements cannot be configured on the same interface." This suggests that it can be configured together on the EX4300 and EX9200 -- why would I want to do this and what purpose does it serve?"
Some switches allow the configuration of vlan-tagging and flexible-vlantagging statement at the same time. But I don't know what the documentation means.
Got it, thank you--your explanation makes sense. vlan-tagging is for layer 3 subinterfaces. I agree the second point is still confiusing.
To understand some of this, you need to take a historical perspective of Juniper/Junos. Originally Junos was written for L3 operation only. Later L2 support was added, and with it the need to support things like VLANs (Bridge Domians) and tagging, IRB, etc. Some of this support came via flexable-vlan-tagging syntax.
Later Juniper introduced EX switches which were L2 based, with L3 capabilities, so VLANs and access/trunk (tagged) ports were standard syntax. This syntax differed from orginal Junos M/MX CLI syntax. These switches did NOT support concept or syntax of flexable-vlan-tagging - this was M/MX/PTX only.
With the introduction of next-gen EX models (those that now run ELS) Juniper standardized on a single CLI which favored original M/MX style, with slight modifications. So now all of the newer platforms, EX9200 and EX4300 being 2 of them, support the original M/MX syntax/CLI. The flexable-vlan-tagging support is on all ELS platforms, not just EX9200/EX4300.
Hopefully this makes some sense as to 2nd doc statement.