old-www/LDP/solrhe/Securing-Optimizing-Linux-R.../chap9sec90.html

287 lines
4.6 KiB
HTML

<HTML
><HEAD
><TITLE
>The /etc/sysconfig/network-scripts/ifcfg-ethN files</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.60"><LINK
REL="HOME"
TITLE="Securing and Optimizing Linux"
HREF="index.html"><LINK
REL="UP"
TITLE="Files -Networking Functionality"
HREF="file-netfunc.html"><LINK
REL="PREVIOUS"
TITLE="The /etc/HOSTNAME file"
HREF="chap9sec89.html"><LINK
REL="NEXT"
TITLE="The /etc/resolv.conf file"
HREF="chap9sec91.html"></HEAD
><BODY
CLASS="section"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Securing and Optimizing Linux: RedHat Edition -A Hands on Guide</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="chap9sec89.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 9. Files -Networking Functionality</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="chap9sec91.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="AEN5998"
>9.2. The <TT
CLASS="filename"
>/etc/sysconfig/network-scripts/ifcfg-ethN</TT
> files</A
></H1
><P
>&#13; File configurations for each network device you may have or want to add on your system are located in the <TT
CLASS="filename"
>/etc/sysconfig/network-scripts/</TT
> directory with Red Hat Linux 6.1 or 6.2 and
are named <TT
CLASS="literal"
>ifcfg-eth0</TT
> for the first interface and <TT
CLASS="literal"
>ifcfg-eth1</TT
> for the second, etc.
Following is a example <TT
CLASS="filename"
>/etc/sysconfig/network-scripts/ifcfg-eth0</TT
> file:
</P
><DIV
CLASS="informalexample"
><A
NAME="AEN6006"
></A
><P
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="programlisting"
>&#13; DEVICE=eth0
IPADDR=208.164.186.1
NETMASK=255.255.255.0
NETWORK=208.164.186.0
BROADCAST=208.164.186.255
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
</PRE
></TD
></TR
></TABLE
><P
></P
></DIV
><P
>&#13; If you want to modify your network address manually, or add a new network on a new interface, edit this file -<TT
CLASS="literal"
>ifcfg-ethN</TT
>, or create a new one and make the appropriate changes.
<P
></P
><UL
><LI
><P
>&#13; DEVICE=devicename, where devicename is the name of the physical network device.
</P
></LI
><LI
><P
>&#13; IPADDR=ipaddr, where ipaddr is the IP address.
</P
></LI
><LI
><P
>&#13; NETMASK=netmask, where netmask is the netmask IP value.
</P
></LI
><LI
><P
>&#13; NETWORK=network, where network is the network IP address.
</P
></LI
><LI
><P
>&#13; BROADCAST=broadcast, where broadcast is the broadcast IP address.
</P
></LI
><LI
><P
>&#13; ONBOOT=answer, where answer is yes or no. <EM
>Do the interface need to be active or inactive at boot time</EM
>.
</P
></LI
><LI
><P
>&#13; BOOTPROTO=proto, where proto is one of the following :
<P
></P
><OL
TYPE="i"
><LI
><P
>&#13; none - No boot-time protocol should be used.
</P
></LI
><LI
><P
>&#13; bootp - The bootp <EM
>now pump</EM
> protocol should be used.
</P
></LI
><LI
><P
>&#13; dhcp - The dhcp protocol should be used.
</P
></LI
></OL
>
</P
></LI
><LI
><P
>&#13; USERCTL=answer, where answer is one of the following:
<P
></P
><OL
TYPE="1"
><LI
><P
>&#13; yes <EM
>- Non-root users are allowed to control this device</EM
>.
</P
></LI
><LI
><P
>&#13; no <EM
>- Only the super-user root is allowed to control this device</EM
>.
</P
></LI
></OL
>
</P
></LI
></UL
>
</P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="chap9sec89.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="chap9sec91.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>The <TT
CLASS="filename"
>/etc/HOSTNAME</TT
> file</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="file-netfunc.html"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>The <TT
CLASS="filename"
>/etc/resolv.conf</TT
> file</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>