ip和ifconfig命令对比
ip和ifconfig命令对比
ip 命令使用的是 Netlink 套接字,是现代网络接口配置工具。
ifconfig 命令,使用 ioctl 系统调用,是过时的网络接口配置工具,缺乏对网络命名空间的支持。
ip 命令比 ifconfig 更详细、更复杂、功能更强。
查看网络和ip地址:
ifconfigip addrrss show,简写ip a
添加ip地址:
ifconfig eth0 add 192.168.206.11ip address add 192.168.206.11 dev eth0,简写ip a add 192.168.206.11 dev eth0
移除一个ip地址:
ifconfig eth0 del 192.168.206.11ip a del 192.168.206.11 dev eth0
启用或禁用组播:
ifconfig eth0 multicastip link set dev eth0 multicast on
启用或禁用网络:
ifconfig eth0 up,或ifup eth0ip link set eth0 up
开启和关闭ARP:
ifconfig eth0 arpip link set dev eth0 arp on