image image image image image

On This Page

Interfacedhcp hostname

ip address


ip address <IP address> <netmask>
no ip address

Sets the IP address and netmask of this interface.
The no form of the command clears the IP address and netmask of this interface.

Syntax Description

IP address

IPv4 address.

netmask

Subnet mask of IP address.

Default

0.0.0.0/0

Configuration Mode

config interface management

History

8.0.0100

Example

gateway (config interface mgmt0)# ip address 10.10.10.10 255.255.255.0

Related Commands

show interfaces <ifname>

Notes

If DHCP is enabled on the specified interface, then the DHCP IP assignment will hold until DHCP is disabled

ip default-gateway


ip default-gateway <next-hop-IP-address> <interface-name>
no default-gateway <next-hop-IP-address> <interface-name>

Configures a default route.
The no form of the command removes the current default route.

Syntax Description

next hop IP address

Gateway IP address.

interface nameDefault gateway interface name.

Default

N/A

Configuration Mode

config interface management

History

8.0.0100

Example

gateway (config interface mgmt0)# ip default-gateway mgmt1

Related Commands


Notes


alias 


alias <index> ip address < IP address> <netmask>
no alias <index>

Adds an additional IP address to the specified interface. The secondary address will appear in the output of “show interface” under the data of the primary interface along with the alias.
The no form of the command removes the secondary address to the specified interface.

Syntax Description

index

A number that is to be aliased to (associated with) the secondary IP.

IP address

Additional IP address.

netmask

Subnet mask of the IP address.

Default

N/A

Configuration Mode

config interface management

History

8.0.0100

Example

gateway (config interface mgmt0)# alias 2 ip address 9.9.9.9 255.255.255.255

Related Commands

show interfaces <ifname>

Notes

  • If DHCP is enabled on the specified interface, then the DHCP IP assignment will hold until DHCP is disabled
  • More than one additional IP address can be added to the interface

mtu


mtu <bytes>
no mtu <bytes>

Sets the Maximum Transmission Unit (MTU) of this interface.
The no form of the command resets the MTU to its default.

Syntax Description

bytes

The entry range is 68-1500.

Default

1500

Configuration Mode

config interface management

History

8.0.0100

Example

gateway (config interface mgmt0)# mtu 1500

Related Commands

show interfaces <ifname>

Notes


duplex


duplex <duplex>
no duplex

Sets the interface duplex.
The no form of the command resets the duplex setting for this interface to its default value.

Syntax Description

duplex

Sets the duplex mode of the interface.
Possible values:

  • half—half duplex
  • full—full duplex
  • auto—auto duplex sensing (half or full)

Default

auto

Configuration Mode

config interface management

History

8.0.0100

Example

gateway (config interface mgmt0)# duplex auto

Related Commands

show interfaces <ifname>

Notes

  • Setting the duplex to “auto” also sets the speed to “auto”
  • Setting the duplex to one of the settings “half” or “full” also sets the speed to a manual setting which is determined by querying the interface to find out its current auto-detected state

speed


speed <speed>
no speed

Sets the interface speed.
The no form of the command resets the speed setting for this interface to its default value.

Syntax Description

speed

Sets the speed of the interface. The following are the possible values:

  • 10—fixed to 10Mbps
  • 100—fixed to 1000Mbps
  • 1000—fixed to 1000Mbps
  • auto—auto speed sensing (10/100/1000Mbps)

Default

auto

Configuration Mode

config interface management

History

8.0.0100

Example

gateway (config interface mgmt0)# speed auto

Related Commands

show interfaces <ifname>

Notes

  • Setting the speed to “auto” also sets the duplex to “auto”
  • Setting the speed to one of the manual settings (generally, “10”, “100”, or “1000”) also sets the duplex to a manual setting which is determined by querying the interface to find out its current auto-detected state

dhcp


dhcp [renew]
no dhcp

Enables DHCP on the specified interface.
The no form of the command disables DHCP on the specified interface.

Syntax Description

renew

Forces a renewal of the IP address. A restart on the DHCP client for the specified interface will be issued.

Default

N/A

Configuration Mode

config interface management

History

8.0.0100

Example

gateway (config interface mgmt0)# dhcp

Related Commands

show interfaces <ifname> configured

Notes

  • When enabling DHCP, the IP address and netmask are received via DHCP hence, the static IP address configuration is ignored
  • Enabling DHCP disables zeroconf and vice versa
  • Setting a static IP address and netmask does not disable DHCP. DHCP is disabled using the “no” form of this command or by enabling zeroconf

