参考了:https://blog.csdn.net/GDUTLYP/article/details/50498202网络
如下网卡均采用eth1说明。spa
相同点——【启用】和【禁止】网卡.net
ifdown eth1 / ifconfig eth1 down 禁用网卡blog
ifup eth1 / ifconfig eth1 up 启用网卡接口
不一样点有三:ip
1、命令与脚本——属性不一样内存
ifdown/ifup eth1 设定网络参数时使用的指令get
ifconfig eth1 down/up 设定网络参数时使用的脚本
配置
2、自动配置与手动修改network
ifup / ifdown 是修改配置文件里面的参数
ifconfig 是手动修改网络接口参数
说明:
ifup 与 ifdown 脚本是以 /etc/sysconfig/network-scripts/ifcfg-eth1文件来进行激活的;加载/etc/sysconfig/network-scripts/ifcfg-eth1至内存,而后在内存中相应的参数。
因此在使用ifup/ifdown前,首先要确认ifcfg-eth1文件是否存在于正确的目录内,若是不存在则会启动或关闭失败——ifdown/ifup运行成功的必要条件:存在网卡eth1;网卡eth1的配置文件路径正确。
3、启动/关闭eth1时的效果不同
ifdown eth1 ipv4和ipv6均关闭;eth1没法ping通
ifconfig eth1 down ipv4关闭;eth1仍然能够ping通
ifdown/ifup 闭/开ipv4和ipv6
ifconfig eth1 down/up 闭/开ipv4
ifdown eth1以后
ifcongfig eth1 down以后
ifup eth1以后
ifconfig eth1 up以后
ifconfig eth1 up 等效于 ip link set eth1 up
ifconfig eth1 down 等效于 ip link set eth1 down
ifconfig eth1 up/down && ip link set eth1 up/down 与 ifup/ifdown eth1 的本质区别有待完善!!!!