Linux命令ifconfig介绍

相关知识


ifconfig(interfaces config),用来在Linux系统获取网络接口配置信息并对此进行修改。


1.命令格式


ifconfig [网络设备] [参数]

2、命令参数


ifconfig eth0 up 					#启动指定网络设备/网卡。

ifconfig eth0 down 				#关闭指定网络设备/网卡。该参数可以有效地阻止通过指定接口的IP信息流,如果想永久地关闭一个接口,我们还需要从核心路由表中将该接口的路由信息全部删除。

ifconfig eth0 arp/-arp 			#设置指定网卡是否支持ARP协议。

-promisc 						#设置是否支持网卡的promiscuous模式,如果选择此参数,网卡将接收网络中发给它所有的数据包

-allmulti 						#设置是否支持多播模式,如果选择此参数,网卡将接收网络中所有的多播数据包

ifconfig eth0 add IPv6地址		#给指定网卡配置IPv6地址

ifconfig eth0 del IPv6地址		#删除指定网卡的IPv6地址

ifconfig eth0 192.168.120.56 netmask 255.255.255.0 broadcast 192.168.120.255		#设置ip、子掩码、广播地址			

ifconfig eth0 mtu<字节数> 		#设置网卡的最大传输单元 (bytes)

ifconfig eth0 hw ether 00:AA:BB:CC:DD:EE  		#用ifconfig修改MAC地址

tunel				#建立隧道

dstaddr 				#设定一个远端地址,建立点对点通信

-pointtopoint<地址> 	#为网卡设置点对点通讯协议

multicast 			#为网卡设置组播标志

address 				#为网卡设置IPv4地址

txqueuelen<长度> 	#为网卡设置传输列队的长度

猜你喜欢

转载自blog.csdn.net/fy_long/article/details/85328585