dhcp hostname


dhcp hostname
no dhcp hostname

Enables fetching the hostname from DHCP for this interface.
The no form of the command disables fetching the hostname from DHCP for this interface.

Syntax Description

N/A

Default

Enabled

Configuration Mode

config interface management

History

8.0.0100

Example

gateway (config interface mgmt0)# dhcp hostname

Related Commands

hostname <hostname>
show interfaces <ifname> configured

Notes

If a hostname is configured manually by the user, that configuration will override the “dhcp hostname” configuration.

shutdown


shutdown
no shutdown

Disables the specified interface.
The no form of the command enables the specified interface.

Syntax Description

N/A

Default

no shutdown

Configuration Mode

config interface management

History

8.0.0100

Example

gateway (config interface mgmt0)# no shutdown

Related Commands

show interfaces <ifname> configured

Notes


zeroconf


zeroconf
no zeroconf

Enables zeroconf on the specified interface. It randomly chooses a unique link-local IPv4 address from the 169.254.0.0/16 block. This command is an alternative to DHCP.
The no form of the command disables the use of zeroconf on the specified interface.

Syntax Description

N/A 

Default

no zeroconf

Configuration Mode

config interface management

History

8.0.0100

Example

gateway (config interface mgmt0)# zeroconf

Related Commands

show interfaces <ifname> configured

Notes

Enabling zeroconf disables DHCP and vice versa.

comment 


comment <comment>
no comment

Adds a comment for an interface.
The no form of the command removes a comment for an interface.

Syntax Description

comment

A free-form string that has no semantics other than being displayed when the interface records are listed.

Default

no comment

Configuration Mode

config interface management

History

8.0.0100

Example

gateway (config interface mgmt0)# comment my-interface

Related Commands


Notes


show interfaces mgmt0


show interface mgmt0 

Displays information on the management interface configuration and status.

Syntax Description

N/A

Default

N/A

Configuration Mode

Any command mode

History

8.0.0100

Example

gateway (config)# show interfaces mgmt0

Interface mgmt0 status:
  Comment         :
  Admin up        : yes
  Link up         : yes
  DHCP running    : yes
  IP address      : 10.12.67.33
  Netmask         : 255.255.255.128
  IPv6 enabled    : yes
  Autoconf enabled: no
  Autoconf route  : yes
  Autoconf privacy: no
  DHCPv6 running  : yes (but no valid lease)
 

  Speed           : 1000Mb/s (auto)
  Duplex          : full (auto)
  Interface type  : ethernet
  Interface source: bridge
  MTU             : 1500
  HW address      : 24:8a:07:53:3d:8e

  Rx:
    2055054  bytes
      28830  packets
          0  mcast packets
          0  discards
          0  errors
          0  overruns
          0  frame

  Tx:
    377716  bytes
      3200  packets
         0  discards
         0  errors
         0  overruns
         0  carrier
         0  collisions
         0  queue len

Related Commands


Notes


show interfaces mgmt0 brief


show interface mgmt0 brief

Displays brief information on the management interface configuration and status.

Syntax Description

N/A 

Default

N/A

Configuration Mode

Any command mode

History

8.0.0100

Example

gateway (config)# show interfaces mgmt0 brief

Interface mgmt0 status:
  Comment         :
  Admin up        : yes
  Link up         : yes
  DHCP running    : yes
  IP address      : 10.12.67.33
  Netmask         : 255.255.255.128
  IPv6 enabled    : yes
  Autoconf enabled: no
  Autoconf route  : yes
  Autoconf privacy: no
  DHCPv6 running  : yes (but no valid lease)
  
  Speed           : 1000Mb/s (auto)
  Duplex          : full (auto)
  Interface type  : ethernet
  Interface source: bridge
  MTU             : 1500
  HW address      : 24:8a:07:53:3d:8e

Related Commands


Notes


show interfaces mgmt0 configured


show interface mgmt0 configured

Displays configuration information about the specified interface.

Syntax Description

N/A 

Default

N/A

Configuration Mode

Any command mode

History

8.0.0100

Example

gateway (config)# show interfaces mgmt0 configured

