Linux IP Address Configuration
1 ifconfig:
Ifconfig eth0 192.168.1.123 netmask 255.255.255.0
2 setup:
Redhat series private
3 configuration file Configuration:
Profile 1 ----> Nic profile vi/etc/sysconfig/network-scripts/ifcfg-eth0
// Nic DEVICE name DEVICE = eth0
// Mac address
HWADDR = 00: 0C: 29: 91: A7: 26
// Type: Ethernet
TYPE = Ethernet
// Unique Identifier
UUID = a75b9b26-7262-45a4-875e-f5193e6318de
// Whether the eth0 takes effect when the network service is started
ONBOOT = no
// Whether it can be managed by the network manager graphical management tool
NM_CONTROLLED = yes
// Whether to automatically obtain the ip address (none static dhcp)
BOOTPROTO = dhcp
// Ip address
IPADDR = 192.168.1.123
// Subnet mask NETMASK = 255.255.255.0
// GATEWAY = 192.168.1.1
// DNS DNS1 = 202.106.0.20
// Ipv6 does not start IPV6INIT = no
// Non-root users are not allowed to control this Nic
USERCTL = no
Configuration File 2 ----> Host Name Information File vi/etc/sysconfig/networkNETWORKING = YES
HOSTNAME = localhost. localdomain
Hostname: the host name you just modified temporarily modifies the Host Name and does not need to be restarted.
Configuration File 3 ----> DNS configuration file vi/etc/resolv. conf // You can write multiple nameserver 202.106.0.20
// Default domain name: search localhost