.. _clicmd_src_vnet_l2: =============================================================== Layer 2 CLI =============================================================== bvi create ------------------------------------------------------------------------- .. code-block:: console bvi create [mac ] [instance ] Create a BVI interface. Optionally, a MAC Address can be provided. If not provided, 0b:0b::00:00:00: will be used. The following two command syntaxes are equivalent: .. code-block:: console bvi create [mac ] [instance ] Example of how to create a bvi interface: .. code-block:: console bvi create Declaration: ``l2_bvi_create_command`` `src/vnet/l2/l2_bvi.c line 277 `_ Implementation: ``l2_bvi_create_cli`` bvi delete ------------------------------------------------------------------------- .. code-block:: console bvi delete Delete a BVI interface. The following two command syntaxes are equivalent: .. code-block:: console bvi delete Example of how to create a bvi interface: .. code-block:: console bvi delete bvi0 Declaration: ``l2_bvi_delete_command`` `src/vnet/l2/l2_bvi.c line 328 `_ Implementation: ``l2_bvi_delete_cli`` clear l2fib ------------------------------------------------------------------------- .. code-block:: console clear l2fib This command clears all the MAC Address entries from the L2 FIB table. Example of how to clear the L2 FIB Table: .. code-block:: console clear l2fib Example to show the L2 FIB Table has been cleared: .. code-block:: console show l2fib verbose no l2fib entries Declaration: ``clear_l2fib_cli`` `src/vnet/l2/l2_fib.c line 420 `_ Implementation: ``clear_l2fib`` create bridge-domain ------------------------------------------------------------------------- .. code-block:: console create bridge-domain [learn <0|1>] [forward <0|1>] [uu-flood <0|1>] [flood <0|1>] [arp-term <0|1>] [arp-ufwd <0|1>] [mac-age ] [bd-tag ] [del] Create/Delete bridge-domain instance Example of creating bridge-domain 1: .. code-block:: console create bridge-domain 1 bridge-domain 1 Example of creating bridge-domain 2 with enabling arp-term, mac-age 60: .. code-block:: console create bridge-domain 2 arp-term 1 mac-age 60 bridge-domain 2 vpp# show bridge-domain ID Index BSN Age(min) Learning U-Forwrd UU-Flood Flooding ARP-Term BVI-Intf 0 0 0 off off off off off off local0 1 1 0 off on on off on off N/A 2 2 0 60 on on off on on N/A Example of delete bridge-domain 1: .. code-block:: console create bridge-domain 1 del Declaration: ``bd_create_cli`` `src/vnet/l2/l2_bd.c line 1598 `_ Implementation: ``bd_add_del_command_fn`` l2 rewrite entry ------------------------------------------------------------------------- .. code-block:: console l2 rewrite entry [index ] [mask ] [value ] [skip ] [del] Layer 2-Rewrite node uses classify tables to match packets. Then, using the provisioned mask and value, modifies the packet header. practical example. Declaration: ``l2_rw_entry_cli`` `src/vnet/l2/l2_rw.c line 405 `_ Implementation: ``l2_rw_entry_cli_fn`` l2fib add ------------------------------------------------------------------------- .. code-block:: console l2fib add filter | [static | bvi] This command adds a MAC Address entry to the L2 FIB table of an existing bridge-domain. The MAC Address can be static or dynamic. This command also allows a filter to be added, such that packets with given MAC Addresses (source mac or destination mac match) are dropped. Example of how to add a dynamic MAC Address entry to the L2 FIB table of a bridge-domain (where 200 is the bridge-domain-id): .. code-block:: console l2fib add 52:54:00:53:18:33 200 GigabitEthernet0/8/0.200 Example of how to add a static MAC Address entry to the L2 FIB table of a bridge-domain (where 200 is the bridge-domain-id): .. code-block:: console l2fib add 52:54:00:53:18:55 200 GigabitEthernet0/8/0.200 static Example of how to add a filter such that a packet with the given MAC Address will be dropped in a given bridge-domain (where 200 is the bridge-domain-id): .. code-block:: console l2fib add 52:54:00:53:18:77 200 filter Example of show command of the provisioned MAC Addresses and filters: .. code-block:: console show l2fib verbose Mac Address BD Idx Interface Index static filter bvi refresh timestamp 52:54:00:53:18:33 1 GigabitEthernet0/8/0.200 3 0 0 0 0 0 52:54:00:53:18:55 1 GigabitEthernet0/8/0.200 3 1 0 0 0 0 52:54:00:53:18:77 1 N/A -1 1 1 0 0 0 3 l2fib entries Declaration: ``l2fib_add_cli`` `src/vnet/l2/l2_fib.c line 597 `_ Implementation: ``l2fib_add`` l2fib del ------------------------------------------------------------------------- .. code-block:: console l2fib del [] This command deletes an existing MAC Address entry from the L2 FIB table of an existing bridge-domain. Example of how to delete a MAC Address entry from the L2 FIB table of a bridge-domain (where 200 is the bridge-domain-id): .. code-block:: console l2fib del 52:54:00:53:18:33 200 Declaration: ``l2fib_del_cli`` `src/vnet/l2/l2_fib.c line 837 `_ Implementation: ``l2fib_del`` l2fib flush-mac all ------------------------------------------------------------------------- .. code-block:: console l2fib flush-mac all This command kick off ager to delete all existing MAC Address entries, except static ones, associated with an interface from the L2 FIB table. Example of how to flush MAC Address entries learned on an interface from the L2 FIB table: .. code-block:: console l2fib flush-mac interface GigabitEthernet2/1/0 Declaration: ``l2fib_flush_mac_all_cli`` `src/vnet/l2/l2_fib.c line 981 `_ Implementation: ``l2fib_flush_mac_all`` l2fib flush-mac bridge-domain ------------------------------------------------------------------------- .. code-block:: console l2fib flush-mac bridge-domain This command kick off ager to delete all existing MAC Address entries, except static ones, in a bridge domain from the L2 FIB table. Example of how to flush MAC Address entries learned in a bridge domain from the L2 FIB table: .. code-block:: console l2fib flush-mac bridge-domain 1000 Declaration: ``l2fib_flush_mac_bd_cli`` `src/vnet/l2/l2_fib.c line 1046 `_ Implementation: ``l2fib_flush_mac_bd`` l2fib flush-mac interface ------------------------------------------------------------------------- .. code-block:: console l2fib flush-mac interface This command kick off ager to delete all existing MAC Address entries, except static ones, associated with an interface from the L2 FIB table. Example of how to flush MAC Address entries learned on an interface from the L2 FIB table: .. code-block:: console l2fib flush-mac interface GigabitEthernet2/1/0 Declaration: ``l2fib_flush_mac_int_cli`` `src/vnet/l2/l2_fib.c line 997 `_ Implementation: ``l2fib_flush_mac_int`` set bridge-domain arp entry ------------------------------------------------------------------------- .. code-block:: console set bridge-domain arp entry [ [del] | del-all] Add an ARP entry to an existing bridge-domain. Example of how to add an ARP entry (where 200 is the bridge-domain-id): .. code-block:: console set bridge-domain arp entry 200 192.168.72.45 52:54:00:3b:83:1a Example of how to delete an ARP entry (where 200 is the bridge-domain-id): .. code-block:: console set bridge-domain arp entry 200 192.168.72.45 52:54:00:3b:83:1a del Declaration: ``bd_arp_entry_cli`` `src/vnet/l2/l2_bd.c line 1123 `_ Implementation: ``bd_arp_entry`` set bridge-domain arp term ------------------------------------------------------------------------- .. code-block:: console set bridge-domain arp term [disable] Modify whether or not an existing bridge-domain should terminate and respond to ARP Requests. ARP Termination is disabled by default. Example of how to enable ARP termination (where 200 is the bridge-domain-id): .. code-block:: console set bridge-domain arp term 200 Example of how to disable ARP termination (where 200 is the bridge-domain-id): .. code-block:: console set bridge-domain arp term 200 disable Declaration: ``bd_arp_term_cli`` `src/vnet/l2/l2_bd.c line 925 `_ Implementation: ``bd_arp_term`` set bridge-domain arp-ufwd ------------------------------------------------------------------------- .. code-block:: console set bridge-domain arp-ufwd [disable] Layer 2 arp-unicast forwarding can be enabled and disabled on each bridge-domain. It is disabled by default. Example of how to enable arp-unicast forwarding (where 200 is the bridge-domain-id): .. code-block:: console set bridge-domain arp-ufwd 200 Example of how to disable arp-unicast forwarding (where 200 is the bridge-domain-id): .. code-block:: console set bridge-domain arp-ufwd 200 disable Declaration: ``bd_arp_ufwd_cli`` `src/vnet/l2/l2_bd.c line 746 `_ Implementation: ``bd_arp_ufwd`` set bridge-domain default-learn-limit ------------------------------------------------------------------------- .. code-block:: console set bridge-domain default-learn-limit Declaration: ``bd_default_learn_limit_cli`` `src/vnet/l2/l2_bd.c line 487 `_ Implementation: ``bd_default_learn_limit`` set bridge-domain flood ------------------------------------------------------------------------- .. code-block:: console set bridge-domain flood [disable] Layer 2 flooding can be enabled and disabled on each interface and on each bridge-domain. Use this command to manage bridge-domains. It is enabled by default. Example of how to enable flooding (where 200 is the bridge-domain-id): .. code-block:: console set bridge-domain flood 200 Example of how to disable flooding (where 200 is the bridge-domain-id): .. code-block:: console set bridge-domain flood 200 disable Declaration: ``bd_flood_cli`` `src/vnet/l2/l2_bd.c line 616 `_ Implementation: ``bd_flood`` set bridge-domain forward ------------------------------------------------------------------------- .. code-block:: console set bridge-domain forward [disable] Layer 2 unicast forwarding can be enabled and disabled on each interface and on each bridge-domain. Use this command to manage bridge-domains. It is enabled by default. Example of how to enable forwarding (where 200 is the bridge-domain-id): .. code-block:: console set bridge-domain forward 200 Example of how to disable forwarding (where 200 is the bridge-domain-id): .. code-block:: console set bridge-domain forward 200 disable Declaration: ``bd_fwd_cli`` `src/vnet/l2/l2_bd.c line 551 `_ Implementation: ``bd_fwd`` set bridge-domain learn ------------------------------------------------------------------------- .. code-block:: console set bridge-domain learn [disable] Layer 2 learning can be enabled and disabled on each interface and on each bridge-domain. Use this command to manage bridge-domains. It is enabled by default. Example of how to enable learning (where 200 is the bridge-domain-id): .. code-block:: console set bridge-domain learn 200 Example of how to disable learning (where 200 is the bridge-domain-id): .. code-block:: console set bridge-domain learn 200 disable Declaration: ``bd_learn_cli`` `src/vnet/l2/l2_bd.c line 458 `_ Implementation: ``bd_learn`` set bridge-domain learn-limit ------------------------------------------------------------------------- .. code-block:: console set bridge-domain learn-limit Declaration: ``bd_learn_limit_cli`` `src/vnet/l2/l2_bd.c line 907 `_ Implementation: ``bd_learn_limit`` set bridge-domain mac-age ------------------------------------------------------------------------- .. code-block:: console set bridge-domain mac-age Layer 2 mac aging can be enabled and disabled on each bridge-domain. Use this command to set or disable mac aging on specific bridge-domains. It is disabled by default. Example of how to set mac aging (where 200 is the bridge-domain-id and 5 is aging time in minutes): .. code-block:: console set bridge-domain mac-age 200 5 Example of how to disable mac aging (where 200 is the bridge-domain-id): .. code-block:: console set bridge-domain flood 200 0 Declaration: ``bd_mac_age_cli`` `src/vnet/l2/l2_bd.c line 858 `_ Implementation: ``bd_mac_age`` set bridge-domain rewrite ------------------------------------------------------------------------- .. code-block:: console set bridge-domain rewrite [disable] Layer 2-Rewrite node uses classify tables to match packets. Then, using the provisioned mask and value, modifies the packet header. practical example. Declaration: ``l2_rw_set_cli`` `src/vnet/l2/l2_rw.c line 598 `_ Implementation: ``l2_rw_set_cli_fn`` set bridge-domain uu-flood ------------------------------------------------------------------------- .. code-block:: console set bridge-domain uu-flood [disable] Layer 2 unknown-unicast flooding can be enabled and disabled on each bridge-domain. It is enabled by default. Example of how to enable unknown-unicast flooding (where 200 is the bridge-domain-id): .. code-block:: console set bridge-domain uu-flood 200 Example of how to disable unknown-unicast flooding (where 200 is the bridge-domain-id): .. code-block:: console set bridge-domain uu-flood 200 disable Declaration: ``bd_uu_flood_cli`` `src/vnet/l2/l2_bd.c line 681 `_ Implementation: ``bd_uu_flood`` set interface l2 bridge ------------------------------------------------------------------------- .. code-block:: console set interface l2 bridge [bvi|uu-fwd] [shg] Use this command put an interface into Layer 2 bridge domain. If a bridge-domain with the provided bridge-domain-id does not exist, it will be created. Interfaces in a bridge-domain forward packets to other interfaces in the same bridge-domain based on destination mac address. To remove an interface from a the Layer 2 bridge domain, put the interface in a different mode, for example Layer 3 mode. Optionally, an interface can be added to a Layer 2 bridge-domain as a Bridged Virtual Interface (bvi). Only one interface in a Layer 2 bridge-domain can be a bvi. Optionally, a split-horizon group can also be specified. This defaults to 0 if not specified. Example of how to configure a Layer 2 bridge-domain with three interfaces (where 200 is the bridge-domain-id): .. code-block:: console set interface l2 bridge GigabitEthernet0/8/0.200 200 This interface is added a BVI interface: .. code-block:: console set interface l2 bridge GigabitEthernet0/9/0.200 200 bvi This interface also has a split-horizon group of 1 specified: .. code-block:: console set interface l2 bridge GigabitEthernet0/a/0.200 200 1 Example of how to remove an interface from a Layer2 bridge-domain: .. code-block:: console set interface l3 GigabitEthernet0/a/0.200 Declaration: ``int_l2_bridge_cli`` `src/vnet/l2/l2_input.c line 650 `_ Implementation: ``int_l2_bridge`` set interface l2 efp-filter ------------------------------------------------------------------------- .. code-block:: console set interface l2 efp-filter [disable] EFP filtering is a basic switch feature which prevents an interface from transmitting a packet that doesn't match the interface's ingress match criteria. The check has two parts, one performed before egress vlan tag rewrite and one after. This command enables or disables the EFP filtering for a given sub-interface. Example of how to enable a Layer 2 efp-filter on a sub-interface: .. code-block:: console set interface l2 efp-filter GigabitEthernet0/8/0.200 Example of how to disable a Layer 2 efp-filter on a sub-interface: .. code-block:: console set interface l2 efp-filter GigabitEthernet0/8/0.200 disable Declaration: ``int_l2_efp_filter_cli`` `src/vnet/l2/l2_efp_filter.c line 563 `_ Implementation: ``int_l2_efp_filter`` set interface l2 flood ------------------------------------------------------------------------- .. code-block:: console set interface l2 flood [disable] Layer 2 flooding can be enabled and disabled on each interface and on each bridge-domain. Use this command to manage interfaces. It is enabled by default. Example of how to enable flooding: .. code-block:: console set interface l2 flood GigabitEthernet0/8/0 Example of how to disable flooding: .. code-block:: console set interface l2 flood GigabitEthernet0/8/0 disable Declaration: ``int_flood_cli`` `src/vnet/l2/l2_flood.c line 472 `_ Implementation: ``int_flood`` set interface l2 forward ------------------------------------------------------------------------- .. code-block:: console set interface l2 forward [disable] Layer 2 unicast forwarding can be enabled and disabled on each interface and on each bridge-domain. Use this command to manage interfaces. It is enabled by default. Example of how to enable forwarding: .. code-block:: console set interface l2 forward GigabitEthernet0/8/0 Example of how to disable forwarding: .. code-block:: console set interface l2 forward GigabitEthernet0/8/0 disable Declaration: ``int_fwd_cli`` `src/vnet/l2/l2_fwd.c line 531 `_ Implementation: ``int_fwd`` set interface l2 input classify ------------------------------------------------------------------------- .. code-block:: console set interface l2 input classify intfc [ip4-table ] [ip6-table ] [other-table ] Configure l2 input classification. .. code-block:: console set interface l2 input classify intfc [ip4-table ] [ip6-table ] [other-table ] practical example. Declaration: ``int_l2_input_classify_cli`` `src/vnet/l2/l2_input_classify.c line 646 `_ Implementation: ``int_l2_input_classify_command_fn`` set interface l2 learn ------------------------------------------------------------------------- .. code-block:: console set interface l2 learn [disable] Layer 2 learning can be enabled and disabled on each interface and on each bridge-domain. Use this command to manage interfaces. It is enabled by default. Example of how to enable learning: .. code-block:: console set interface l2 learn GigabitEthernet0/8/0 Example of how to disable learning: .. code-block:: console set interface l2 learn GigabitEthernet0/8/0 disable Declaration: ``int_learn_cli`` `src/vnet/l2/l2_learn.c line 544 `_ Implementation: ``int_learn`` set interface l2 output classify ------------------------------------------------------------------------- .. code-block:: console set interface l2 output classify intfc <> [ip4-table ] [ip6-table ] [other-table ] Configure Layer 2 output classification. .. code-block:: console set interface l2 output classify intfc [ip4-table ] [ip6-table ] [other-table ] practical example. Declaration: ``int_l2_output_classify_cli`` `src/vnet/l2/l2_output_classify.c line 638 `_ Implementation: ``int_l2_output_classify_command_fn`` set interface l2 pbb-tag-rewrite ------------------------------------------------------------------------- .. code-block:: console set interface l2 pbb-tag-rewrite [disable | pop | push | translate_pbb_stag dmac
smac
s_id [b_vlanid ]] Declaration: ``int_l2_pbb_vtr_cli`` `src/vnet/l2/l2_vtr.c line 820 `_ Implementation: ``int_l2_pbb_vtr`` set interface l2 rewrite ------------------------------------------------------------------------- .. code-block:: console set interface l2 rewrite [table ] [miss-index ] Layer 2-Rewrite node uses classify tables to match packets. Then, using the provisioned mask and value, modifies the packet header. practical example. Declaration: ``l2_rw_interface_cli`` `src/vnet/l2/l2_rw.c line 479 `_ Implementation: ``l2_rw_interface_cli_fn`` set interface l2 tag-rewrite ------------------------------------------------------------------------- .. code-block:: console set interface l2 tag-rewrite [disable | pop {1|2} | push {dot1q|dot1ad} ] VLAN tag rewrite provides the ability to change the VLAN tags on a packet. Existing tags can be popped, new tags can be pushed, and existing tags can be swapped with new tags. The rewrite feature is attached to a subinterface as input and output operations. The input operation is explicitly configured. The output operation is the symmetric opposite and is automatically derived from the input operation. **POP:** For pop operations, the subinterface encapsulation (the vlan tags specified when it was created) must have at least the number of popped tags. e.g. the \"pop 2\" operation would be rejected on a single-vlan interface. The output tag-rewrite operation for pops is to push the specified number of vlan tags onto the packet. The pushed tag values are the ones in the subinterface encapsulation. **PUSH:** For push operations, the ethertype is also specified. The output tag-rewrite operation for pushes is to pop the same number of tags off the packet. If the packet doesn't have enough tags it is dropped. By default a subinterface has no tag-rewrite. To return a subinterface to this state use: .. code-block:: console set interface l2 tag-rewrite GigabitEthernet0/8/0.200 disable To pop vlan tags off packets received from a subinterface, use: .. code-block:: console set interface l2 tag-rewrite GigabitEthernet0/8/0.200 pop 1 .. code-block:: console set interface l2 tag-rewrite GigabitEthernet0/8/0.200 pop 2 To push one or two vlan tags onto packets received from an interface, use: .. code-block:: console set interface l2 tag-rewrite GigabitEthernet0/8/0.200 push dot1q 100 .. code-block:: console set interface l2 tag-rewrite GigabitEthernet0/8/0.200 push dot1ad 100 150 Tags can also be translated, which is basically a combination of a pop and push. .. code-block:: console set interface l2 tag-rewrite GigabitEthernet0/8/0.200 translate 1-1 dot1ad 100 .. code-block:: console set interface l2 tag-rewrite GigabitEthernet0/8/0.200 translate 2-2 dot1ad 100 150 .. code-block:: console set interface l2 tag-rewrite GigabitEthernet0/8/0.200 translate 1-2 dot1q 100 .. code-block:: console set interface l2 tag-rewrite GigabitEthernet0/8/0.200 translate 2-1 dot1q 100 150 To display the VLAN Tag settings, show the associate bridge-domain: .. code-block:: console show bridge-domain 200 detail ID Index Learning U-Forwrd UU-Flood Flooding ARP-Term BVI-Intf 200 1 on on on on off N/A Interface Index SHG BVI VLAN-Tag-Rewrite GigabitEthernet0/8/0.200 5 0 - trans-1-1 dot1ad 100 GigabitEthernet0/9/0.200 4 0 - none GigabitEthernet0/a/0.200 6 0 - none Declaration: ``int_l2_vtr_cli`` `src/vnet/l2/l2_vtr.c line 674 `_ Implementation: ``int_l2_vtr`` set interface l2 xconnect ------------------------------------------------------------------------- .. code-block:: console set interface l2 xconnect Use this command put an interface into Layer 2 cross-connect mode. Both interfaces must be in this mode for bi-directional traffic. All packets received on one interface will be transmitted to the other. To remove the Layer 2 cross-connect, put the interface in a different mode, for example Layer 3 mode. Example of how to configure a Layer2 cross-connect between two interfaces: .. code-block:: console set interface l2 xconnect GigabitEthernet0/8/0.300 GigabitEthernet0/9/0.300 .. code-block:: console set interface l2 xconnect GigabitEthernet0/9/0.300 GigabitEthernet0/8/0.300 Example of how to remove a Layer2 cross-connect: .. code-block:: console set interface l3 GigabitEthernet0/8/0.300 .. code-block:: console set interface l3 GigabitEthernet0/9/0.300 Declaration: ``int_l2_xc_cli`` `src/vnet/l2/l2_input.c line 716 `_ Implementation: ``int_l2_xc`` set interface l2 xcrw ------------------------------------------------------------------------- .. code-block:: console set interface l2 xcrw next [del] [tx-fib-id ] [ipv6] rw Add or delete a Layer 2 to Layer 3 rewrite cross-connect. This is used to hook Layer 2 interface(s) up to the Layer 3 stack in arbitrary ways. For example, cross-connect an L2 interface or (future) bridge to an mpls-o-gre tunnel. Set up the L2 rewrite string as shown in mpls_gre_rewrite, and use \"mpls-post-rewrite\" to fix the GRE IP header checksum and length fields. practical example. Declaration: ``set_l2_xcrw_command`` `src/vnet/l2/l2_xcrw.c line 500 `_ Implementation: ``set_l2_xcrw_command_fn`` set l2fib scan-delay ------------------------------------------------------------------------- .. code-block:: console set l2fib scan-delay This command set scan delay (in 1/10s unit) Declaration: ``l2fib_set_scan_delay_cli`` `src/vnet/l2/l2_fib.c line 868 `_ Implementation: ``l2fib_set_scan_delay`` show bridge-domain ------------------------------------------------------------------------- .. code-block:: console show bridge-domain [bridge-domain-id [detail|int|arp|bd-tag]] Show a summary of all the bridge-domain instances or detailed view of a single bridge-domain. Bridge-domains are created by adding an interface to a bridge using the ``set interface l2 bridge`` command. Example of displaying all bridge-domains: .. code-block:: console show bridge-domain ID Index Learning U-Forwrd UU-Flood Flooding ARP-Term BVI-Intf 0 0 off off off off off local0 200 1 on on on on off N/A Example of displaying details of a single bridge-domains: .. code-block:: console show bridge-domain 200 detail ID Index Learning U-Forwrd UU-Flood Flooding ARP-Term BVI-Intf 200 1 on on on on off N/A Interface Index SHG BVI VLAN-Tag-Rewrite GigabitEthernet0/8/0.200 3 0 - none GigabitEthernet0/9/0.200 4 0 - none Declaration: ``bd_show_cli`` `src/vnet/l2/l2_bd.c line 1353 `_ Implementation: ``bd_show`` show l2 rewrite entries ------------------------------------------------------------------------- .. code-block:: console show l2 rewrite entries Layer 2-Rewrite node uses classify tables to match packets. Then, using the provisioned mask and value, modifies the packet header. practical example. Declaration: ``l2_rw_show_entries_cli`` `src/vnet/l2/l2_rw.c line 548 `_ Implementation: ``l2_rw_show_entries_cli_fn`` show l2 rewrite interfaces ------------------------------------------------------------------------- .. code-block:: console show l2 rewrite interfaces Layer 2-Rewrite node uses classify tables to match packets. Then, using the provisioned mask and value, modifies the packet header. practical example. Declaration: ``l2_rw_show_interfaces_cli`` `src/vnet/l2/l2_rw.c line 514 `_ Implementation: ``l2_rw_show_interfaces_cli_fn`` show l2fib ------------------------------------------------------------------------- .. code-block:: console show l2fib [all] | [bd_id | bd_index ] [learn | add] | [raw] This command displays the MAC Address entries of the L2 FIB table. Output can be filtered to just get the number of MAC Addresses or display each MAC Address for all bridge domains or just a single bridge domain. Example of how to display the number of MAC Address entries in the L2 FIB table: .. code-block:: console show l2fib 3 l2fib entries Example of how to display all the MAC Address entries in the L2 FIB table: .. code-block:: console show l2fib all Mac Address BD Idx Interface Index static filter bvi refresh timestamp 52:54:00:53:18:33 1 GigabitEthernet0/8/0.200 3 0 0 0 0 0 52:54:00:53:18:55 1 GigabitEthernet0/8/0.200 3 1 0 0 0 0 52:54:00:53:18:77 1 N/A -1 1 1 0 0 0 3 l2fib entries Declaration: ``show_l2fib_cli`` `src/vnet/l2/l2_fib.c line 357 `_ Implementation: ``show_l2fib`` show l2patch ------------------------------------------------------------------------- .. code-block:: console Show l2 interface cross-connect entries Show Layer 2 patch entries. .. code-block:: console show l2patch practical example. Declaration: ``show_l2patch_cli`` `src/vnet/l2/l2_patch.c line 425 `_ Implementation: ``show_l2patch`` show l2xcrw ------------------------------------------------------------------------- .. code-block:: console show l2xcrw Display a Layer 2 to Layer 3 rewrite cross-connect. This is used to hook Layer 2 interface(s) up to the Layer 3 stack in arbitrary ways. practical example. Declaration: ``show_l2xcrw_command`` `src/vnet/l2/l2_xcrw.c line 589 `_ Implementation: ``show_l2xcrw_command_fn`` show mode ------------------------------------------------------------------------- .. code-block:: console show mode [ ...] Modify the packet processing mode of the interface to Layer 3, which implies packets will be routed. This is the default mode of an interface. Use this command to remove an interface from a Layer 2 cross-connect or a Layer 2 bridge. Example of how to set the mode of an interface to Layer 3: .. code-block:: console set interface l3 GigabitEthernet0/8/0.200 Show the packet processing mode (Layer2 cross-connect, Layer 2 bridge, Layer 3 routed) of all interfaces and sub-interfaces, or limit the output to just the provided list of interfaces and sub-interfaces. The output shows the mode, the interface, and if the interface is a member of a bridge, the bridge-domain-id and the split horizon group (shg). Example of displaying the mode of all interfaces: .. code-block:: console show mode l3 local0 l3 GigabitEthernet0/8/0 l3 GigabitEthernet0/9/0 l3 GigabitEthernet0/a/0 l2 bridge GigabitEthernet0/8/0.200 bd_id 200 shg 0 l2 bridge GigabitEthernet0/9/0.200 bd_id 200 shg 0 l2 bridge GigabitEthernet0/a/0.200 bd_id 200 shg 0 l2 xconnect GigabitEthernet0/8/0.300 GigabitEthernet0/9/0.300 l2 xconnect GigabitEthernet0/9/0.300 GigabitEthernet0/8/0.300 Example of displaying the mode of a selected list of interfaces: .. code-block:: console show mode GigabitEthernet0/8/0 GigabitEthernet0/8/0.200 l3 GigabitEthernet0/8/0 l2 bridge GigabitEthernet0/8/0.200 bd_id 200 shg 0 Declaration: ``show_l2_mode`` `src/vnet/l2/l2_input.c line 882 `_ Implementation: ``show_int_mode`` test l2fib ------------------------------------------------------------------------- .. code-block:: console test l2fib [add|del|check] mac count The set of ``test l2fib`` commands allow the L2 FIB table of the default bridge domain (bridge-domain-id of 0) to be modified. Example of how to add a set of 4 sequential MAC Address entries to L2 FIB table of the default bridge-domain: .. code-block:: console test l2fib add mac 52:54:00:53:00:00 count 4 Show the set of 4 sequential MAC Address entries that were added: .. code-block:: console show l2fib verbose Mac Address BD Idx Interface Index static filter bvi refresh timestamp 52:54:00:53:00:00 0 GigabitEthernet0/8/0.300 8 0 0 0 0 0 52:54:00:53:00:01 0 GigabitEthernet0/8/0.300 8 0 0 0 0 0 52:54:00:53:00:03 0 GigabitEthernet0/8/0.300 8 0 0 0 0 0 52:54:00:53:00:02 0 GigabitEthernet0/8/0.300 8 0 0 0 0 0 4 l2fib entries Example of how to check that the set of 4 sequential MAC Address entries were added to L2 FIB table of the default bridge-domain. Used a count of 5 to produce an error: .. code-block:: console test l2fib check mac 52:54:00:53:00:00 count 5 The output of the check command is in the log files. Log file location may vary based on your OS and Version: ``# tail -f /var/log/messages | grep l2fib_test_command_fn`` Sep 7 17:15:24 localhost vnet[4952]: l2fib_test_command_fn:446: key 52:54:00:53:00:04 AWOL Example of how to delete a set of 4 sequential MAC Address entries from L2 FIB table of the default bridge-domain: .. code-block:: console test l2fib del mac 52:54:00:53:00:00 count 4 Declaration: ``l2fib_test_command`` `src/vnet/l2/l2_fib.c line 728 `_ Implementation: ``l2fib_test_command_fn`` test l2patch ------------------------------------------------------------------------- .. code-block:: console test l2patch rx tx [del] Create or delete a Layer 2 patch. .. code-block:: console test l2patch rx tx [del] practical example. Declaration: ``test_patch_command`` `src/vnet/l2/l2_patch.c line 373 `_ Implementation: ``test_patch_command_fn``