Tag:os file io re c linux
1, search first, get the following explanation
IP IP address
Netmark Subnet mask
Gateway default gateway
HostName host name
DomainName domain name
DNS DNS IP
2, Files that need to be modified are often
/etc/sysconfig/network
/etc/sysconfig/network-scripts/ifcfg-eth0
/etc/resolv.conf
/etc/ Hosts
The following is my settings
/etc/sysconfig/network
Here is primarily a gateway
Networking=yes
Networking_ipv6=no
gateway= 192.168.1.1
Hostname=localhost.localdomain
/etc/sysconfig/network-scripts/ifcfg-eth0
Here the main designation is IP acquisition mode (static), IP address, subnet mask, network type
# Broadcom Corporation netxtreme BCM5721 Gigabit Ethernet PCI Express
DEVICE =eth0
#BOOTPROTO =dhcp
bootproto=static
ipaddr=192.168.1.21
netmask=255.255.255.0
Type=ethernet
hwaddr=xx:xx:xx:xx:xx:xx
Onboot=yes
/etc/resolv.conf
Specifies DNS (I ate a loss here, not set before the network address can not be resolved)
Search Localdomain
nameserver 192.168.1.1
/etc/hosts
I'm not set, it's used to define the hostname.