��һ�� �����ַ������
1. /etc/hostname.interface
Interface���������ͺţ���le��hme�ȡ�Le��ʮ��������hmeΪ���������ȵȡ������һ�����֣���һ��ʮ������Ϊ
le0���ڶ���Ϊle1���ڶ�����������Ϊhme0���ڶ���Ϊhme1�ȵȡ�
�ļ���������������������֣���Sunrise��Sunny��
��more /etc/hostname.le0
Sunrise
# more /etc/hostname.hme0
Sunny
2. /etc/hosts�ļ�
ϵͳ����IP��ַ��ӳ��
��/etc/hostname.interface Эͬ���������ñ���������ַ
# more /etc/hosts
127.0.0.1 localhost loghost
172.16.255.1 Sunrise
172.18.255.1 Sunny
ϵͳ�����ǻ���������������Ψһ�ģ�Ҫ���Ļ������������hostname��
����/etc/hostname.interface��/etc/hosts�����ļ���ϵͳ��֪��������������ˣ����һ������������������
Sunny�����Ӧ�ĵ�ַ��172.18.255.1��
3. /etc/netmasks�ļ�
�������IP��ַ�������ַ��ϵһ�𣬻�������
����DZ����Σ�����Ҫ����
������
A������0��127��127���ڱ��ص�ַ�� ���룺255..0.0.0
B������128��191 ���룺255.255.0.0
C������192��223 ���룺255.255.255.0
D������224��254�����ڶ�ַ�㲥��
Ҫ��һ��B���ַ��172.16.255.1����Ϊ��255.255.255.0������/etc/netmasks�ļ���д��172.16.255.0
255.255.255.0
4. ifconfig����
�������˿�״̬
��ifconfig -a
��������˿ڵ�ַ
��ifconfig le0 172.16.255.1 netmask 255.255.255.0
��������˿�״̬
��ifconfig le0 up/down
��������˿��Ƿ����
��ifconfig le0 plumb/unplumb
5. ping����
�������״̬
���������ٶ�
�ڶ��� �������
1. /etc/services�ļ�
�������Э��Ķ˿ں�
����Э��ķ�������
#cat /etc/inet/services
ftp-data 20/tcp
ftp 21/tcp
telnet 23/tcp
smtp 25/tcp mail
sunrpc 111/udp rpcbind
sunrpc 111/tcp rpcbind
��
ÿ��TCP/IPӦ�ò�����磨FTP��Telnet�����ڴ������һ���˿ںš�/etc/services�ļ�������ÿ����ʶ����ķ�
��Э������Ӧ�ľ�̬�˿ںš�Ӧ��Ӧʹ��Ψһ����Ķ˿ں������ṩ�ߺ�Զ�̶Ե�ʵ���ʶ�Լ���
�ļ���ÿһ��ɷ�����������صĶ˿ںš�����Э���ṩ����ɡ���Щ���������TCP��UDP�϶��������С���ʱ
���˷����г����Ρ�
ftp stream tcp nowait root /usr/sbin/in.ftpd in.ftpd
telnet stream tcp nowait root /usr/sbin/in.telnetd in.telnetd
login stream tcp nowait root /usr/sbin/in.rlogind in.rlogind
talk dgram udp wait root /usr/sbin/in.talkd in.talkd
...
UNIX��������ÿ�ַ�����ػ����̶����Լ��Ķ˿��ϵȴ������ǽ��������������ػ����̵ȴ����������
һ����inetd�ķ�����̡������Ϳ��Դ����ٶ�ϵͳ��Դ��ռ�á�ֻ�е�����������̷���һ����������ʱ������
�ļ����ֶΣ�
service_name �����ļ�/etc/services���г��ķ���ı�־����
socket_type ������־ʹ�õ����ݴ����������͡�
proto ��ʶ����Э������֡���UPD��TCP
flags ���Ա���Ϊ"�ȴ�"��"�ǵȴ�"���������Ϊ"�ȴ�" ״̬��inetd�ڻָ������˿��ϵ���������ʱ������ȴ�
�� ��Э���ͷŽ������ӵ���������ӡ�"�ǵȴ�"����ʹ inetd���������������������TCPЭ��IJ���"�ǵ�
��"��ʽ����UDP����"�ȴ�"��ʽ��
user ��ʾ���÷�����û�����
server_pathname ��ʾinetd����Ӧ��ط�������ʱ������õ� ������������·������
Args �����������ij�����ʹ�õ������в��������Գ������� ʼ��Ȼ������û����õIJ�����
������ ·�ɺ�����
1. /etc/defaulrouter�ļ�
����ȱʡ����
��ֹ����Ҫ��·�ɽ���
������ֻ��һ��·����ͨ����������
��һ·��ռ�ý�С��·�ɱ���Դ
���ļ�������ȱʡ·�ɵ���Ϣ��ϵͳ��װʱ��û�и��ļ������û��Լ������ġ��ļ�������ȱʡ·�ɵĵ�ַ��
��cat /etc/defaultrouter
172.16.255.254
�ŵ㣺
ռ����Դ�٣�ֻ��һ��·����Ŀ��
2. /etc/gateways�ļ�
·�ɱ��ļ�
net gateway metric
dest. net Ŀ������
router ��һ��·�����ĵ�ַ
count ����
3. route����
route add|delete [host|net] destination [gateway ]
Add a route
#route add net 128.50.3.0 192.168.1.1 1
Delete a route
#route delete net 128.50.2.0 192.168.12.2
4. �鿴·�ɱ�
# netstat -r
Routing Table:
Destination Gateway Flags Ref Use Interface
----------- ---------- ----- --- --- ---------
localhost localhost UH 0 2272 lo0
202.96.0.0 192.168.12.1 U 3 562 le0
10.103.0.0 192.168.12.2 U 3 562 le0
#
Destination Ŀ�����������
Gateway ת�����ݰ�������
Flags ����·�ɵ�״̬�������������������ѡ�
U �˿ڴ��ڼ���״̬��up��
H Ŀ���Ǹ�����������������
Ref ͬһ������ӿڵ�ַӵ�е�·����Ŀ����
Use ͨ������·�ɵİ�����������localhost��˵��������ִ��� ���н��յİ�����
Interface ·�ɵ�����ӿ�
������ DNS�ͻ��˵�����
��¼DNS�������ĵ�ַ������
�ؼ��֣�
domainname
nameserver
nameserver 172.16.255.3
��¼������������˳�����Ϣ
#
# /etc/nsswitch.dns:
#
# DNS for hosts lookups, otherwise it does not use any other naming service.
#
# "hosts:" and "services:" in this file are used only if the
# /etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports.
passwd: files
group: files
hosts: files dns
ipnodes: files
��
��
������ļ���hosts��¼���ó�hosts: files dns
3. nslookup����
���ڲ�ѯDNS������
������֤�ͻ��˵�����
��������DNS���ݿ�
# nslookup
Address: 202.96.96.68
Address: 202.96.96.68
Non-authoritative answer:
Address: 192.18.97.241
>
����ʱ��nslookupȱʡ���Ա��ط�����ΪĿ�ꡣ��Ӧ�а���Ŀ������������ֺ͵�ַ��
>����ʾ��������ζ�ſ��Կ�ʼ�������ַ���ѯ�ʻ����á