Linux 网络管理-ifconfig命令
Linux 网络管理-ifconfig命令
- 查看网络接口:
ifconfig或ifconfig <接口名称>或ifconfig -a - 网络接口开启与关闭:
ifconfig eth0 up或ifconfig eth0 down - 设置 IPv4 地址、子网掩码、广播地址:
ifconfig eth0 192.168.1.56 netmask 255.255.255.0 broadcast 192.168.1.255 - 设置 IPv6 地址:
ifconfig eth0 add 33ffe:3240:800:1005::2/64 - 删除 IPv6 地址:
ifconfig eth0 del 33ffe:3240:800:1005::2/64 - 修改 MAC 地址(该命令会关闭网卡):
ifconfig eth1 hw ether 00:1D:1C:1D:1E - 开启与关闭 ARP 协议:
ifconfig eth0 arp与ifconfig eth0 -arp