(1) The intuitive way is: if you use the fedora system, enter setup in the command line and enter the static IP address according to the wizard, refer to my article "Building a NAT test environment for VMware Workstation"
(2) modify the configuration file and enter
Vim/etc/sysconfig/network-Script
S/ifcfg-eth0
Device = eth0
Onboot = Yes
Bootproto = static
Ipaddr = 192.168.0.3
Netmask = 255.255.255.0
Gateway = 192.168.0.1
Device = eth0 <-- Device
Onboot = Yes <-- whether to start automatically
Bootproto = static <-- whether to use a static IP Address
Ipaddr = XXX. XX <-- your IP address
Netmask = 255.255.255.0 <-- your subnet mask
Gateway = 192.168.0.1 <-- your gateway
Make the IP address take effect:
/Sbin/ifdown eth0
/Sbin/IFUP eth0
Configure DNS resolution
Echo "nameserver 211.98.1.28">/etc/resolv. conf
Notify gateway to update information:
/Etc/init. d/network restart
DNS is the domain name
System, which can convert a domain name such as www.21php.com to an IP address such as 211.152.50.35; without DNS, browse 21php.com
This website must be accessed with numbers as hard to remember as 211.152.50.35. The DNS server provides the DNS service. DNS servers can be divided into three types: high-speed cache servers
(Cache-only server), master server (Primary name server), and secondary server (second name server ).