10.2-3 ifup&ifdown:激活与禁用网络接口
ifup:激活网络接口
ifup 和 ifdown 命令用于激活指定的网络接口。ifup命令其实是一个Shel脚本,有Shel基础的读者可以使用which命令来找到这个脚本并读一读。命令可读取配置文件/etc/sysconfig/network和/etc/sysconfig/network-scripts/ifcfg-<configuration>对网络接口进行相应的操作。
ifdown:禁用网络接口
[root@cs6 ~]# ifdown eth1 [root@cs6 ~]# ifconfig eth0 Link encap:Ethernet HWaddr 00:AA:BB:CC:DD:EE inet addr:10.0.0.100 Bcast:10.0.0.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe8c:6a04/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:16249 errors:0 dropped:0 overruns:0 frame:0 TX packets:7819 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:20914267 (19.9 MiB) TX bytes:634620 (619.7 KiB) eth0:0 Link encap:Ethernet HWaddr 00:AA:BB:CC:DD:EE inet addr:10.0.0.101 Bcast:10.0.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 eth0:1 Link encap:Ethernet HWaddr 00:AA:BB:CC:DD:EE inet addr:10.0.0.8 Bcast:10.0.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:6 errors:0 dropped:0 overruns:0 frame:0 TX packets:6 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:504 (504.0 b) TX bytes:504 (504.0 b)