linux命令ifconfig命令你真的懂了吗?

linux命令ifconfig命令你真的懂了吗?ifconfig 命令 arron arron VirtualBox ifconfig hUsage ifconfig a v s interface af af interface

欢迎大家来到IT世界,在知识的湖畔探索吧!

linux命令ifconfig命令你真的懂了吗?

ifconfig命令:

arron@arron-VirtualBox:~$ ifconfig -h

Usage:

ifconfig [-a] [-v] [-s] <interface> [[<AF>] <address>]

[add <address>[/<prefixlen>]]

[del <address>[/<prefixlen>]]

[[-]broadcast [<address>]] [[-]pointopoint [<address>]]

[netmask <address>] [dstaddr <address>] [tunnel <address>]

[outfill <NN>] [keepalive <NN>]

[hw <HW> <address>] [metric <NN>] [mtu <NN>]

[[-]trailers] [[-]arp] [[-]allmulti]

[multicast] [[-]promisc]

[mem_start <NN>] [io_addr <NN>] [irq <NN>] [media <type>]

[txqueuelen <NN>]

[[-]dynamic]

[up|down] …

<HW>=Hardware Type.

List of possible hardware types:

loop (Local Loopback) slip (Serial Line IP) cslip (VJ Serial Line IP)

slip6 (6-bit Serial Line IP) cslip6 (VJ 6-bit Serial Line IP) adaptive (Adaptive Serial Line IP)

ash (Ash) ether (Ethernet) ax25 (AMPR AX.25)

netrom (AMPR NET/ROM) rose (AMPR ROSE) tunnel (IPIP Tunnel)

ppp (Point-to-Point Protocol) hdlc ((Cisco)-HDLC) lapb (LAPB)

arcnet (ARCnet) dlci (Frame Relay DLCI) frad (Frame Relay Access Device)

sit (IPv6-in-IPv4) fddi (Fiber Distributed Data Interface) hippi (HIPPI)

irda (IrLAP) ec (Econet) x25 (generic X.25)

eui64 (Generic EUI-64)

<AF>=Address family. Default: inet

List of possible address families:

unix (UNIX Domain) inet (DARPA Internet) inet6 (IPv6)

ax25 (AMPR AX.25) netrom (AMPR NET/ROM) rose (AMPR ROSE)

ipx (Novell IPX) ddp (Appletalk DDP) ec (Econet)

ash (Ash) x25 (CCITT X.25)

ifconfig常用命令用于显示和配置网络接口的信息。以下是一些常用的ifconfig命令选项:

  1. ifconfig:显示所有网络接口的信息。
  2. ifconfig [interface]:显示指定网络接口(如eth0、wlan0等)的信息。
  3. ifconfig [interface] up:启用指定网络接口。
  4. ifconfig [interface] down:禁用指定网络接口。
  5. ifconfig [interface] [IP地址]:为指定网络接口设置IP地址。
  6. ifconfig [interface] netmask [子网掩码]:为指定网络接口设置子网掩码。
  7. ifconfig [interface] broadcast [广播地址]:为指定网络接口设置广播地址。
  8. ifconfig [interface] hw ether [MAC地址]:为指定网络接口设置MAC地址。
  9. ifconfig [interface] mtu [MTU值]:为指定网络接口设置最大传输单元(MTU)值。
  10. ifconfig -a:显示所有网络接口(包括未启用的)的信息。
  11. ifconfig -s:以简洁的方式显示网络接口的摘要信息。

其中最常用的就是查看ip地址,如下所示:

linux命令ifconfig命令你真的懂了吗?

arron@arron-VirtualBox:~$ ifconfig

enp0s3 Link encap:Ethernet HWaddr 08:00:27:71:02:68

inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0

inet6 addr: fe80::6e20:8ed3:2079:fa6e/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:9893 errors:0 dropped:0 overruns:0 frame:0

TX packets:1400 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes: (12.7 MB) TX bytes: (109.4 KB)

你知道里面每一项代表什么意思吗?

– `enp0s3`:这是网卡的名称,

– `Link encap:Ethernet`:这表示使用以太网协议进行链路封装。

– `HWaddr 08:00:27:71:02:68`:这是网卡的物理地址(MAC地址)。

– `inet addr:10.0.2.15`:这是网卡的IPv4地址,当前设置为动态分配的地址。

– `Bcast:10.0.2.255`:这是广播地址,用于向同一子网中的所有设备发送数据。

– `Mask:255.255.255.0`:这是子网掩码,用于确定网络地址和主机地址的范围。

– `inet6 addr: fe80::6e20:8ed3:2079:fa6e/64`:这是网卡的IPv6地址,当前设置为本地链路地址。

– `UP BROADCAST RUNNING MULTICAST`:这表示网卡已启用,并支持广播和多播功能。

– `MTU:1500`:这是最大传输单元(Maximum Transmission Unit),表示网卡一次可以传输的最大数据包大小。

– `RX packets:9893`:这是接收到的数据包的数量。

– `errors:0`:这是接收过程中发生的错误数量。

– `dropped:0`:这是接收过程中丢弃的数据包数量。

– `overruns:0`:这是接收过程中溢出的数据包数量。

– `frame:0`:这是接收过程中出现的帧错误数量。

– `TX packets:1400`:这是发送的数据包数量。

– `errors:0`:这是发送过程中发生的错误数量。

– `dropped:0`:这是发送过程中丢弃的数据包数量。

– `overruns:0`:这是发送过程中溢出的数据包数量。

– `carrier:0`:这是发送过程中的载波错误数量。

– `collisions:0`:这是发送过程中发生的碰撞数量。

– `txqueuelen:1000`:这是发送队列的长度。

– `RX bytes: (12.7 MB)`:这是接收到的字节数。

– `TX bytes: (109.4 KB)`:这是发送的字节数。

免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://itzsg.com/87459.html

(0)

相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

联系我们YX

mu99908888

在线咨询: 微信交谈

邮件:itzsgw@126.com

工作时间:时刻准备着!

关注微信