linux 网卡配置文件详解
2009-05-19 20:11
579 查看
节选自:http://www.redhat.com/docs/manuals/enterprise/RHEL-3-Manual/ref-guide/s1-networkscripts-interfaces.html
Ethernet Interfaces
One of the most common interface files isifcfg-eth0, which controls the first Ethernet
network interface card[/i] or
NIC[/i] in the system. In a system with multiple
NICs, there are multiple
ifcfg-eth<X>
files (where <X> is a unique number
corresponding to a specific interface). Because each device has its own
configuration file, an administrator can control how each interface
functions individually.
The following is a sample ifcfg-eth0 file for a
system using a fixed IP address:
DEVICE=eth0 BOOTPROTO=none ONBOOT=yes NETWORK=10.0.1.0 NETMASK=255.255.255.0 IPADDR=10.0.1.27 USERCTL=no |
on other values. For example, the ifcfg-eth0 file
for an interface using DHCP looks quite a bit different because IP
information is provided by the DHCP server:
DEVICE=eth0 BOOTPROTO=dhcp ONBOOT=yes |
(redhat-config-network) is an easy way to make
changes to the various network interface configuration files (refer to the
chapter titled Network Configuration[/i] in the
Red Hat Enterprise Linux System Administration Guide[/i] for detailed instructions on using
this tool).
However, it is also possible to edit the configuration files for a given network
interface manually.
Below is a listing of the configurable parameters in an
Ethernet interface configuration file:
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[/i]).
DHCP_HOSTNAME ― Only use this option if
the DHCP server requires the client to specify a hostname before
receiving an IP address. (The DHCP server daemon in Red Hat Enterprise Linux does not
support this feature.)
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.
HWADDR=<MAC-address>,
where <MAC-address> is the hardware
address of the Ethernet device in the form
AA:BB:CC:DD:EE:FF. This directive is
useful for machines with multiple NICs to ensure that the interfaces
are assigned the correct device names regardless of the configured
load order for each NIC's module. This directive should
not[/i] be used in conjunction with
MACADDR.
IPADDR=<address>,
where <address> is
the IP address.
MACADDR=<MAC-address>,
where <MAC-address> is the hardware
address of the Ethernet device in the form
AA:BB:CC:DD:EE:FF. This directive is used
to assign a MAC address to an interface, overriding the one assigned
to the physical NIC. This directive should not[/i]
be used in conjunction with HWADDR.
MASTER=<bond-interface>,where
<bond-interface>
is the channel bonding interface to which the interface the Ethernet
interface is linked.
This directive is used in conjunction with the
SLAVE directive.
Refer to Section 8.2.3 Channel Bonding Interfaces
for more about channel bonding interfaces.
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 DHCP, then yes is the
default.
no ― Do not modify
/etc/resolv.conf.
SLAVE=<bond-interface>,where
<bond-interface> is
one of the following:
yes ― This device is controlled
by the channel bonding interface specified in the
MASTER directive.
no ― This device is
not[/i] controlled by the channel bonding
interface specified in the MASTER
directive.
This directive is used in conjunction with the
MASTER directive.
Refer to Section 8.2.3 Channel Bonding Interfaces
for more about channel bond interfaces.
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.
相关文章推荐
- linux网卡配置文件详解
- Linux网卡配置文件详解
- linux网卡配置文件详解
- Linux网卡的配置文件详解及应用
- 详解Linux启动流程及需要使用到的配置文件
- Linux_VMWare_虚拟机下调出网卡配置文件
- linux下mysql配置文件my.cnf详解
- Linux系统配置文件 /etc/sysconfig详解
- linux中ftp配置文件详解
- linux下mysql配置文件my.cnf详解【转】
- Linux网络服务配置文件详解
- Linux 网卡特性配置ethtool详解
- linux下mysql配置文件my.cnf详解
- linux ifconfig命令参数及用法详解--linux查看配置网卡命令
- ifconfig命令_Linux ifconfig 命令用法详解:配置和显示Linux系统网卡的网络参数
- 详解Linux系统中的进程初始化配置文件inittab
- linux创建用户 限制权限-用户(User)和用户组(Group)配置文件详解
- linux创建用户 限制权限-用户(User)和用户组(Group)配置文件详解
- Linux配置启动挂载:fstab文件详解
- Linux网卡配置文件解释