Interface mgmt0 configuration:
  Comment         :
  Enabled         : yes
  DHCP            : yes
  DHCP Hostname   : yes
  Zeroconf        : no
  IP address      :
  Netmask         :
  Autoconf enabled: no
  Autoconf route  : yes
  Autoconf privacy: no
  DHCPv6 enabled  : yes
  IPv6 addresses  : 0
  Speed           : auto
  Duplex          : auto
  MTU             : 1500

Related Commands


Notes


Hostname Resolution

hostname


hostname <hostname>
no hostname

Sets a static system hostname.
The no form of the command clears the system hostname.

Syntax Description

hostname

A free-form string

Default

Default hostname

Configuration Mode

config

History

8.0.0100

Example

gateway (config)# hostname my-gateway-hostname

Related Commands

show hosts

Notes

  • Hostname may contain letters, numbers, periods ("."), and hyphens ("-"), in any combination
  • Hostname may be 1-63 characters long
  • Hostname may not begin with a hyphen
  • Hostname may not contain other characters, such as “%”, “_”, and so forth
  • Hostname may not be set to one of the valid logging commands (i.e., debug-files, fields, files, format, level, local, monitor, receive, trap)
  • Changing the hostname stamps a new HTTPS certificate

ip name-server


ip name-server <IPv4 address>
no ip name-server <IPv4 address>

Sets the static name server.
The no form of the command clears the name server.

Syntax Description

IPv4 address

IPv4 address.

Default

No server name

Configuration Mode

config

History

8.0.0100

Example

gateway (config)# ip name-server 9.9.9.9

Related Commands

show hosts

Notes


ip domain-list


ip domain-list <domain-name>
no ip domain-list <domain-name>

Sets the static domain name.
The no form of the command clears the domain name.

Syntax Description

domain-name

The domain name in a string form.
A domain name is an identification string that defines a realm of administrative autonomy, authority, or control in the Internet.

Default

No static domain name

Configuration Mode

config

History

8.0.0100

Example

gateway (config)# ip domain-list mydomain.com

Related Commands

show hosts

Notes


show hosts


show hosts

Displays hostname, DNS configuration, and static host mappings.

Syntax Description

N/A

Default

N/A

Configuration Mode

Any command mode

History

8.0.0100

Example

gateway (config)# show hosts

Hostname: gateway1

Name servers:
10.7.77.192 dynamic (DHCP on mgmt0)
10.7.77.135 dynamic (DHCP on mgmt0)
10.198.0.169 dynamic (DHCP on mgmt0)
(*) 10.211.0.124 dynamic (DHCP on mgmt0)

Domain names:
mtl.labs.mlnx dynamic (DHCP on mgmt0)

(*) Inactive due to system limits on name servers and domain names.

Static IPv4 host mappings:
10.7.144.133 --> gateway1
127.0.0.1 --> localhost


Automatically map hostname to loopback address : yes

Related Commands


Notes


Routing

ip route


ip route{<network-prefix> <netmask> | <network-prefix>/<masklen>} <next-hop>
no ip route [vrf <vrf-name>] {<network-prefix> <netmask> | <network-prefix>/<masklen>} <next-hop>

Sets a static route for a given IP.
The no form of the command deletes the static route.

Syntax Description

network-prefix

IPv4 network prefix

netmask

IPv4 netmask formats are:

  • /24
  • 255.255.255.0

nexthop-address

The IPv4 address of the next hop router for this route.

ifname

The interface name (e.g., mgmt0, mgmt1).

Default

N/A

Configuration Mode

config

History

8.0.0100

Example

gateway (config)# ip route 20.20.20.0 255.255.255.0 mgmt0

Related Commands

show ip route

Notes



Network to Media Resolution (ARP & NDP)

IPv4 network use Address Resolution Protocol (ARP) to resolve IP address to MAC address.

arp


arp <ip-address> <mac-address>
no arp <ip-address> <mac-address>

Sets a static ARP entry.
The no form of the command deletes the static ARP.

Syntax Description

ip-address

IPv4 address.

mac-address

MAC address.

Default

N/A

Configuration Mode

config interface management

History

8.0.0100

Example

gateway (config interface mgmt0)# arp 20.20.20.20 aa:aa:aa:aa:aa:aa

Related Commands

show arp

Notes


clear arp-cache


clear arp-cache

Clears the dynamic entries from the ARP cache.

Syntax Description

N/A

Default

N/A

Configuration Mode

config

History

8.0.0100

Example

switch (config) # clear arp-cache

Related Commands

show arp

Notes


show arp


show arp [static]

Displays ARP table.

Syntax Description

static

