?? linux tutorial - linux network administration.mht
字號:
sendmail=20
identify your server correctly) i.e.: <PRE> =
<I>XXX.XXX.XXX.XXX</I> superserver.yolinux.com superserver
</PRE>This informs Linux of local systems on the network which are=20
not handled by the DNS server. (or for all systems in your LAN =
if you=20
are not using DNS or NIS) <BR>Red Hat/Fedora GUI:=20
<TT>/usr/sbin/system-config-network</TT> (select tab "Hosts".=20
<P></P>
<LI>File: <TT>/etc/<A=20
=
href=3D"http://node1.yo-linux.com/cgi-bin/man2html?cgi_command=3Dnsswitch=
.conf">nsswitch.conf</A></TT>=20
<B>- System Databases and Name Service Switch configuration =
file</B>=20
<DL>
<DD>
<TABLE cellSpacing=3D1 cellPadding=3D4 width=3D"100%" =
bgColor=3D#000000=20
border=3D1>
<TBODY>
<TR bgColor=3D#c0c0c0>
<TD><PRE>hosts: files dns nisplus nis
</PRE></TD></TR></TBODY></TABLE></DD></DL>This example tells Linux=20
to first resolve a host name by looking at the local hosts=20
file(<TT>/etc/hosts</TT>), then if the name is not found look to =
your=20
DNS server as defined by <TT>/etc/resolv.conf</TT> and if not =
found=20
there look to your NIS server.=20
<P>In the past this file has had the following names:=20
/etc/nsswitch.conf, /etc/svc.conf, /etc/netsvc.conf, ... =
depending on=20
the distribution. </P></LI></UL>
<P>
<HR noShade SIZE=3D5>
<TABLE cellSpacing=3D0 cellPadding=3D2 width=3D"100%" border=3D0>
<TBODY>
<TR bgColor=3D#c0c0c0>
<TD><B><BIG>Fedora / Red Hat Network Configuration=20
Files:</BIG></B></TD></TR></TBODY></TABLE>
<P>
<UL>
<LI>/etc/sysconfig/network=20
<P>Red Hat network configuration file used by the system during =
the boot=20
process.=20
<P></P>
<LI>File: <TT>/etc/sysconfig/network-scripts/ifcfg-eth0</TT>=20
<BR>Configuration settings for your first ethernet port (0). =
Your second=20
port is eth1.=20
<P></P>
<LI>File: <TT>/etc/modules.conf</TT> (or for older systems:=20
/etc/conf.modules) <BR>Example statement for Intel ethernet =
card:=20
<DL>
<DD>
<TABLE cellSpacing=3D1 cellPadding=3D4 width=3D"100%" =
bgColor=3D#000000=20
border=3D1>
<TBODY>
<TR bgColor=3D#c0c0c0>
<TD><PRE>alias eth0 eepro100
</PRE></TD></TR></TBODY></TABLE></DD></DL>Modules for other devices=20
on the system will also be listed. This tells the kernel which =
device=20
driver to use if configured as a loadable module. (default for =
Red Hat)=20
</LI></UL><A name=3DGUI></A>
<P>
<HR SIZE=3D5>
<TABLE cellSpacing=3D0 cellPadding=3D2 width=3D"100%" border=3D0>
<TBODY>
<TR bgColor=3D#ffcc33>
<TD><B><BIG>Fedora / Red Hat Network GUI Configuration=20
Tools:</BIG></B></TD></TR></TBODY></TABLE>
<P>The following GUI tools edit the system configuration files. =
There is=20
no difference in the configuration developed with the GUI tools =
and that=20
developed by editing system configuration files directly.=20
<TABLE>
<TBODY>
<TR>
<TD vAlign=3Dtop><B>TCP/IP ethernet configuration:</B>=20
<UL>
<LI>Network configuration:=20
<BR><TT>/usr/sbin/system-config-network</TT> (FC-2/3) GUI =
shown=20
here ---> <BR><TT>/usr/bin/redhat-config-network</TT>=20
(/usr/bin/neat) (RH 7.2+ FC-1)=20
<LI>Text console configuration tool:=20
<BR><TT>/usr/sbin/system-config-network-tui</TT> (Text =
User=20
Interface (TUI) for Fedora Core 2/3)=20
<BR><TT>/usr/bin/redhat-config-network-tui</TT> (RH 9.0 - =
FC-1)=20
<LI>Text console network configuration tool. <BR>First =
interface=20
only - eth0: <TT>/usr/sbin/netconfig</TT>=20
<LI><TT>/usr/bin/netcfg</TT> (GUI) (last available with RH =
7.1)=20
</LI></UL><B>Gnome Desktop:</B>=20
<UL>
<LI>Gnome Desktop Network Configuration=20
<BR><TT>/usr/bin/gnome-network-preferences</TT> (RH 9.0 - =
FC-3)=20
<BR>Proxy configuration. Choose one of three options:=20
<OL>
<LI>Direct internet connection=20
<LI>Manual proxy configuration (specify proxy and port)=20
<LI>Automatic proxy configuration (give URL) =
</LI></OL></LI></UL></TD>
<TD vAlign=3Dtop><IMG=20
=
src=3D"http://www.yolinux.com/TUTORIALS/images/system-config-network-scre=
en-1.gif"=20
align=3Dright>=20
<P></P></TD></TR></TBODY></TABLE><A name=3DASSIGNIP></A>
<P>
<HR SIZE=3D5>
<TABLE cellSpacing=3D0 cellPadding=3D2 width=3D"100%" border=3D0>
<TBODY>
<TR bgColor=3D#ffcc33>
<TD><B><BIG>Assigning an IP =
address:</BIG></B></TD></TR></TBODY></TABLE>
<P>Computers may be assiged a static IP address or assigned one=20
dynamically.=20
<P>
<H3>Static IP address assignment:</H3>
<P>Choose one of the following methods:=20
<UL>
<LI>Command Line: <PRE> /sbin/<A =
href=3D"http://node1.yo-linux.com/cgi-bin/man2html?cgi_command=3Difconfig=
">ifconfig</A> eth0 192.168.10.12 netmask 255.255.255.0 broadcast =
192.168.10.255
</PRE>Network address by convention would be the lowest:=20
192.168.10.0 <BR>Broadcast address by convention would be the =
highest:=20
192.168.10.255 <BR>The gateway can be anything, but following=20
convention: 192.168.10.1=20
<P>Note: the highest and lowest addresses are based on the =
netmask. The=20
previous example is based on a netmask of 255.255.255.0=20
<P></P>
<LI>Red Hat / Fedora GUI tools:=20
<UL>
<LI><TT>/usr/bin/neat</TT> Gnome GUI network administration =
tool.=20
Handles all interfaces. Configure for Static IP or DHCP =
client.=20
<BR>(First available with Red Hat 7.2.)=20
<LI><TT>/usr/bin/netcfg</TT> (Handles all interfaces) (last =
available=20
in Red Hat 7.1) </LI></UL>
<P></P>
<LI>Red Hat / Fedora Console tools:=20
<UL>
<LI><TT>/usr/sbin/system-config-network-tui</TT> (Text User =
Interface)=20
<LI><TT>/usr/sbin/netconfig</TT> (Only seems to work for the =
first=20
network interface eth0 but not eth1,...) </LI></UL>
<P></P>
<LI>Directly edit configuration files/scripts. See format below. =
</LI></UL>
<P>The ifconfig command does NOT store this information =
permanently. Upon=20
reboot this information is lost. (Manually add the commands to the =
end of=20
the file <TT>/etc/rc.d/rc.local</TT> to execute them upon boot.) =
The=20
commands netcfg and netconfig make permanent changes to system =
network=20
configuration files located in =
<TT>/etc/sysconfig/network-scripts/</TT>,=20
so that this information is retained.=20
<P>The IANA has allocated IP addresses in the range of 192.168.0.0 =
to=20
192.168.255.255 for private networks.=20
<P><B>Helpful tools:</B>=20
<UL>
<LI><A =
href=3D"http://www.cisco.com/techtools/ip_addr.html">Cisco's IP=20
Subnet calculator</A>=20
<LI><A=20
=
href=3D"http://www.belchfire.net/webtools/cidr_converstion_table.html">CI=
DR=20
Conversion table</A> - CIDR values, masks etc. </LI></UL>
<P>
<HR noShade SIZE=3D5>
<TABLE cellSpacing=3D0 cellPadding=3D2 width=3D"100%" border=3D0>
<TBODY>
<TR bgColor=3D#c0c0c0>
<TD><B><BIG>Ubuntu / Debian IP Configuration=20
Files:</BIG></B></TD></TR></TBODY></TABLE>
<P>File: <TT>/etc/network/interfaces</TT>=20
<DL>
<DD>Static IP example:=20
<TABLE cellSpacing=3D1 cellPadding=3D4 width=3D"100%" =
bgColor=3D#000000=20
border=3D1>
<TBODY>
<TR bgColor=3D#c0c0c0>
<TD><PRE>auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 208.88.34.106
netmask 255.255.255.248
broadcast 208.88.34.111
network 208.88.34.104
gateway 208.88.34.110
</PRE></TD></TR></TBODY></TABLE>
<P>Dynamic IP (DHCP) example:=20
<TABLE cellSpacing=3D1 cellPadding=3D4 width=3D"100%" =
bgColor=3D#000000=20
border=3D1>
<TBODY>
<TR bgColor=3D#c0c0c0>
<TD><PRE>auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
auto eth1
iface eth1 inet dhcp
auto eth2
iface eth2 inet dhcp
auto ath0
iface ath0 inet dhcp
auto wlan0
iface wlan0 inet dhcp
</PRE></TD></TR></TBODY></TABLE>Interfaces:=20
<UL>
<LI>lo: Loopback interface (network within your system without =
slowing=20
down for the real ethernet based network)=20
<LI>eth0: First ethernet interface card=20
<LI>wlan0: First wireless network interface </LI></UL>
<P>Also see "<TT>man interfaces</TT>" </P></DD></DL>
<P>
<HR noShade SIZE=3D5>
<TABLE cellSpacing=3D0 cellPadding=3D2 width=3D"100%" border=3D0>
<TBODY>
<TR bgColor=3D#c0c0c0>
<TD><B><BIG>Red Hat / Fedora Core IP Configuration=20
Files:</BIG></B></TD></TR></TBODY></TABLE>
<P>The Red Hat configuration tools store the configuration =
information in=20
the file <TT>/etc/sysconfig/network</TT>. <BR>They will also allow =
one to=20
configure routing information.=20
<P>
<UL>
<LI>File: <TT>/etc/sysconfig/network</TT>=20
<P>Static IP address Configuration: (Configure gateway address)=20
<DL>
<DD>
<TABLE cellSpacing=3D1 cellPadding=3D4 width=3D"100%" =
bgColor=3D#000000=20
border=3D1>
<TBODY>
<TR bgColor=3D#c0c0c0>
<TD><PRE>NETWORKING=3Dyes
HOSTNAME=3D<I>my-hostname</I> <B><I>- Hostname is defined here and =
by command hostname</I></B>
FORWARD_IPV4=3Dtrue <B><I>- True for NAT firewall gateways and =
linux routers.=20
False for everyone else - desktops and =
servers.</I></B>
GATEWAY=3D"<I>XXX.XXX.XXX.YYY</I>" <B><I>- Used if your network is =
connected to another network or the internet.=20
Static IP configuration. Gateway not defined =
here for DHCP client.</I></B>
</PRE></TD></TR></TBODY></TABLE></DD></DL>OR for DHCP client=20
configuration:=20
<DL>
<DD>
<TABLE cellSpacing=3D1 cellPadding=3D4 width=3D"100%" =
bgColor=3D#000000=20
border=3D1>
<TBODY>
<TR bgColor=3D#c0c0c0>
<TD><PRE>NETWORKING=3Dyes
HOSTNAME=3D<I>my-hostname</I> <B><I>- Hostname is defined here and =
by command hostname</I></B>
</PRE></TD></TR></TBODY></TABLE>(Gateway is assigned by DHCP server.)=20
</DD></DL>OR for NIS client configuration:=20
<DL>
<DD>
<TABLE cellSpacing=3D1 cellPadding=3D4 width=3D"100%" =
bgColor=3D#000000=20
border=3D1>
<TBODY>
<TR bgColor=3D#c0c0c0>
<TD><PRE>NETWORKING=3Dyes
HOSTNAME=3D<I>my-hostname</I> <B><I>- Hostname is defined here and =
by command hostname</I></B>
NISDOMAIN=3D<I>NISProject1</I> <B><I>- NIS domain to attach</TT>
</PRE></I></B></TD></TR></TBODY></TABLE></DD></DL>
<P></P>
<LI>File (Red Hat/Fedora):=20
<TT>/etc/sysconfig/network-scripts/ifcfg-eth0</TT> =
<BR>(S.u.s.e.:=20
=
<TT>/etc/sysconfig/network/ifcfg-eth-id-<I>XX:XX:XX:XX:XX</I></TT>)=20
<BR>This file used by the command scripts <TT>ifup</TT> and=20
<TT>ifdown</TT>=20
<P>Static IP address configuration:=20
<DL>
<DD>
<TABLE cellSpacing=3D1 cellPadding=3D4 width=3D"100%" =
bgColor=3D#000000=20
border=3D1>
<TBODY>
<TR bgColor=3D#c0c0c0>
<TD><PRE>DEVICE=3Deth0
BOOTPROTO=3Dstatic
BROADCAST=3DXXX.XXX.XXX.255
IPADDR=3D<I>XXX.XXX.XXX.XXX</I>
NETMASK=3D255.255.255.0
NETWORK=3D<I>XXX.XXX.XXX.0</I>
ONBOOT=3Dyes <B><I><FONT color=3D#00aa00>- Will =
activate upon system boot</FONT></I></B>
</PRE></TD></TR></TBODY></TABLE>RHEL4/FC3 additions:=20
<UL>
<LI>TYPE=3DEthernet=20
<LI>HWADDR=3D<I>XX:XX:XX:XX:XX:XX</I>=20
<LI>GATEWAY=3D<I>XXX.XXX.XXX.XXX</I> </LI></UL></DD></DL>
<P>OR for DHCP client configuration:=20
<DL>
<DD>
<TABLE cellSpacing=3D1 cellPadding=3D4 width=3D"100%" =
bgColor=3D#000000=20
border=3D1>
<TBODY>
<TR bgColor=3D#c0c0c0>
<TD><PRE>DEVICE=3Deth0
ONBOOT=3Dyes
BOOTPROTO=3Ddhcp
</PRE></TD></TR></TBODY></TABLE>RHEL4/FC3 additions:=20
<UL>
<LI>IPV6INIT=3Dno=20
<LI>USERCTL=3Dno=20
<LI>PEERDNS=3Dyes=20
<LI>TYPE=3DEthernet=20
<LI>HWADDR=3D<I>XX:XX:XX:XX:XX:XX</I> =
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -