(1) Intuitive way is, if you use Fedora System, at the command line input: Setup, according to the wizard input static IP, you can refer to my article "VMware Workstation build NAT test Environment"
(2) Modify the configuration file, the command line to 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<--Equipment
onboot=yes<--whether to start automatically
bootproto=static<--whether to use static IP
ipaddr=xxx.xxx.xxx.xx<--your IP.
netmask=255.255.255.0<--your subnet mask.
gateway=192.168.0.1 <--your gateway.
Make IP address effective:
/sbin/ifdown eth0
/sbin/ifup eth0
Configuring DNS Resolution
echo "NameServer 211.98.1.28" >>/etc/resolv.conf
Notification Gateway Update information:
/etc/init.d/network restart
DNS is domain name System, which converts a domain name such as www.21php.com to an IP address such as 211.152.50.35; without DNS, when browsing 21php.com this site, It must be accessed with such a 211.152.50.35 number. DNS servers are provided for DNS services. The DNS server can be divided into three types, a cache server (Cache-only server), a primary server (Primary name server), and a secondary server (Second name server).