ifconfig

命令格式:

ifconfig [-v] [-a] [-s] [interface]

ifconfig [-v] interface [aftype] options | address ...

配置网络接口

选项:

-a     显示当前所有可获取的网络接口信息,包括状态为down的接口

-s     已短列表方式显示(类似 netstat -i)

-v     be more verbose for some error conditions

interface

网络接口名称

up     This flag causes the interface to be activated.  It is implicitly specified if  an  address  is

assigned to the interface.

down   This flag causes the driver for this interface to be shut down.

[-]arp 打开或关闭指定接口上的ARP协议。前面加上减号用于关闭该选项。

[-]promisc

关闭或启动指定网络设备的混杂模式(promiscuous mode)。如果启动混杂模式,该网络接口将接收网络上的所有数据包。

前面加上减号用于关闭该选项。

[-]allmulti

Enable or disable all-multicast mode.  If selected, all multicast packets on the  network  will

be received by the interface.

mtu N  This parameter sets the Maximum Transfer Unit (MTU) of an interface.

dstaddr addr

Set  the  remote IP address for a point-to-point link (such as PPP).  This keyword is now obso‐

lete; use the pointopoint keyword instead.

netmask addr

Set the IP network mask for this interface.  This value defaults to the usual class A, B  or  C

network mask (as derived from the interface IP address), but it can be set to any value.

add addr/prefixlen

Add an IPv6 address to an interface.

del addr/prefixlen

Remove an IPv6 address from an interface.

tunnel ::aa.bb.cc.dd

Create a new SIT (IPv6-in-IPv4) device, tunnelling to the given destination.

irq addr

Set  the  interrupt line used by this device.  Not all devices can dynamically change their IRQ

setting.

io_addr addr

Set the start address in I/O space for this device.

mem_start addr

Set the start address for shared memory used by this device.  Only a few devices need this.

media type

Set the physical port or medium type to be used by the device.  Not all devices can change this

setting,  and  those  that  can  vary in what values they support.  Typical values for type are

10base2 (thin Ethernet), 10baseT (twisted-pair 10Mbps Ethernet), AUI (external transceiver) and

so on.  The special medium type of auto can be used to tell the driver to auto-sense the media.

Again, not all drivers can do this.

[-]broadcast [addr]

If the address argument is given, set the protocol broadcast address for this interface.   Oth‐

erwise, set (or clear) the IFF_BROADCAST flag for the interface.

[-]pointopoint [addr]

This  keyword enables the point-to-point mode of an interface, meaning that it is a direct link

between two machines with nobody else listening on it.

If the address argument is also given, set the protocol address of the other side of the  link,

just  like the obsolete dstaddr keyword does.  Otherwise, set or clear the IFF_POINTOPOINT flag

for the interface.

hw class address

Set the hardware address of this interface, if the device driver supports this operation.   The

keyword  must  be followed by the name of the hardware class and the printable ASCII equivalent

of the hardware address.  Hardware classes currently supported include ether  (Ethernet),  ax25

(AMPR AX.25), ARCnet and netrom (AMPR NET/ROM).

multicast

Set  the multicast flag on the interface. This should not normally be needed as the drivers set

the flag correctly themselves.

address

给接口指定的IP地址.

txqueuelen length

Set the length of the transmit queue of the device. It is useful to set this  to  small  values

for  slower devices with a high latency (modem links, ISDN) to prevent fast bulk transfers from

disturbing interactive traffic like telnet too much.

应用举例:

# ifconfig

时间: 2024-10-14 10:09:04

ifconfig的相关文章

docker run常用命令及 解决 ubuntu镜像无法识别 ifconfig ping 命令

docker run -it     docker 前端启动 container容器           -d             后端启动 container容器           -p             固定端口映射            -P             不固定端口映射           --name         给生成的容器起名字docker ps:默认显示正在运行的container       ps -a 显示所有的container容器docker r

linux - ifconfig

功能简述:产看网络设备的配置 命令格式:ifconfig[网络设备][参数] 使用实例: [[email protected] ~]# ifconfig eth0      Link encap:Ethernet  HWaddr 00:0C:29:54:AF:74 inet addr:192.168.231.128  Bcast:192.168.231.255  Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe54:af74/64 Scope:Li

ifconfig显示的网卡信息和我的配置文件名不符

比如我的配置文件, cd /etc/sysconfig/network-scripts/ifcfg-Auto_eth0是这个名称,但是我使用ifconfig显示的信息却是 eth6      Link encap:Ethernet  HWaddr 08:00:27:3F:55:54 inet addr:192.168.137.103  Bcast:192.168.137.255  Mask:255.255.255.0 inet6 addr: fe80::a00:27ff:fe3f:5554/64

用ifconfig命令,只有lo,没有eth0的解决方案

问题描述:视频中输入ifconfig命令,显示eth0和lo,但是自己在虚拟机中并非得到这样的结果,而是只有lo,即网卡未启动,也没有ip,无法用Xshell远程连接. 解决方案: 1. 进入/etc/sysconfig/network-scripts 目录,发现有ifcfg-eth0,即网卡(驱动)存在但未启用. 2. 输入ifconfig -a命令,可显示eth0和lo. 3. 输入ifconfig eth0 up,启用网卡.此时用ifconfig,只能看到inet6(ipv6?)的地址,没

ifconfig、route、ip route、ip addr、 ip link 用法

网络管理是一个复杂而庞大的体系,博主最近刚好学了一点关于网络的知识,就跟大家分享一下,如何管理网卡.配置及查看ip地址和路由表.主要通过以下几个命令来演示一下. 一.ifconfig 1)配置地址: 比如修改eth0网卡的ip为192.168.174.100,子网掩码为255.255.255.0 ifconfig eth0 192.168.174.100/24 使用ifconfig修改ip会直接在内存中生效,重启系统或者重启network服务就丢失. 重启服务:Centos6:service n

Docker的ubuntu镜像安装的容器无ifconfig和ping命令的解决

Docker的Ubuntu镜像安装的容器无ifconfig命令和ping命令 解决: apt-get update apt install net-tools       # ifconfig apt install iputils-ping     # ping

记一次ifconfig命令

由于Windows 10的强制更新,原来的Virtual box Host-Only驱动莫名奇妙的不见了,于是上网找各种解决方案: 1.重新生成虚拟网卡适配器:执行 VBoxManage.exe hostonlyif create 2.配置宿主机器Ip 3.虚拟机设置同一网段Ip,sudo ifconfig enp0s8 192.168.56.102

linux命令ifconfig、route、netstat基本用法

Linux网络属性管理 局域网:以太网,令牌环网 Ethernet: CSMA/CD 冲突域 广播域 MAC:Media Access Control 48bits: 24bits: 24bits: IP: Internet Protocol Routing protocol Routed protocol OSI, TCP/IP tcp/ip分层: application layer transport layer internet layer datalink layer pysical l

CentOS 7 ifconfig: command not found

# ifcon-bash: ifconfig: command not found谷歌了一下,整理了一下解决思路 查看ifconfig命令是否存在 查看 /sbin/ifconfig是否存在 如果ifconfig命令存在,查看环境变量设置 #echo $PATH 如果环境变量中没有包含ifconfig命令的路径 临时修改环境变量:在shell中输入 $export PATH = $PATH:/sbin 然后再输入ifconfig命令即可,但是这只是临时更改了shell中的PATH,如果关闭she