06.Linux网络配置文件
Linux网络配置文件
ifcfg-ens33
IP地址、子网掩码等配置文件。
路径:
[root@localhost ~]# ls /etc/sysconfig/network-scripts/ifcfg-ens33
/etc/sysconfig/network-scripts/ifcfg-ens33
内容:
[root@localhost network-scripts]# cat /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="dhcp"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="ens33"
UUID="09aa4ff9-4c3c-4d3b-8bfe-99e715415f71"
DEVICE="ens33"
ONBOOT="yes"
ifcfg-lo
网卡回环地址。
路径:
[root@localhost network-scripts]# ls /etc/sysconfig/network-scripts/ifcfg-lo
/etc/sysconfig/network-scripts/ifcfg-lo
内容:
[root@localhost network-scripts]# cat /etc/sysconfig/network-scripts/ifcfg-lo
DEVICE=lo
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
# If you're having problems with gated making 127.0.0.0/8 a martian,
# you can change this to something else (255.255.255.255, for example)
BROADCAST=127.255.255.255
ONBOOT=yes
NAME=loopback
resolv.conf
DNS配置文件。
路径:
[root@localhost network-scripts]# ls /etc/resolv.conf
/etc/resolv.conf
内容:
[root@localhost network-scripts]# cat /etc/resolv.conf
# Generated by NetworkManager
search localdomain
nameserver 192.168.234.2
hosts
设置主机和IP绑定信息。
路径:
[root@localhost network-scripts]# ls /etc/hosts
/etc/hosts
内容:
[root@localhost network-scripts]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
hostname
设置主机名。
路径:
[root@localhost network-scripts]# ls /etc/hostname
/etc/hostname
内容:
[root@localhost network-scripts]# cat /etc/hostname
localhost.localdomain

浙公网安备 33010602011771号