Displays all statically-configured ARP entries

Default

N/A

Configuration Mode

Any command mode

History

8.0.0100

Example
switch (config) # show arp
ARP cache contents
IP 10.7.144.1 maps to Hardware Address 00:00:5E:00:01:01 (interface mgmt0)
IP 10.7.148.8 maps to Hardware Address C4:00:AD:77:52:FD (interface mgmt0)
IP 10.7.148.64 maps to Hardware Address C4:00:AD:7A:37:BD (interface mgmt0)
IP 192.192.7.2 maps to Hardware Address 1C:34:DA:16:67:88 (interface eth po 1)
IP 193.193.7.3 maps to Hardware Address B8:CE:F6:03:00:75:6E:DA (interface ib po 1)
IP 193.193.7.4 maps to Hardware Address B8:CE:F6:03:00:68:7E:8A (interface ib po 1)
IP 193.193.7.11 maps to Hardware Address 98:03:9B:03:00:9F:D5:16 (interface ib po 1)
IP 193.193.7.31 maps to Hardware Address 98:03:9B:03:00:9F:D5:16 (interface ib po 1)
IP 193.193.7.32 maps to Hardware Address 98:03:9B:03:00:9F:D5:16 (interface ib po 1)
IP 193.193.7.33 maps to Hardware Address 98:03:9B:03:00:9F:D5:16 (interface ib po 1)

switch (config) # show arp static
Static ARP entries
IP 191.191.7.1 maps to MAC 1C:34:DA:16:67:88
IP 191.191.7.2 maps to MAC 1C:34:DA:16:67:88
IP 192.192.7.2 maps to MAC 1C:34:DA:16:67:88

Related Commands


Notes



DHCP

ip dhcp


ip dhcp {default-gateway yield-to-static | hostname <hostname>| primary-intf <ifname> | send-hostname}
no ip dhcp {default-gateway yield-to-static| hostname | | primary-intf | send-hostname}

Sets global DHCP configuration.
The no form of the command deletes the DHCP configuration.

Syntax Description

yield-to-static

Does not allow you to install a default gateway from DHCP if there is already a statically configured one.

hostname

Specifies the hostname to be sent during DHCP client negotiation if send-hostname is enabled.

primary-intf <ifname>

Sets the interface from which a non-interface-specific configuration (resolver and routes) will be accepted via DHCP.

send-hostname

Enables the DHCP client to send a hostname during negotiation.

Default

no ip dhcp yield-to-static
no ip dhcp hostname
ip ip dhcp primary-intf mgmt0
no ip dhcp send-hostname

Configuration Mode

config

History

8.0.0100

Example

gateway (config)# ip dhcp default-gateway yield-to-static

Related Commands

show ip dhcp
dhcp [renew]

Notes

DHCP is supported for IPv4 networks only.

show ip dhcp


show ip dhcp

Displays the DHCP configuration and status.

Syntax Description

N/A

Default

N/A

Configuration Mode

Any command mode

History

8.0.0100

Example

gateway (config)# show ip dhcp
----------------------------------------
Interface DHCP DHCP Valid
Enabled Running lease
----------------------------------------
dummy0 no no no
lo no no no
mgmt0 yes yes yes
mgmt1 no no no
mgmts0 no no no
mgmts1 no no no
vif1 no no no

IPv4 dhcp default gateway yields to static configuration: no

DHCP primary interface:
Configured: mgmt0
Active: mgmt0

DHCP client options:
Send Hostname: no
Client Hostname: 1.1.1.1

Related Commands

ip dhcp
dhcp [renew]

Notes



IP Diagnostic Tools

ping


ping [-LRUbdfnqrvVaA] [-c count] [-i interval] [-w deadline] [-p pattern] [-s packetsize] [-t ttl] [-I interface or address] [-M mtu discovery hint] [-S sndbuf] [-T timestamp option ] [-Q tos ] [hop1 ...] destination

Sends ICMP echo requests to a specified host.

Syntax Description

Linux Ping options

https://www.lifewire.com/uses-of-command-ping-2201076

Default

N/A

Configuration Mode

config

History

8.0.0100

Example

