Red Hat & CentOS Linux 网络相关配置文件说明

来源:互联网 发布:天刀吴彦祖捏脸数据 编辑:程序博客网 时间:2024/06/17 03:21
1. 主机地址配置文件  /etc/hosts
2. 网络服务信息文件  /etc/services
3. 超级守护程序xinetd与其配置文件  /etc/xinetd.config
4. 允许与拒绝地址配置文件  /etc/hosts.allow  和  /etc/hosts.deny
5. 网络配置文件  /etc/sysconfig/network
6. 主机查找配置文件  /etc/host.conf
7. 名称服务器查找顺序配置文件  /etc/resolv.conf
8. 网卡参数配置文件  /etc/sysconfig/network-scrips/ifcfg-eth*

9. 可加载模块配置文件  /etc/modprobe.conf

1.主机地址配置文件/etc/hosts,也叫本地主机文件,其内容为IP地址与其对应的主机名,用来实现将主机名称解析为IP地址。
格式:
IP地址 主机名 别名
内容如下:
127.0.0.1 localhost localhost.localdomain
192.168.1.1 debian debian
192.168.0.2 t02 t02.tiger
192.168.0.4 t04 t04.tiger
 
2.网络服务信息文件/etc/services
每行内容格式为:
服务名    端口号/协议    [别名]    [#注释]
内容大致如下:
# Each line describes one service, and is of the form:#
# service-name port/protocol [aliases ...] [# comment]
tcpmux 1/tcp # TCP port service multiplexer
tcpmux 1/udp # TCP port service multiplexer
rje 5/tcp # Remote Job Entry
rje 5/udp # Remote Job Entry
echo 7/tcp
echo 7/udp
discard 9/tcp sink null
discard 9/udp sink null
systat 11/tcp users
......
 
3.超级守护程序xinetd与其配置文件/etc/xinetd.config
4.允许与拒绝地址配置文件/etc/hosts.allow和/etc/hosts.deny
语法:
服务进程名:主机列表:当规则匹配时可选的命令操作
server_name:hosts-list[:command]
ALL:127.0.0.1 #允许本机访问本机所有服务进程
smbd:192.168.0.0/255.255.255.0 #允许192.168.0.网段的IP访问smbd服务
5.网络配置文件/etc/sysconfig/network,这个文件主要的功能在设置主机名称、及是否启动网络,大致内容如下:
NETWORKING=yes
HOSTNAME=localhost.localdomain
 
6.主机查找配置文件/etc/host.conf,该文件决定本地主机文件与DNS服务器在解析名称时的优先级,如下所示:
order hosts,bind
7.名称服务器查找顺序配置文件/etc/resolv.conf,决定dns服务器的优先级:
nameserver 192.168.1.8
nameserver 192.168.1.9
nameserver 202.96.128.64
search localdomain
 
8. 网卡参数配置文件/etc/sysconfig/network-scrips/ifcfg-ethx,设定网卡的参数,在大致内容如下:
DEVICE=ethX
BOOTPROTO=none
BROADCAST=x.x.x.x
HWADDR=00:50:BA:88:72:D4
IPADDR=x.x.x.x
NETMASK=255.255.255.0
NETWORK=x.x.x.x
ONBOOT=yes
TYPE=Ethernet
GATEWAY=x.x.x.x
9. 可加载模块配置文件/etc/modprobe.conf, 在系统启动时要加载的模块在此文件中指定.


此外还有一个比较重要的应用是ssh和sshd,分别是 security shell客户端和security shell daemon 服务器端守护进程,其配置文件在 /etc/ssh/目录下面

0 0
原创粉丝点击