在cent-os中,你可以redhat-config-network工具非常方便的配置网络信息。如果你没有安装这个工具也没关系,你可以通过直接编辑/etc/sysconfig/network-scripts/下面的网卡配置文件来进行配置,下面说明一下网卡配置文件夹的各个选项参数:
-
BOOTPROTO=<protocol> , where <protocol> is one of the following:
-
none — No boot-time protocol should be used.
-
bootp — The BOOTP protocol should be used.
-
dhcp — The DHCP protocol should be used.
-
-
BROADCAST=<address> , where <address> is the broadcast address. This directive is deprecated.
-
DEVICE=<name> , where <name> is the name of the physical device (except for dynamically-allocated PPP devices where it is the logical name ).
-
DNS{1,2} =<address> , where <address> is a name server address to be placed in /etc/resolv.conf if the PEERDNS directive is set to yes .
-
IPADDR=<address> , where <address> is the IP address.
-
NETMASK=<mask> , where <mask> is the netmask value.
-
NETWORK=<address> , where <address> is the network address. This directive is deprecated.
-
ONBOOT=<answer> , where <answer> is one of the following:
-
yes — This device should be activated at boot-time.
-
no — This device should not be activated at boot-time.
-
-
PEERDNS=<answer> , where <answer> is one of the following:
-
yes — Modify /etc/resolv.conf if the DNS directive is set. If using DCHP, then yes is the default.
-
no — Do not modify /etc/resolv.conf .
-
-
SRCADDR=<address> , where <address> is the specified source IP address for outgoing packets.
-
USERCTL=<answer> , where <answer> is one of the following:
-
yes — Non-root users are allowed to control this device.
-
no — Non-root users are not allowed to control this device.
-