6 =======================
7 This section covers those commands that are related to setting an interface:
10 * `Set Interface IP Address`_
11 * `Set Interface L2 Bridge`_
12 * `Set Interface Mtu`_
13 * `Set Interface Promiscuous`_
14 * `Set Interface State`_
16 .. note:: For a complete list of CLI Debug commands refer to the Debug CLI section of the `Source Code Documents <https://docs.fd.io/vpp/18.07/clicmd.html>`_ .
26 Declaration and Implementation
27 -------------------------------
29 **Declaration:** vnet_cli_set_interface_command (src/vnet/interface_cli.c line 484)
31 Set Interface IP Address
32 +++++++++++++++++++++++++
37 set interface ip address [del] <*interface*> <*ip-addr*>/<*mask*> | [all]
42 Add an IP Address to an interface or remove and IP Address from an interface. The IP Address can be an IPv4 or an IPv6 address. Interfaces may have multiple IPv4 and IPv6 addresses. There is no concept of primary vs. secondary interface addresses; they're just addresses.
44 To display the addresses associated with a given interface, use the command **show interface address** <*interface*>.
47 The debug CLI does not enforce classful mask-width / addressing constraints.
52 An example of how to add an IPv4 address to an interface:
54 .. code-block:: console
56 vpp# set interface ip address GigabitEthernet2/0/0 172.16.2.12/24
58 An example of how to add an IPv6 address to an interface:
60 .. code-block:: console
62 vpp# set interface ip address GigabitEthernet2/0/0 ::a:1:1:0:7/126
64 To delete a specific interface ip address:
66 .. code-block:: console
68 vpp# set interface ip address GigabitEthernet2/0/0 172.16.2.12/24 del
70 To delete all interfaces addresses (IPv4 and IPv6):
72 .. code-block:: console
74 vpp# set interface ip address GigabitEthernet2/0/0 del all
76 Declaration and Implementation
77 -------------------------------
79 **Declaration:** set_interface_ip_address_command (src/vnet/ip/ip46_cli.c line 216)
81 **Implementation:** add_del_ip_address
84 Set Interface L2 Bridge
85 +++++++++++++++++++++++++
90 set interface l2 bridge <*interface*> <*bridge-domain-id*> [bvi|uu-fwd] [shg]
95 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.
97 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.
99 Optionally, a split-horizon group can also be specified. This defaults to 0 if not specified.
103 Example of how to configure a Layer 2 bridge-domain with three interfaces (where 200 is the bridge-domain-id):
105 .. code-block:: console
107 vpp# set interface l2 bridge GigabitEthernet0/8/0.200 200
109 This interface is added a BVI interface:
111 .. code-block:: console
113 vpp# set interface l2 bridge GigabitEthernet0/9/0.200 200 bvi
115 This interface also has a split-horizon group of 1 specified:
117 .. code-block:: console
119 vpp# set interface l2 bridge GigabitEthernet0/a/0.200 200 1
121 Example of how to remove an interface from a Layer2 bridge-domain:
123 .. code-block:: console
125 vpp# set interface l3 GigabitEthernet0/a/0.200
127 Declaration and Implementation
128 -------------------------------
130 **Declaration:** int_l2_bridge_cli (src/vnet/l2/l2_input.c line 949)
132 **Implementation:** int_l2_bridge
140 .. code-block:: shell
142 set interface mtu [packet|ip4|ip6|mpls] <value> <interface>
144 Set Interface Promiscuous
145 ++++++++++++++++++++++++++
150 .. code-block:: shell
152 set interface promiscuous [on|off] <interface>.
158 This command is used to change the admin state (up/down) of an
161 If an interface is down, the optional *punt* flag can also be set. The
162 *punt* flag implies the interface is disabled for forwarding but punt
163 all traffic to slow-path. Use the *enable* flag to clear *punt* flag
164 (interface is still down).
169 .. code-block:: shell
171 set interface state <interface> [up|down|punt|enable].
176 Example of how to configure the admin state of an interface to **up**:
178 .. code-block:: console
180 vpp# set interface state GigabitEthernet2/0/0 up
182 Example of how to configure the admin state of an interface to **down**:
184 .. code-block:: console
186 vpp# set interface state GigabitEthernet2/0/0 down