The following settings are valid on the Self-installed vmwarevm. The client OS is RedHat;
I. Command Line Configuration
1. Set IP
Ifconfig eht0 netmask 255.255.255.0 192.168.1.129
Ifconfig eth0 down
Ifconfig eth0 up
The above settings are temporary settings. After the restart, the system will still use the default settings. The default network configuration file of the system is under the Change directory:
/Etc/sysconfig/networking/profiles/Default
(1) ifcfg-eth0 -- IP address, network mask, network address and other information, /etc/sysconfig/networking/devices/ifcfg-eth0 and/etc/sysconfig/network-scripts/ifcfg-eth0 are links to this file;
(2) Network -- hostname
(3) resolv. conf -- DNS
(4) hosts -- Host Name List./etc/hosts is the link to this file;
2. Set the Default Gateway
Route add default GW 192.168.1.1
3. Set DNS
Specify the DNS address in the resolv. conf file mentioned in 1,
Nameserver *.*.*.*
Nameserver *.*.*.*
You can set multiple
In this way, the machine should be able to access the Internet. If not, it will be on Google,
2. directly modify the configuration file mentioned above,
Or Setup/netconfig can be set directly through the graphical interface.
Appendix: Common TCP/IP configuration files in Linux
/Etc/sysconfig/network contains the most basic network information of the host for system startup. /Etc/sysconfig/network-script/This directory is some information used to open the network system at system startup, for example: the first Ethernet interface file is ifcfg-eth0. /Etc/xinetd. conf defines the network service started by the super process xinted. /Etc/hosts ing host names to IP addresses. /Etc/networks maps the domain name to the network address (network ID. /Etc/host. conf configure the control file of the Domain Name Service client. /Etc/resolv. conf: configure the configuration file of the Domain Name Service client, which is used to specify the location of the Domain Name Server. /Etc/protocols sets the protocol used by the host and the protocol numbers of each protocol. /Etc/services: Set network services with different ports on the host. |