网络接口配置文件汇总

来源:互联网 发布:ae软件下载windows版 编辑:程序博客网 时间:2024/05/17 22:51
配置文件;
/etc/hosts
  显示主机名
    /etc/resolv.conf
       specifies the IP addresses of DNS servers and the search domain

    /etc/sysconfig/network
      路由和主机信息。/etc/sysconfig/networking/ directory is used by the Network Administration Tool
     (system-config-network) and its contents should not be edited manually. Using only one
      method for network configuration is strongly encouraged, due to the risk of configuration deletion
     
    /etc/sysconfig/network-scripts/ifcfg-<interface-name>

 参数:
BONDING_OPTS=<parameters>
  sets the configuration parameters for the bonding device, and is used in /etc/sysconfig/network-scripts/ifcfg-bond<N>. These
parameters are identical to those used for bonding devices in /sys/class/net/<bonding device>/bonding, and the module parameters for the bonding driver as described in bonding Module Directives. This configuration method is used so that multiple bonding devices can have different configurations. It is highly recommended to place all of your bonding options after the BONDING_OPTS directive in ifcfg-<name>. Do not specify options for the bonding device in / etc/modprobe.d/<bonding>.conf, or in the deprecated /etc/modprobe.conf file.


BOOTPROTO=<protocol>
  • 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, as the value is calculated automatically with ifcalc.


DEVICE=<name>
where <name> is the name of the physical device (except for dynamically-allocated PPP devices where it is the logical name).


DHCP_HOSTNAME
Use this option only if the DHCP server requires the client to specify a hostname before receiving  an IP address.
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.
ETHTOOL_OPTS=<options>
where <options> are any device-specific options supported by ethtool. For example, if you wanted to force 100Mb, full duplex:
ETHTOOL_OPTS="autoneg off speed 100 duplex full"
Instead of a custom initscript, use ETHTOOL_OPTS to set the interface speed and duplex settings. Custom initscripts run outside of the network init script lead to unpredictable results during a postboot  network service restart.
GATEWAY=<address>
where <address> is the IP address of the network router or gateway device (if any).
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 must be used in machines containing more than one NIC 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 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 be used in conjunction with HWADDR.
MASTER=<bond-interface>
where <bond-interface> is the channel bonding interface to which the Ethernet interface is linked.
This directive is used in conjunction with the SLAVE directive. Refer to Section 8.2.2, “Channel Bonding Interfaces” for more information about channel bonding interfaces.
NETMASK=<mask>
where <mask> is the netmask value.
NETWORK=<address>
where <address> is the network address. This directive is deprecated, as the value is calculated automatically with ifcalc.
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=<answer>
where <answer> 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 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.2, “Channel Bonding Interfaces” for more about channel bonding 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.


原创粉丝点击