我的ifcfg-eth1配置如下
DEVICE=eth1 TYPE=Ethernet UUID=5e4f36f8-14eb-4f0c-8fa9-3af9be3899a7 ONBOOT=no NM_CONTROLLED=yes BOOTPROTO=dhcp DEFROUTE=yes IPV4_FAILURE_FATAL=yes IPV6INIT=no NAME="System eth1" HWADDR=00:0C:29:8A:A5:67 PEERDNS=yes PEERROUTES=yes
q1)ONBOOT做什么?我把它设置为NO但是当我做IFCONFIG时我仍然看到界面
[oracle@SJOAM network-scripts]$ifconfig -a eth0 Link encap:Ethernet HWaddr 00:0C:29:8A:A5:5D inet addr:192.168.1.25 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe8a:a55d/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:61 errors:0 dropped:0 overruns:0 frame:0 TX packets:28 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:13496 (13.1 KiB) TX bytes:2231 (2.1 KiB) eth1 Link encap:Ethernet HWaddr 00:0C:29:8A:A5:67 inet6 addr: fe80::20c:29ff:fe8a:a567/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:37 errors:0 dropped:0 overruns:0 frame:0 TX packets:3 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2412 (2.3 KiB) TX bytes:258 (258.0 b)
当我发出ifdown eth1时,ifconfig仍然显示eth1.
只有当我发出ifconfig eth1 stop时,才会从ifconfig中删除eth1.
q2)ONBOOT = no,ifdown eth1和ifconfig eth1之间有什么区别?
解决方法
ifdown ifdown接口应该取消配置,但它不会停止存在.它仍将显示在ifconfig或ip链接中,因为物理端口存在且Linux已为其加载了驱动程序. eth *提供了一个引用句柄,以便可以对其进行配置.如果你想让设备完全消失,你需要
disable the driver,这比大多数情况下的麻烦要多.