Scott Keeler | 6c89230 | 2018-10-26 09:12:15 -0400 | [diff] [blame] | 1 | .. _interface:
|
| 2 |
|
| 3 | .. toctree::
|
| 4 |
|
| 5 | Set Interface Commands
|
| 6 | =======================
|
| 7 | This section covers those commands that are related to setting an interface:
|
| 8 |
|
| 9 | * `Set Interface`_
|
| 10 | * `Set Interface IP Address`_
|
| 11 | * `Set Interface L2 Bridge`_
|
| 12 | * `Set Interface MTU`_
|
| 13 | * `Set Interface Promiscuous`_
|
| 14 | * `Set Interface State`_
|
| 15 |
|
| 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>`_ .
|
| 17 |
|
| 18 | Set Interface
|
| 19 | ++++++++++++++++
|
| 20 |
|
| 21 | Summary/Usage
|
| 22 | -------------
|
| 23 |
|
| 24 | Interface commands.
|
| 25 |
|
| 26 | Declaration and Implementation
|
| 27 | -------------------------------
|
| 28 |
|
| 29 | **Declaration:** vnet_cli_set_interface_command (src/vnet/interface_cli.c line 484)
|
| 30 |
|
| 31 | Set Interface IP Address
|
| 32 | +++++++++++++++++++++++++
|
| 33 |
|
| 34 | Summary/Usage
|
| 35 | -------------
|
| 36 |
|
| 37 | set interface ip address [del] <*interface*> <*ip-addr*>/<*mask*> | [all]
|
| 38 |
|
| 39 | Description
|
| 40 | -------------
|
| 41 |
|
| 42 | Add an IP Address to an interface or remove and IP Address from an interface.
|
| 43 | The IP Address can be an IPv4 or an IPv6 address. Interfaces may have multiple IPv4 and IPv6
|
| 44 | addresses. There is no concept of primary vs. secondary interface addresses; they're just addresses.
|
| 45 |
|
| 46 | To display the addresses associated with a given interface, use the command **show interface address** <*interface*>.
|
| 47 |
|
| 48 | .. note::
|
| 49 | The debug CLI does not enforce classful mask-width / addressing constraints.
|
| 50 |
|
| 51 | Example Usage
|
| 52 | --------------
|
| 53 |
|
| 54 | An example of how to add an IPv4 address to an interface:
|
| 55 |
|
| 56 | .. code-block:: console
|
| 57 |
|
| 58 | vpp# set interface ip address GigabitEthernet2/0/0 172.16.2.12/24
|
| 59 |
|
| 60 | An example of how to add an IPv6 address to an interface:
|
| 61 |
|
| 62 | .. code-block:: console
|
| 63 |
|
| 64 | vpp# set interface ip address GigabitEthernet2/0/0 ::a:1:1:0:7/126
|
| 65 |
|
| 66 | To delete a specific interface ip address:
|
| 67 |
|
| 68 | .. code-block:: console
|
| 69 |
|
| 70 | vpp# set interface ip address GigabitEthernet2/0/0 172.16.2.12/24 del
|
| 71 |
|
| 72 | To delete all interfaces addresses (IPv4 and IPv6):
|
| 73 |
|
| 74 | .. code-block:: console
|
| 75 |
|
| 76 | vpp# set interface ip address GigabitEthernet2/0/0 del all
|
| 77 |
|
| 78 | Declaration and Implementation
|
| 79 | -------------------------------
|
| 80 |
|
| 81 | **Declaration:** set_interface_ip_address_command (src/vnet/ip/ip46_cli.c line 216)
|
| 82 |
|
| 83 | **Implementation:** add_del_ip_address
|
| 84 |
|
| 85 |
|
| 86 | Set Interface L2 Bridge
|
| 87 | +++++++++++++++++++++++++
|
| 88 |
|
| 89 | Summary/Usage
|
| 90 | -------------
|
| 91 |
|
| 92 | set interface l2 bridge <*interface*> <*bridge-domain-id*> [bvi|uu-fwd] [shg]
|
| 93 |
|
| 94 | Description
|
| 95 | -------------
|
| 96 |
|
| 97 | Use this command put an interface into Layer 2 bridge domain. If a bridge-domain with the provided
|
| 98 | bridge-domain-id does not exist, it will be created. Interfaces in a bridge-domain forward packets
|
| 99 | to other interfaces in the same bridge-domain based on destination mac address. To remove an interface
|
| 100 | from a the Layer 2 bridge domain, put the interface in a different mode, for example Layer 3 mode.
|
| 101 |
|
| 102 | Optionally, an interface can be added to a Layer 2 bridge-domain as a Bridged Virtual Interface (bvi).
|
| 103 | Only one interface in a Layer 2 bridge-domain can be a bvi.
|
| 104 |
|
| 105 | Optionally, a split-horizon group can also be specified. This defaults to 0 if not specified.
|
| 106 |
|
| 107 | Example Usage
|
| 108 | --------------
|
| 109 | Example of how to configure a Layer 2 bridge-domain with three interfaces (where 200 is the bridge-domain-id):
|
| 110 |
|
| 111 | .. code-block:: console
|
| 112 |
|
| 113 | vpp# set interface l2 bridge GigabitEthernet0/8/0.200 200
|
| 114 |
|
| 115 | This interface is added a BVI interface:
|
| 116 |
|
| 117 | .. code-block:: console
|
| 118 |
|
| 119 | vpp# set interface l2 bridge GigabitEthernet0/9/0.200 200 bvi
|
| 120 |
|
| 121 | This interface also has a split-horizon group of 1 specified:
|
| 122 |
|
| 123 | .. code-block:: console
|
| 124 |
|
| 125 | vpp# set interface l2 bridge GigabitEthernet0/a/0.200 200 1
|
| 126 |
|
| 127 | Example of how to remove an interface from a Layer2 bridge-domain:
|
| 128 |
|
| 129 | .. code-block:: console
|
| 130 |
|
| 131 | vpp# set interface l3 GigabitEthernet0/a/0.200
|
| 132 |
|
| 133 | Declaration and Implementation
|
| 134 | -------------------------------
|
| 135 |
|
| 136 | **Declaration:** int_l2_bridge_cli (src/vnet/l2/l2_input.c line 949)
|
| 137 |
|
| 138 | **Implementation:** int_l2_bridge
|
| 139 |
|
| 140 | Set Interface MTU
|
| 141 | ++++++++++++++++++
|
| 142 |
|
| 143 | Summary/Usage
|
| 144 | -------------
|
| 145 |
|
| 146 | .. code-block:: shell
|
| 147 |
|
| 148 | set interface mtu [packet|ip4|ip6|mpls] <value> <interface>
|
| 149 |
|
| 150 | Set Interface Promiscuous
|
| 151 | ++++++++++++++++++++++++++
|
| 152 |
|
| 153 | Summary/Usage
|
| 154 | -------------
|
| 155 |
|
| 156 | .. code-block:: shell
|
| 157 |
|
| 158 | set interface promiscuous [on|off] <interface>.
|
| 159 |
|
| 160 | .. _setintstate:
|
| 161 |
|
| 162 | Set Interface State
|
| 163 | ++++++++++++++++++++
|
| 164 | This command is used to change the admin state (up/down) of an
|
| 165 | interface.
|
| 166 |
|
| 167 | If an interface is down, the optional *punt* flag can also be set. The
|
| 168 | *punt* flag implies the interface is disabled for forwarding but punt
|
| 169 | all traffic to slow-path. Use the *enable* flag to clear *punt* flag
|
| 170 | (interface is still down).
|
| 171 |
|
| 172 | Summary/Usage
|
| 173 | -------------
|
| 174 |
|
| 175 | .. code-block:: shell
|
| 176 |
|
| 177 | set interface state <interface> [up|down|punt|enable].
|
| 178 |
|
| 179 | Example Usage
|
| 180 | ----------------
|
| 181 |
|
| 182 | Example of how to configure the admin state of an interface to **up**:
|
| 183 |
|
| 184 | .. code-block:: console
|
| 185 |
|
| 186 | vpp# set interface state GigabitEthernet2/0/0 up
|
| 187 |
|
| 188 | Example of how to configure the admin state of an interface to **down**:
|
| 189 |
|
| 190 | .. code-block:: console
|
| 191 |
|
| 192 | vpp# set interface state GigabitEthernet2/0/0 down
|
| 193 |
|