gateway (config)# ping 172.30.2.2
PING 172.30.2.2 (172.30.2.2) 56(84) bytes of data.
64 bytes from 172.30.2.2: icmp_seq=1 ttl=64 time=0.703 ms
64 bytes from 172.30.2.2: icmp_seq=2 ttl=64 time=0.187 ms
64 bytes from 172.30.2.2: icmp_seq=3 ttl=64 time=0.166 ms
64 bytes from 172.30.2.2: icmp_seq=4 ttl=64 time=0.161 ms
64 bytes from 172.30.2.2: icmp_seq=5 ttl=64 time=0.153 ms
64 bytes from 172.30.2.2: icmp_seq=6 ttl=64 time=0.144 ms
...
--- 172.30.2.2 ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5004ms
rtt min/avg/max/mdev = 0.144/0.252/0.703/0.202 ms

Related Commands

traceroutes

Notes


traceroute


traceroute [-46dFITUnrAV] [-f first_ttl] [-g gate,...] [-i device] [-m max_ttl] [-N squeries] [-p port] [-t tos] [-l flow_label] [-w waittime] [-q nqueries] [-s src_addr] [-z sendwait] host [packetlen]

Traces the route packets take to a destination.

Syntax Description

-4

Uses IPv4.

-dEnables socket level debugging.
-FSets DF (do not fragment bit) on.
-IUses ICMP ECHO for tracerouting.
-TUses TCP SYN for tracerouting.
-UUses UDP datagram (default) for tracerouting.
-nDoes not resolve IP addresses to their domain names.
-rBypasses the normal routing and send directly to a host on an attached network.
-APerforms AS path lookups in routing registries and print results directly after the corresponding addresses.
-VPrints version info and exit.
-fStarts from the first_ttl hop (instead from 1).
-gRoutes packets through the specified gateway (maximum 8 for IPv4 and 127 for IPv6).
-iSpecifies a network interface with which to operate.
-mSets the max number of hops (max TTL to be reached). Default is 30.
-NSets the number of probes to be tried simultaneously (default is 16).
-pUses destination port. It is an initial value for the UDP destination port (incremented by each probe, default is 33434), for the ICMP seq number (incremented as well, default from 1), and the constant destination port for TCP tries (default is 80).
-tSets the TOS (IPv4 type of service) or TC (IPv6 traffic class) value for outgoing packets.
-lUses specified flow_label for IPv6 packets.
-wSets the number of seconds to wait for response to a probe (default is 5.0). Non-integer (float point) values allowed too.
-sUses source src_addr for outgoing packets.
-qSets the number of probes per each hop. Default is 3.
-zSets minimal time interval between probes (default is 0). If the value is more than 10, then it specifies a number in milliseconds, else it is a number of seconds (float point values allowed too).

Default

N/A

Configuration Mode

config

History

8.0.0100

Example
gateway (config)# traceroute 192.168.10.70
traceroute to 192.168.10.70 (192.168.10.70), 30 hops max, 40 byte packets
1 172.30.0.1 (172.30.0.1) 3.632 ms 2.849 ms 3.544 ms
2 10.222.128.46 (10.222.128.46) 3.176 ms 3.289 ms 3.656 ms
3 10.158.128.30 (10.158.128.30) 15.331 ms 15.819 ms 16.388 ms
4 10.158.128.65 (10.158.128.65) 20.468 ms 7.893 ms 12.27 ms
5 10.7.34.115 (10.7.34.115) 16.405 ms 11.985 ms 12.264 ms6 192.168.10.70 (192.168.10.70) 16.377 ms 16.091 ms 20.475 ms

Related Commands

ping

Notes


tcpdump


tcpdump [-aAdDeflLnNOpqRStuUvxX] [-c count] [-C file_size] [-E algo:secret] [-F file] [-i interface] [-M secret] [-r file] [-s snaplen] [-T type] [-w file] [-W filecount] [-y datalinktype] [-Z user] [-D list possible interfaces] [expression]

Invokes standard binary, passing command line parameters straight through. Runs in foreground, printing packets as they arrive, until the user hits Ctrl+C.

Syntax DescriptionN/A

Default

N/A

Configuration Mode

config

History

8.0.0100

Example

gateway (config)# tcpdump
......
09:37:38.678812 IP 192.168.10.7.ssh > 192.168.10.1.54155: P 1494624:1494800(176) ack 625 win 90
<nop,nop,timestamp 5842763 858672398>
09:37:38.678860 IP 192.168.10.7.ssh > 192.168.10.1.54155: P 1494800:1495104(304) ack 625 win 90
<nop,nop,timestamp 5842763 858672398>
...
9141 packets captured
9142 packets received by filter
0 packets dropped by kernel

Related Commands


Notes