ifconfig usage

Image:Vm-power-on-medium.png Usage Syntax

ifconfig interface [options] | (ip-address [netmask mask] | mac-address)

Common options include;

  • up | down - enable or disable the interface
  • metric - specify the interface metric (used by routing and other protocols)
  • mtu - specify the interface MTU in bytes
  • [-]arp - enable or disable ARP on the interface (enabled by default)
  • [-]promisc - enable or disable promiscuous mode on the interface (disabled by default)
  • hw ether mac-address - specify the interface MAC address

Image:Vm-power-on-medium.png Usage Examples

ifconfig - display current interface configuration and status

ifconfig eth0 1.1.1.1 netmask 255.255.255.0 - configure interface eth0 with an IP address of 1.1.1.1 and subnet mask of 255.255.255.0

ifconfig eth0:0 2.2.2.1 netmask 255.255.255.0 - configure interface eth0 with an IP alias (or secondary) of eth0:0 using an IP address of 2.2.2.1 and subnet mask of 255.255.255.0 (use eth0:1 onwards for more)

ifconfig eth0 -arp - disable ARP on interface eth0

ifconfig eth0 mtu 1400 - configure interface eth0 with an MTU of 1400 bytes

ifconfig  eth0 inet 192.168.1.1 up

 

 

注:

 

ifconfig 单独使用 只显示active的接口

ifconfig -a 显示所有接口

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值